vibora 1.9.1 → 1.10.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.
@@ -0,0 +1,51 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ function TA(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[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"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function o2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yg={exports:{}},hu={};var iS;function LA(){if(iS)return hu;iS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,u){var h=null;if(u!==void 0&&(h=""+u),o.key!==void 0&&(h=""+o.key),"key"in o){u={};for(var a in o)a!=="key"&&(u[a]=o[a])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:h,ref:o!==void 0?o:null,props:u}}return hu.Fragment=t,hu.jsx=n,hu.jsxs=n,hu}var oS;function AA(){return oS||(oS=1,Yg.exports=LA()),Yg.exports}var v=AA(),Xg={exports:{}},pt={};var aS;function OA(){if(aS)return pt;aS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function S(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function x(P,I,F){this.props=P,this.context=I,this.refs=b,this.updater=F||C}x.prototype.isReactComponent={},x.prototype.setState=function(P,I){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,I,"setState")},x.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function _(){}_.prototype=x.prototype;function y(P,I,F){this.props=P,this.context=I,this.refs=b,this.updater=F||C}var E=y.prototype=new _;E.constructor=y,w(E,x.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function D(P,I,F){var X=F.ref;return{$$typeof:e,type:P,key:I,ref:X!==void 0?X:null,props:F}}function z(P,I){return D(P.type,I,P.props)}function H(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function $(P){var I={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(F){return I[F]})}var N=/\/+/g;function q(P,I){return typeof P=="object"&&P!==null&&P.key!=null?$(""+P.key):I.toString(36)}function K(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(A,A):(P.status="pending",P.then(function(I){P.status==="pending"&&(P.status="fulfilled",P.value=I)},function(I){P.status==="pending"&&(P.status="rejected",P.reason=I)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function V(P,I,F,X,te){var ee=typeof P;(ee==="undefined"||ee==="boolean")&&(P=null);var Q=!1;if(P===null)Q=!0;else switch(ee){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(P.$$typeof){case e:case t:Q=!0;break;case p:return Q=P._init,V(Q(P._payload),I,F,X,te)}}if(Q)return te=te(P),Q=X===""?"."+q(P,0):X,T(te)?(F="",Q!=null&&(F=Q.replace(N,"$&/")+"/"),V(te,I,F,"",function(ne){return ne})):te!=null&&(H(te)&&(te=z(te,F+(te.key==null||P&&P.key===te.key?"":(""+te.key).replace(N,"$&/")+"/")+Q)),I.push(te)),1;Q=0;var U=X===""?".":X+":";if(T(P))for(var se=0;se<P.length;se++)X=P[se],ee=U+q(X,se),Q+=V(X,I,F,ee,te);else if(se=S(P),typeof se=="function")for(P=se.call(P),se=0;!(X=P.next()).done;)X=X.value,ee=U+q(X,se++),Q+=V(X,I,F,ee,te);else if(ee==="object"){if(typeof P.then=="function")return V(K(P),I,F,X,te);throw I=String(P),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Q}function Y(P,I,F){if(P==null)return P;var X=[],te=0;return V(P,X,"","",function(ee){return I.call(F,ee,te++)}),X}function G(P){if(P._status===-1){var I=P._result;I=I(),I.then(function(F){(P._status===0||P._status===-1)&&(P._status=1,P._result=F)},function(F){(P._status===0||P._status===-1)&&(P._status=2,P._result=F)}),P._status===-1&&(P._status=0,P._result=I)}if(P._status===1)return P._result.default;throw P._result}var j=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},W={map:Y,forEach:function(P,I,F){Y(P,function(){I.apply(this,arguments)},F)},count:function(P){var I=0;return Y(P,function(){I++}),I},toArray:function(P){return Y(P,function(I){return I})||[]},only:function(P){if(!H(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return pt.Activity=f,pt.Children=W,pt.Component=x,pt.Fragment=n,pt.Profiler=o,pt.PureComponent=y,pt.StrictMode=s,pt.Suspense=l,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,pt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return M.H.useMemoCache(P)}},pt.cache=function(P){return function(){return P.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(P,I,F){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var X=w({},P.props),te=P.key;if(I!=null)for(ee in I.key!==void 0&&(te=""+I.key),I)!L.call(I,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&I.ref===void 0||(X[ee]=I[ee]);var ee=arguments.length-2;if(ee===1)X.children=F;else if(1<ee){for(var Q=Array(ee),U=0;U<ee;U++)Q[U]=arguments[U+2];X.children=Q}return D(P.type,te,X)},pt.createContext=function(P){return P={$$typeof:h,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:u,_context:P},P},pt.createElement=function(P,I,F){var X,te={},ee=null;if(I!=null)for(X in I.key!==void 0&&(ee=""+I.key),I)L.call(I,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(te[X]=I[X]);var Q=arguments.length-2;if(Q===1)te.children=F;else if(1<Q){for(var U=Array(Q),se=0;se<Q;se++)U[se]=arguments[se+2];te.children=U}if(P&&P.defaultProps)for(X in Q=P.defaultProps,Q)te[X]===void 0&&(te[X]=Q[X]);return D(P,ee,te)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(P){return{$$typeof:a,render:P}},pt.isValidElement=H,pt.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:G}},pt.memo=function(P,I){return{$$typeof:d,type:P,compare:I===void 0?null:I}},pt.startTransition=function(P){var I=M.T,F={};M.T=F;try{var X=P(),te=M.S;te!==null&&te(F,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(A,j)}catch(ee){j(ee)}finally{I!==null&&F.types!==null&&(I.types=F.types),M.T=I}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(P){return M.H.use(P)},pt.useActionState=function(P,I,F){return M.H.useActionState(P,I,F)},pt.useCallback=function(P,I){return M.H.useCallback(P,I)},pt.useContext=function(P){return M.H.useContext(P)},pt.useDebugValue=function(){},pt.useDeferredValue=function(P,I){return M.H.useDeferredValue(P,I)},pt.useEffect=function(P,I){return M.H.useEffect(P,I)},pt.useEffectEvent=function(P){return M.H.useEffectEvent(P)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(P,I,F){return M.H.useImperativeHandle(P,I,F)},pt.useInsertionEffect=function(P,I){return M.H.useInsertionEffect(P,I)},pt.useLayoutEffect=function(P,I){return M.H.useLayoutEffect(P,I)},pt.useMemo=function(P,I){return M.H.useMemo(P,I)},pt.useOptimistic=function(P,I){return M.H.useOptimistic(P,I)},pt.useReducer=function(P,I,F){return M.H.useReducer(P,I,F)},pt.useRef=function(P){return M.H.useRef(P)},pt.useState=function(P){return M.H.useState(P)},pt.useSyncExternalStore=function(P,I,F){return M.H.useSyncExternalStore(P,I,F)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var lS;function ed(){return lS||(lS=1,Xg.exports=OA()),Xg.exports}var R=ed();const ze=o2(R),ip=TA({__proto__:null,default:ze},[R]);var Qg={exports:{}},pu={},Zg={exports:{}},Jg={};var cS;function MA(){return cS||(cS=1,(function(e){function t(V,Y){var G=V.length;V.push(Y);e:for(;0<G;){var j=G-1>>>1,W=V[j];if(0<o(W,Y))V[j]=Y,V[G]=W,G=j;else break e}}function n(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var Y=V[0],G=V.pop();if(G!==Y){V[0]=G;e:for(var j=0,W=V.length,P=W>>>1;j<P;){var I=2*(j+1)-1,F=V[I],X=I+1,te=V[X];if(0>o(F,G))X<W&&0>o(te,F)?(V[j]=te,V[X]=G,j=X):(V[j]=F,V[I]=G,j=I);else if(X<W&&0>o(te,G))V[j]=te,V[X]=G,j=X;else break e}}return Y}function o(V,Y){var G=V.sortIndex-Y.sortIndex;return G!==0?G:V.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var h=Date,a=h.now();e.unstable_now=function(){return h.now()-a}}var l=[],d=[],p=1,f=null,g=3,S=!1,C=!1,w=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var Y=n(d);Y!==null;){if(Y.callback===null)s(d);else if(Y.startTime<=V)s(d),Y.sortIndex=Y.expirationTime,t(l,Y);else break;Y=n(d)}}function T(V){if(w=!1,E(V),!C)if(n(l)!==null)C=!0,A||(A=!0,$());else{var Y=n(d);Y!==null&&K(T,Y.startTime-V)}}var A=!1,M=-1,L=5,D=-1;function z(){return b?!0:!(e.unstable_now()-D<L)}function H(){if(b=!1,A){var V=e.unstable_now();D=V;var Y=!0;try{e:{C=!1,w&&(w=!1,_(M),M=-1),S=!0;var G=g;try{t:{for(E(V),f=n(l);f!==null&&!(f.expirationTime>V&&z());){var j=f.callback;if(typeof j=="function"){f.callback=null,g=f.priorityLevel;var W=j(f.expirationTime<=V);if(V=e.unstable_now(),typeof W=="function"){f.callback=W,E(V),Y=!0;break t}f===n(l)&&s(l),E(V)}else s(l);f=n(l)}if(f!==null)Y=!0;else{var P=n(d);P!==null&&K(T,P.startTime-V),Y=!1}}break e}finally{f=null,g=G,S=!1}Y=void 0}}finally{Y?$():A=!1}}}var $;if(typeof y=="function")$=function(){y(H)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,q=N.port2;N.port1.onmessage=H,$=function(){q.postMessage(null)}}else $=function(){x(H,0)};function K(V,Y){M=x(function(){V(e.unstable_now())},Y)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var G=g;g=Y;try{return V()}finally{g=G}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var G=g;g=V;try{return Y()}finally{g=G}},e.unstable_scheduleCallback=function(V,Y,G){var j=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?j+G:j):G=j,V){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=G+W,V={id:p++,callback:Y,priorityLevel:V,startTime:G,expirationTime:W,sortIndex:-1},G>j?(V.sortIndex=G,t(d,V),n(l)===null&&V===n(d)&&(w?(_(M),M=-1):w=!0,K(T,G-j))):(V.sortIndex=W,t(l,V),C||S||(C=!0,A||(A=!0,$()))),V},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(V){var Y=g;return function(){var G=g;g=Y;try{return V.apply(this,arguments)}finally{g=G}}}})(Jg)),Jg}var uS;function DA(){return uS||(uS=1,Zg.exports=MA()),Zg.exports}var ev={exports:{}},Xn={};var dS;function PA(){if(dS)return Xn;dS=1;var e=ed();function t(l){var d="https://react.dev/errors/"+l;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 #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(l,d,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:l,containerInfo:d,implementation:p}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,d){if(l==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Xn.createPortal=function(l,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 u(l,d,null,p)},Xn.flushSync=function(l){var d=h.T,p=s.p;try{if(h.T=null,s.p=2,l)return l()}finally{h.T=d,s.p=p,s.d.f()}},Xn.preconnect=function(l,d){typeof l=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(l,d))},Xn.prefetchDNS=function(l){typeof l=="string"&&s.d.D(l)},Xn.preinit=function(l,d){if(typeof l=="string"&&d&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?s.d.S(l,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:S}):p==="script"&&s.d.X(l,{crossOrigin:f,integrity:g,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Xn.preinitModule=function(l,d){if(typeof l=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=a(d.as,d.crossOrigin);s.d.M(l,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(l)},Xn.preload=function(l,d){if(typeof l=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin);s.d.L(l,p,{crossOrigin:f,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})}},Xn.preloadModule=function(l,d){if(typeof l=="string")if(d){var p=a(d.as,d.crossOrigin);s.d.m(l,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(l)},Xn.requestFormReset=function(l){s.d.r(l)},Xn.unstable_batchedUpdates=function(l,d){return l(d)},Xn.useFormState=function(l,d,p){return h.H.useFormState(l,d,p)},Xn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Xn.version="19.2.3",Xn}var fS;function a2(){if(fS)return ev.exports;fS=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(),ev.exports=PA(),ev.exports}var hS;function jA(){if(hS)return pu;hS=1;var e=DA(),t=ed(),n=a2();function s(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,c=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(c=i.return),r=i.return;while(r)}return i.tag===3?c:null}function h(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function a(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function l(r){if(u(r)!==r)throw Error(s(188))}function d(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(s(188));return i!==r?null:r}for(var c=r,m=i;;){var k=c.return;if(k===null)break;var O=k.alternate;if(O===null){if(m=k.return,m!==null){c=m;continue}break}if(k.child===O.child){for(O=k.child;O;){if(O===c)return l(k),r;if(O===m)return l(k),i;O=O.sibling}throw Error(s(188))}if(c.return!==m.return)c=k,m=O;else{for(var B=!1,Z=k.child;Z;){if(Z===c){B=!0,c=k,m=O;break}if(Z===m){B=!0,m=k,c=O;break}Z=Z.sibling}if(!B){for(Z=O.child;Z;){if(Z===c){B=!0,c=O,m=k;break}if(Z===m){B=!0,m=O,c=k;break}Z=Z.sibling}if(!B)throw Error(s(189))}}if(c.alternate!==m)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var f=Object.assign,g=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function $(r){return r===null||typeof r!="object"?null:(r=H&&r[H]||r["@@iterator"],typeof r=="function"?r:null)}var N=Symbol.for("react.client.reference");function q(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===N?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case x:return"Profiler";case b:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case D:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case C:return"Portal";case y:return r.displayName||"Context";case _:return(r._context.displayName||"Context")+".Consumer";case E:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:q(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return q(r(i))}catch{}}return null}var K=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},j=[],W=-1;function P(r){return{current:r}}function I(r){0>W||(r.current=j[W],j[W]=null,W--)}function F(r,i){W++,j[W]=r.current,r.current=i}var X=P(null),te=P(null),ee=P(null),Q=P(null);function U(r,i){switch(F(ee,i),F(te,r),F(X,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?Tx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=Tx(i),r=Lx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}I(X),F(X,r)}function se(){I(X),I(te),I(ee)}function ne(r){r.memoizedState!==null&&F(Q,r);var i=X.current,c=Lx(i,r.type);i!==c&&(F(te,r),F(X,c))}function re(r){te.current===r&&(I(X),I(te)),Q.current===r&&(I(Q),cu._currentValue=G)}var oe,le;function _e(r){if(oe===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);oe=i&&i[1]||"",le=-1<c.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+oe+r+le}var ge=!1;function ue(r,i){if(!r||ge)return"";ge=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(ye){var me=ye}Reflect.construct(r,[],Le)}else{try{Le.call()}catch(ye){me=ye}r.call(Le.prototype)}}else{try{throw Error()}catch(ye){me=ye}(Le=r())&&typeof Le.catch=="function"&&Le.catch(function(){})}}catch(ye){if(ye&&me&&typeof ye.stack=="string")return[ye.stack,me.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=m.DetermineComponentFrameRoot(),B=O[0],Z=O[1];if(B&&Z){var ie=B.split(`
5
+ `),he=Z.split(`
6
+ `);for(k=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;k<he.length&&!he[k].includes("DetermineComponentFrameRoot");)k++;if(m===ie.length||k===he.length)for(m=ie.length-1,k=he.length-1;1<=m&&0<=k&&ie[m]!==he[k];)k--;for(;1<=m&&0<=k;m--,k--)if(ie[m]!==he[k]){if(m!==1||k!==1)do if(m--,k--,0>k||ie[m]!==he[k]){var Ce=`
7
+ `+ie[m].replace(" at new "," at ");return r.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",r.displayName)),Ce}while(1<=m&&0<=k);break}}}finally{ge=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?_e(c):""}function de(r,i){switch(r.tag){case 26:case 27:case 5:return _e(r.type);case 16:return _e("Lazy");case 13:return r.child!==i&&i!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return ue(r.type,!1);case 11:return ue(r.type.render,!1);case 1:return ue(r.type,!0);case 31:return _e("Activity");default:return""}}function Ie(r){try{var i="",c=null;do i+=de(r,c),c=r,r=r.return;while(r);return i}catch(m){return`
8
+ Error generating stack: `+m.message+`
9
+ `+m.stack}}var De=Object.prototype.hasOwnProperty,Oe=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Me=e.unstable_shouldYield,pe=e.unstable_requestPaint,ke=e.unstable_now,we=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,et=e.unstable_UserBlockingPriority,xe=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,tt=e.unstable_IdlePriority,dt=e.log,Se=e.unstable_setDisableYieldValue,He=null,Re=null;function nt(r){if(typeof dt=="function"&&Se(r),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(He,r)}catch{}}var lt=Math.clz32?Math.clz32:Ct,Xe=Math.log,st=Math.LN2;function Ct(r){return r>>>=0,r===0?32:31-(Xe(r)/st|0)|0}var ct=256,nn=262144,kt=4194304;function vt(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Je(r,i,c){var m=r.pendingLanes;if(m===0)return 0;var k=0,O=r.suspendedLanes,B=r.pingedLanes;r=r.warmLanes;var Z=m&134217727;return Z!==0?(m=Z&~O,m!==0?k=vt(m):(B&=Z,B!==0?k=vt(B):c||(c=Z&~r,c!==0&&(k=vt(c))))):(Z=m&~O,Z!==0?k=vt(Z):B!==0?k=vt(B):c||(c=m&~r,c!==0&&(k=vt(c)))),k===0?0:i!==0&&i!==k&&(i&O)===0&&(O=k&-k,c=i&-i,O>=c||O===32&&(c&4194048)!==0)?i:k}function Ot(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function It(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var r=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),r}function wt(r){for(var i=[],c=0;31>c;c++)i.push(r);return i}function bt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function xt(r,i,c,m,k,O){var B=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var Z=r.entanglements,ie=r.expirationTimes,he=r.hiddenUpdates;for(c=B&~c;0<c;){var Ce=31-lt(c),Le=1<<Ce;Z[Ce]=0,ie[Ce]=-1;var me=he[Ce];if(me!==null)for(he[Ce]=null,Ce=0;Ce<me.length;Ce++){var ye=me[Ce];ye!==null&&(ye.lane&=-536870913)}c&=~Le}m!==0&&Qe(r,m,0),O!==0&&k===0&&r.tag!==0&&(r.suspendedLanes|=O&~(B&~i))}function Qe(r,i,c){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-lt(i);r.entangledLanes|=i,r.entanglements[m]=r.entanglements[m]|1073741824|c&261930}function Ht(r,i){var c=r.entangledLanes|=i;for(r=r.entanglements;c;){var m=31-lt(c),k=1<<m;k&i|r[m]&i&&(r[m]|=i),c&=~k}}function kn(r,i){var c=i&-i;return c=(c&42)!==0?1:Yn(c),(c&(r.suspendedLanes|i))!==0?0:c}function Yn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function zn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Es(){var r=Y.p;return r!==0?r:(r=window.event,r===void 0?32:Zx(r.type))}function Va(r,i){var c=Y.p;try{return Y.p=r,i()}finally{Y.p=c}}var wr=Math.random().toString(36).slice(2),pn="__reactFiber$"+wr,mn="__reactProps$"+wr,Rs="__reactContainer$"+wr,Er="__reactEvents$"+wr,Xs="__reactListeners$"+wr,Up="__reactHandles$"+wr,xc="__reactResources$"+wr,ko="__reactMarker$"+wr;function To(r){delete r[pn],delete r[mn],delete r[Er],delete r[Xs],delete r[Up]}function Qs(r){var i=r[pn];if(i)return i;for(var c=r.parentNode;c;){if(i=c[Rs]||c[pn]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(r=Ix(r);r!==null;){if(c=r[pn])return c;r=Ix(r)}return i}r=c,c=r.parentNode}return null}function ks(r){if(r=r[pn]||r[Rs]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Lo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(s(33))}function ds(r){var i=r[xc];return i||(i=r[xc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gn(r){r[ko]=!0}var tr=new Set,nr={};function Rr(r,i){fs(r,i),fs(r+"Capture",i)}function fs(r,i){for(nr[r]=i,r=0;r<i.length;r++)tr.add(i[r])}var Wp=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]*$"),Ua={},Wa={};function qp(r){return De.call(Wa,r)?!0:De.call(Ua,r)?!1:Wp.test(r)?Wa[r]=!0:(Ua[r]=!0,!1)}function Zs(r,i,c){if(qp(i))if(c===null)r.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+c)}}function Li(r,i,c){if(c===null)r.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+c)}}function kr(r,i,c,m){if(m===null)r.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(i,c,""+m)}}function lr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function yd(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Gp(r,i,c){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var k=m.get,O=m.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return k.call(this)},set:function(B){c=""+B,O.call(this,B)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(B){c=""+B},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Sc(r){if(!r._valueTracker){var i=yd(r)?"checked":"value";r._valueTracker=Gp(r,i,""+r[i])}}function qa(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var c=i.getValue(),m="";return r&&(m=yd(r)?r.checked?"true":"false":r.value),r=m,r!==c?(i.setValue(r),!0):!1}function Ai(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Cc=/[\n"\\]/g;function cr(r){return r.replace(Cc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function wc(r,i,c,m,k,O,B,Z){r.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?r.type=B:r.removeAttribute("type"),i!=null?B==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+lr(i)):r.value!==""+lr(i)&&(r.value=""+lr(i)):B!=="submit"&&B!=="reset"||r.removeAttribute("value"),i!=null?Ec(r,B,lr(i)):c!=null?Ec(r,B,lr(c)):m!=null&&r.removeAttribute("value"),k==null&&O!=null&&(r.defaultChecked=!!O),k!=null&&(r.checked=k&&typeof k!="function"&&typeof k!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?r.name=""+lr(Z):r.removeAttribute("name")}function bd(r,i,c,m,k,O,B,Z){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.type=O),i!=null||c!=null){if(!(O!=="submit"&&O!=="reset"||i!=null)){Sc(r);return}c=c!=null?""+lr(c):"",i=i!=null?""+lr(i):c,Z||i===r.value||(r.value=i),r.defaultValue=i}m=m??k,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=Z?r.checked:!!m,r.defaultChecked=!!m,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(r.name=B),Sc(r)}function Ec(r,i,c){i==="number"&&Ai(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Oi(r,i,c,m){if(r=r.options,i){i={};for(var k=0;k<c.length;k++)i["$"+c[k]]=!0;for(c=0;c<r.length;c++)k=i.hasOwnProperty("$"+r[c].value),r[c].selected!==k&&(r[c].selected=k),k&&m&&(r[c].defaultSelected=!0)}else{for(c=""+lr(c),i=null,k=0;k<r.length;k++){if(r[k].value===c){r[k].selected=!0,m&&(r[k].defaultSelected=!0);return}i!==null||r[k].disabled||(i=r[k])}i!==null&&(i.selected=!0)}}function xd(r,i,c){if(i!=null&&(i=""+lr(i),i!==r.value&&(r.value=i),c==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=c!=null?""+lr(c):""}function Ve(r,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if(K(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),i=c}c=lr(i),r.defaultValue=c,m=r.textContent,m===c&&m!==""&&m!==null&&(r.value=m),Sc(r)}function rt(r,i){if(i){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=i;return}}r.textContent=i}var mt=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 $t(r,i,c){var m=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":m?r.setProperty(i,c):typeof c!="number"||c===0||mt.has(i)?i==="float"?r.cssFloat=c:r[i]=(""+c).trim():r[i]=c+"px"}function rn(r,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(r=r.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var k in i)m=i[k],i.hasOwnProperty(k)&&c[k]!==m&&$t(r,k,m)}else for(var O in i)i.hasOwnProperty(O)&&$t(r,O,i[O])}function vn(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Js=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"]]),ei=/^[\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 ti(r){return ei.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function hs(){}var Sd=null;function $p(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ga=null,$a=null;function ky(r){var i=ks(r);if(i&&(r=i.stateNode)){var c=r[mn]||null;e:switch(r=i.stateNode,i.type){case"input":if(wc(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+cr(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var m=c[i];if(m!==r&&m.form===r.form){var k=m[mn]||null;if(!k)throw Error(s(90));wc(m,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(i=0;i<c.length;i++)m=c[i],m.form===r.form&&qa(m)}break e;case"textarea":xd(r,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Oi(r,!!c.multiple,i,!1)}}}var Kp=!1;function Ty(r,i,c){if(Kp)return r(i,c);Kp=!0;try{var m=r(i);return m}finally{if(Kp=!1,(Ga!==null||$a!==null)&&(uf(),Ga&&(i=Ga,r=$a,$a=Ga=null,ky(i),r)))for(i=0;i<r.length;i++)ky(r[i])}}function Rc(r,i){var c=r.stateNode;if(c===null)return null;var m=c[mn]||null;if(m===null)return null;c=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yp=!1;if(ni)try{var kc={};Object.defineProperty(kc,"passive",{get:function(){Yp=!0}}),window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{Yp=!1}var Mi=null,Xp=null,Cd=null;function Ly(){if(Cd)return Cd;var r,i=Xp,c=i.length,m,k="value"in Mi?Mi.value:Mi.textContent,O=k.length;for(r=0;r<c&&i[r]===k[r];r++);var B=c-r;for(m=1;m<=B&&i[c-m]===k[O-m];m++);return Cd=k.slice(r,1<m?1-m:void 0)}function wd(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Ed(){return!0}function Ay(){return!1}function ur(r){function i(c,m,k,O,B){this._reactName=c,this._targetInst=k,this.type=m,this.nativeEvent=O,this.target=B,this.currentTarget=null;for(var Z in r)r.hasOwnProperty(Z)&&(c=r[Z],this[Z]=c?c(O):O[Z]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Ed:Ay,this.isPropagationStopped=Ay,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),i}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=ur(Ao),Tc=f({},Ao,{view:0,detail:0}),R5=ur(Tc),Qp,Zp,Lc,kd=f({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:em,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Lc&&(Lc&&r.type==="mousemove"?(Qp=r.screenX-Lc.screenX,Zp=r.screenY-Lc.screenY):Zp=Qp=0,Lc=r),Qp)},movementY:function(r){return"movementY"in r?r.movementY:Zp}}),Oy=ur(kd),k5=f({},kd,{dataTransfer:0}),T5=ur(k5),L5=f({},Tc,{relatedTarget:0}),Jp=ur(L5),A5=f({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),O5=ur(A5),M5=f({},Ao,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),D5=ur(M5),P5=f({},Ao,{data:0}),My=ur(P5),j5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I5={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"},N5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B5(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=N5[r])?!!i[r]:!1}function em(){return B5}var z5=f({},Tc,{key:function(r){if(r.key){var i=j5[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=wd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?I5[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:em,charCode:function(r){return r.type==="keypress"?wd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?wd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),H5=ur(z5),F5=f({},kd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dy=ur(F5),V5=f({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:em}),U5=ur(V5),W5=f({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),q5=ur(W5),G5=f({},kd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),$5=ur(G5),K5=f({},Ao,{newState:0,oldState:0}),Y5=ur(K5),X5=[9,13,27,32],tm=ni&&"CompositionEvent"in window,Ac=null;ni&&"documentMode"in document&&(Ac=document.documentMode);var Q5=ni&&"TextEvent"in window&&!Ac,Py=ni&&(!tm||Ac&&8<Ac&&11>=Ac),jy=" ",Iy=!1;function Ny(r,i){switch(r){case"keyup":return X5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function By(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ka=!1;function Z5(r,i){switch(r){case"compositionend":return By(i);case"keypress":return i.which!==32?null:(Iy=!0,jy);case"textInput":return r=i.data,r===jy&&Iy?null:r;default:return null}}function J5(r,i){if(Ka)return r==="compositionend"||!tm&&Ny(r,i)?(r=Ly(),Cd=Xp=Mi=null,Ka=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Py&&i.locale!=="ko"?null:i.data;default:return null}}var eL={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 zy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!eL[r.type]:i==="textarea"}function Hy(r,i,c,m){Ga?$a?$a.push(m):$a=[m]:Ga=m,i=vf(i,"onChange"),0<i.length&&(c=new Rd("onChange","change",null,c,m),r.push({event:c,listeners:i}))}var Oc=null,Mc=null;function tL(r){Sx(r,0)}function Td(r){var i=Lo(r);if(qa(i))return r}function Fy(r,i){if(r==="change")return i}var Vy=!1;if(ni){var nm;if(ni){var rm="oninput"in document;if(!rm){var Uy=document.createElement("div");Uy.setAttribute("oninput","return;"),rm=typeof Uy.oninput=="function"}nm=rm}else nm=!1;Vy=nm&&(!document.documentMode||9<document.documentMode)}function Wy(){Oc&&(Oc.detachEvent("onpropertychange",qy),Mc=Oc=null)}function qy(r){if(r.propertyName==="value"&&Td(Mc)){var i=[];Hy(i,Mc,r,$p(r)),Ty(tL,i)}}function nL(r,i,c){r==="focusin"?(Wy(),Oc=i,Mc=c,Oc.attachEvent("onpropertychange",qy)):r==="focusout"&&Wy()}function rL(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Td(Mc)}function sL(r,i){if(r==="click")return Td(i)}function iL(r,i){if(r==="input"||r==="change")return Td(i)}function oL(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Tr=typeof Object.is=="function"?Object.is:oL;function Dc(r,i){if(Tr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var c=Object.keys(r),m=Object.keys(i);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var k=c[m];if(!De.call(i,k)||!Tr(r[k],i[k]))return!1}return!0}function Gy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function $y(r,i){var c=Gy(r);r=0;for(var m;c;){if(c.nodeType===3){if(m=r+c.textContent.length,r<=i&&m>=i)return{node:c,offset:i-r};r=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Gy(c)}}function Ky(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Ky(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Yy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ai(r.document);i instanceof r.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)r=i.contentWindow;else break;i=Ai(r.document)}return i}function sm(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var aL=ni&&"documentMode"in document&&11>=document.documentMode,Ya=null,im=null,Pc=null,om=!1;function Xy(r,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;om||Ya==null||Ya!==Ai(m)||(m=Ya,"selectionStart"in m&&sm(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Pc&&Dc(Pc,m)||(Pc=m,m=vf(im,"onSelect"),0<m.length&&(i=new Rd("onSelect","select",null,i,c),r.push({event:i,listeners:m}),i.target=Ya)))}function Oo(r,i){var c={};return c[r.toLowerCase()]=i.toLowerCase(),c["Webkit"+r]="webkit"+i,c["Moz"+r]="moz"+i,c}var Xa={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},am={},Qy={};ni&&(Qy=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function Mo(r){if(am[r])return am[r];if(!Xa[r])return r;var i=Xa[r],c;for(c in i)if(i.hasOwnProperty(c)&&c in Qy)return am[r]=i[c];return r}var Zy=Mo("animationend"),Jy=Mo("animationiteration"),eb=Mo("animationstart"),lL=Mo("transitionrun"),cL=Mo("transitionstart"),uL=Mo("transitioncancel"),tb=Mo("transitionend"),nb=new Map,lm="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(" ");lm.push("scrollEnd");function ps(r,i){nb.set(r,i),Rr(i,[r])}var Ld=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Wr=[],Qa=0,cm=0;function Ad(){for(var r=Qa,i=cm=Qa=0;i<r;){var c=Wr[i];Wr[i++]=null;var m=Wr[i];Wr[i++]=null;var k=Wr[i];Wr[i++]=null;var O=Wr[i];if(Wr[i++]=null,m!==null&&k!==null){var B=m.pending;B===null?k.next=k:(k.next=B.next,B.next=k),m.pending=k}O!==0&&rb(c,k,O)}}function Od(r,i,c,m){Wr[Qa++]=r,Wr[Qa++]=i,Wr[Qa++]=c,Wr[Qa++]=m,cm|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function um(r,i,c,m){return Od(r,i,c,m),Md(r)}function Do(r,i){return Od(r,null,null,i),Md(r)}function rb(r,i,c){r.lanes|=c;var m=r.alternate;m!==null&&(m.lanes|=c);for(var k=!1,O=r.return;O!==null;)O.childLanes|=c,m=O.alternate,m!==null&&(m.childLanes|=c),O.tag===22&&(r=O.stateNode,r===null||r._visibility&1||(k=!0)),r=O,O=O.return;return r.tag===3?(O=r.stateNode,k&&i!==null&&(k=31-lt(c),r=O.hiddenUpdates,m=r[k],m===null?r[k]=[i]:m.push(i),i.lane=c|536870912),O):null}function Md(r){if(50<nu)throw nu=0,yg=null,Error(s(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Za={};function dL(r,i,c,m){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(r,i,c,m){return new dL(r,i,c,m)}function dm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ri(r,i){var c=r.alternate;return c===null?(c=Lr(r.tag,i,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=i,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,i=r.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function sb(r,i){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,i=c.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Dd(r,i,c,m,k,O){var B=0;if(m=r,typeof r=="function")dm(r)&&(B=1);else if(typeof r=="string")B=gA(r,c,X.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Lr(31,c,i,k),r.elementType=D,r.lanes=O,r;case w:return Po(c.children,k,O,i);case b:B=8,k|=24;break;case x:return r=Lr(12,c,i,k|2),r.elementType=x,r.lanes=O,r;case T:return r=Lr(13,c,i,k),r.elementType=T,r.lanes=O,r;case A:return r=Lr(19,c,i,k),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case y:B=10;break e;case _:B=9;break e;case E:B=11;break e;case M:B=14;break e;case L:B=16,m=null;break e}B=29,c=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Lr(B,c,i,k),i.elementType=r,i.type=m,i.lanes=O,i}function Po(r,i,c,m){return r=Lr(7,r,m,i),r.lanes=c,r}function fm(r,i,c){return r=Lr(6,r,null,i),r.lanes=c,r}function ib(r){var i=Lr(18,null,null,0);return i.stateNode=r,i}function hm(r,i,c){return i=Lr(4,r.children!==null?r.children:[],r.key,i),i.lanes=c,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var ob=new WeakMap;function qr(r,i){if(typeof r=="object"&&r!==null){var c=ob.get(r);return c!==void 0?c:(i={value:r,source:i,stack:Ie(i)},ob.set(r,i),i)}return{value:r,source:i,stack:Ie(i)}}var Ja=[],el=0,Pd=null,jc=0,Gr=[],$r=0,Di=null,Ts=1,Ls="";function si(r,i){Ja[el++]=jc,Ja[el++]=Pd,Pd=r,jc=i}function ab(r,i,c){Gr[$r++]=Ts,Gr[$r++]=Ls,Gr[$r++]=Di,Di=r;var m=Ts;r=Ls;var k=32-lt(m)-1;m&=~(1<<k),c+=1;var O=32-lt(i)+k;if(30<O){var B=k-k%5;O=(m&(1<<B)-1).toString(32),m>>=B,k-=B,Ts=1<<32-lt(i)+k|c<<k|m,Ls=O+r}else Ts=1<<O|c<<k|m,Ls=r}function pm(r){r.return!==null&&(si(r,1),ab(r,1,0))}function mm(r){for(;r===Pd;)Pd=Ja[--el],Ja[el]=null,jc=Ja[--el],Ja[el]=null;for(;r===Di;)Di=Gr[--$r],Gr[$r]=null,Ls=Gr[--$r],Gr[$r]=null,Ts=Gr[--$r],Gr[$r]=null}function lb(r,i){Gr[$r++]=Ts,Gr[$r++]=Ls,Gr[$r++]=Di,Ts=i.id,Ls=i.overflow,Di=r}var Hn=null,Yt=null,At=!1,Pi=null,Kr=!1,gm=Error(s(519));function ji(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ic(qr(i,r)),gm}function cb(r){var i=r.stateNode,c=r.type,m=r.memoizedProps;switch(i[pn]=r,i[mn]=m,c){case"dialog":Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":case"embed":Rt("load",i);break;case"video":case"audio":for(c=0;c<su.length;c++)Rt(su[c],i);break;case"source":Rt("error",i);break;case"img":case"image":case"link":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"input":Rt("invalid",i),bd(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Rt("invalid",i);break;case"textarea":Rt("invalid",i),Ve(i,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||m.suppressHydrationWarning===!0||Rx(i.textContent,c)?(m.popover!=null&&(Rt("beforetoggle",i),Rt("toggle",i)),m.onScroll!=null&&Rt("scroll",i),m.onScrollEnd!=null&&Rt("scrollend",i),m.onClick!=null&&(i.onclick=hs),i=!0):i=!1,i||ji(r,!0)}function ub(r){for(Hn=r.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Kr=!1;return;case 27:case 3:Kr=!0;return;default:Hn=Hn.return}}function tl(r){if(r!==Hn)return!1;if(!At)return ub(r),At=!0,!1;var i=r.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||Pg(r.type,r.memoizedProps)),c=!c),c&&Yt&&ji(r),ub(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=jx(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=jx(r)}else i===27?(i=Yt,Yi(r.type)?(r=zg,zg=null,Yt=r):Yt=i):Yt=Hn?Xr(r.stateNode.nextSibling):null;return!0}function jo(){Yt=Hn=null,At=!1}function vm(){var r=Pi;return r!==null&&(pr===null?pr=r:pr.push.apply(pr,r),Pi=null),r}function Ic(r){Pi===null?Pi=[r]:Pi.push(r)}var _m=P(null),Io=null,ii=null;function Ii(r,i,c){F(_m,i._currentValue),i._currentValue=c}function oi(r){r._currentValue=_m.current,I(_m)}function ym(r,i,c){for(;r!==null;){var m=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),r===c)break;r=r.return}}function bm(r,i,c,m){var k=r.child;for(k!==null&&(k.return=r);k!==null;){var O=k.dependencies;if(O!==null){var B=k.child;O=O.firstContext;e:for(;O!==null;){var Z=O;O=k;for(var ie=0;ie<i.length;ie++)if(Z.context===i[ie]){O.lanes|=c,Z=O.alternate,Z!==null&&(Z.lanes|=c),ym(O.return,c,r),m||(B=null);break e}O=Z.next}}else if(k.tag===18){if(B=k.return,B===null)throw Error(s(341));B.lanes|=c,O=B.alternate,O!==null&&(O.lanes|=c),ym(B,c,r),B=null}else B=k.child;if(B!==null)B.return=k;else for(B=k;B!==null;){if(B===r){B=null;break}if(k=B.sibling,k!==null){k.return=B.return,B=k;break}B=B.return}k=B}}function nl(r,i,c,m){r=null;for(var k=i,O=!1;k!==null;){if(!O){if((k.flags&524288)!==0)O=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var B=k.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var Z=k.type;Tr(k.pendingProps.value,B.value)||(r!==null?r.push(Z):r=[Z])}}else if(k===Q.current){if(B=k.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(r!==null?r.push(cu):r=[cu])}k=k.return}r!==null&&bm(i,r,c,m),i.flags|=262144}function jd(r){for(r=r.firstContext;r!==null;){if(!Tr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function No(r){Io=r,ii=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Fn(r){return db(Io,r)}function Id(r,i){return Io===null&&No(r),db(r,i)}function db(r,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},ii===null){if(r===null)throw Error(s(308));ii=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ii=ii.next=i;return c}var fL=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(c,m){r.push(m)}};this.abort=function(){i.aborted=!0,r.forEach(function(c){return c()})}},hL=e.unstable_scheduleCallback,pL=e.unstable_NormalPriority,_n={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xm(){return{controller:new fL,data:new Map,refCount:0}}function Nc(r){r.refCount--,r.refCount===0&&hL(pL,function(){r.controller.abort()})}var Bc=null,Sm=0,rl=0,sl=null;function mL(r,i){if(Bc===null){var c=Bc=[];Sm=0,rl=Eg(),sl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return Sm++,i.then(fb,fb),i}function fb(){if(--Sm===0&&Bc!==null){sl!==null&&(sl.status="fulfilled");var r=Bc;Bc=null,rl=0,sl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function gL(r,i){var c=[],m={status:"pending",value:null,reason:null,then:function(k){c.push(k)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var k=0;k<c.length;k++)(0,c[k])(i)},function(k){for(m.status="rejected",m.reason=k,k=0;k<c.length;k++)(0,c[k])(void 0)}),m}var hb=V.S;V.S=function(r,i){X1=ke(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&mL(r,i),hb!==null&&hb(r,i)};var Bo=P(null);function Cm(){var r=Bo.current;return r!==null?r:qt.pooledCache}function Nd(r,i){i===null?F(Bo,Bo.current):F(Bo,i.pool)}function pb(){var r=Cm();return r===null?null:{parent:_n._currentValue,pool:r}}var il=Error(s(460)),wm=Error(s(474)),Bd=Error(s(542)),zd={then:function(){}};function mb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function gb(r,i,c){switch(c=r[c],c===void 0?r.push(i):c!==i&&(i.then(hs,hs),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,_b(r),r;default:if(typeof i.status=="string")i.then(hs,hs);else{if(r=qt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=i,r.status="pending",r.then(function(m){if(i.status==="pending"){var k=i;k.status="fulfilled",k.value=m}},function(m){if(i.status==="pending"){var k=i;k.status="rejected",k.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,_b(r),r}throw Ho=i,il}}function zo(r){try{var i=r._init;return i(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ho=c,il):c}}var Ho=null;function vb(){if(Ho===null)throw Error(s(459));var r=Ho;return Ho=null,r}function _b(r){if(r===il||r===Bd)throw Error(s(483))}var ol=null,zc=0;function Hd(r){var i=zc;return zc+=1,ol===null&&(ol=[]),gb(ol,r,i)}function Hc(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Fd(r,i){throw i.$$typeof===g?Error(s(525)):(r=Object.prototype.toString.call(i),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function yb(r){function i(ce,ae){if(r){var fe=ce.deletions;fe===null?(ce.deletions=[ae],ce.flags|=16):fe.push(ae)}}function c(ce,ae){if(!r)return null;for(;ae!==null;)i(ce,ae),ae=ae.sibling;return null}function m(ce){for(var ae=new Map;ce!==null;)ce.key!==null?ae.set(ce.key,ce):ae.set(ce.index,ce),ce=ce.sibling;return ae}function k(ce,ae){return ce=ri(ce,ae),ce.index=0,ce.sibling=null,ce}function O(ce,ae,fe){return ce.index=fe,r?(fe=ce.alternate,fe!==null?(fe=fe.index,fe<ae?(ce.flags|=67108866,ae):fe):(ce.flags|=67108866,ae)):(ce.flags|=1048576,ae)}function B(ce){return r&&ce.alternate===null&&(ce.flags|=67108866),ce}function Z(ce,ae,fe,Te){return ae===null||ae.tag!==6?(ae=fm(fe,ce.mode,Te),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function ie(ce,ae,fe,Te){var it=fe.type;return it===w?Ce(ce,ae,fe.props.children,Te,fe.key):ae!==null&&(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&zo(it)===ae.type)?(ae=k(ae,fe.props),Hc(ae,fe),ae.return=ce,ae):(ae=Dd(fe.type,fe.key,fe.props,null,ce.mode,Te),Hc(ae,fe),ae.return=ce,ae)}function he(ce,ae,fe,Te){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==fe.containerInfo||ae.stateNode.implementation!==fe.implementation?(ae=hm(fe,ce.mode,Te),ae.return=ce,ae):(ae=k(ae,fe.children||[]),ae.return=ce,ae)}function Ce(ce,ae,fe,Te,it){return ae===null||ae.tag!==7?(ae=Po(fe,ce.mode,Te,it),ae.return=ce,ae):(ae=k(ae,fe),ae.return=ce,ae)}function Le(ce,ae,fe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=fm(""+ae,ce.mode,fe),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:return fe=Dd(ae.type,ae.key,ae.props,null,ce.mode,fe),Hc(fe,ae),fe.return=ce,fe;case C:return ae=hm(ae,ce.mode,fe),ae.return=ce,ae;case L:return ae=zo(ae),Le(ce,ae,fe)}if(K(ae)||$(ae))return ae=Po(ae,ce.mode,fe,null),ae.return=ce,ae;if(typeof ae.then=="function")return Le(ce,Hd(ae),fe);if(ae.$$typeof===y)return Le(ce,Id(ce,ae),fe);Fd(ce,ae)}return null}function me(ce,ae,fe,Te){var it=ae!==null?ae.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return it!==null?null:Z(ce,ae,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:return fe.key===it?ie(ce,ae,fe,Te):null;case C:return fe.key===it?he(ce,ae,fe,Te):null;case L:return fe=zo(fe),me(ce,ae,fe,Te)}if(K(fe)||$(fe))return it!==null?null:Ce(ce,ae,fe,Te,null);if(typeof fe.then=="function")return me(ce,ae,Hd(fe),Te);if(fe.$$typeof===y)return me(ce,ae,Id(ce,fe),Te);Fd(ce,fe)}return null}function ye(ce,ae,fe,Te,it){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ce=ce.get(fe)||null,Z(ae,ce,""+Te,it);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case S:return ce=ce.get(Te.key===null?fe:Te.key)||null,ie(ae,ce,Te,it);case C:return ce=ce.get(Te.key===null?fe:Te.key)||null,he(ae,ce,Te,it);case L:return Te=zo(Te),ye(ce,ae,fe,Te,it)}if(K(Te)||$(Te))return ce=ce.get(fe)||null,Ce(ae,ce,Te,it,null);if(typeof Te.then=="function")return ye(ce,ae,fe,Hd(Te),it);if(Te.$$typeof===y)return ye(ce,ae,fe,Id(ae,Te),it);Fd(ae,Te)}return null}function $e(ce,ae,fe,Te){for(var it=null,Mt=null,Ze=ae,_t=ae=0,Lt=null;Ze!==null&&_t<fe.length;_t++){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Dt=me(ce,Ze,fe[_t],Te);if(Dt===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Dt.alternate===null&&i(ce,Ze),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt,Ze=Lt}if(_t===fe.length)return c(ce,Ze),At&&si(ce,_t),it;if(Ze===null){for(;_t<fe.length;_t++)Ze=Le(ce,fe[_t],Te),Ze!==null&&(ae=O(Ze,ae,_t),Mt===null?it=Ze:Mt.sibling=Ze,Mt=Ze);return At&&si(ce,_t),it}for(Ze=m(Ze);_t<fe.length;_t++)Lt=ye(Ze,ce,_t,fe[_t],Te),Lt!==null&&(r&&Lt.alternate!==null&&Ze.delete(Lt.key===null?_t:Lt.key),ae=O(Lt,ae,_t),Mt===null?it=Lt:Mt.sibling=Lt,Mt=Lt);return r&&Ze.forEach(function(eo){return i(ce,eo)}),At&&si(ce,_t),it}function ut(ce,ae,fe,Te){if(fe==null)throw Error(s(151));for(var it=null,Mt=null,Ze=ae,_t=ae=0,Lt=null,Dt=fe.next();Ze!==null&&!Dt.done;_t++,Dt=fe.next()){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var eo=me(ce,Ze,Dt.value,Te);if(eo===null){Ze===null&&(Ze=Lt);break}r&&Ze&&eo.alternate===null&&i(ce,Ze),ae=O(eo,ae,_t),Mt===null?it=eo:Mt.sibling=eo,Mt=eo,Ze=Lt}if(Dt.done)return c(ce,Ze),At&&si(ce,_t),it;if(Ze===null){for(;!Dt.done;_t++,Dt=fe.next())Dt=Le(ce,Dt.value,Te),Dt!==null&&(ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return At&&si(ce,_t),it}for(Ze=m(Ze);!Dt.done;_t++,Dt=fe.next())Dt=ye(Ze,ce,_t,Dt.value,Te),Dt!==null&&(r&&Dt.alternate!==null&&Ze.delete(Dt.key===null?_t:Dt.key),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return r&&Ze.forEach(function(kA){return i(ce,kA)}),At&&si(ce,_t),it}function Ut(ce,ae,fe,Te){if(typeof fe=="object"&&fe!==null&&fe.type===w&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case S:e:{for(var it=fe.key;ae!==null;){if(ae.key===it){if(it=fe.type,it===w){if(ae.tag===7){c(ce,ae.sibling),Te=k(ae,fe.props.children),Te.return=ce,ce=Te;break e}}else if(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&zo(it)===ae.type){c(ce,ae.sibling),Te=k(ae,fe.props),Hc(Te,fe),Te.return=ce,ce=Te;break e}c(ce,ae);break}else i(ce,ae);ae=ae.sibling}fe.type===w?(Te=Po(fe.props.children,ce.mode,Te,fe.key),Te.return=ce,ce=Te):(Te=Dd(fe.type,fe.key,fe.props,null,ce.mode,Te),Hc(Te,fe),Te.return=ce,ce=Te)}return B(ce);case C:e:{for(it=fe.key;ae!==null;){if(ae.key===it)if(ae.tag===4&&ae.stateNode.containerInfo===fe.containerInfo&&ae.stateNode.implementation===fe.implementation){c(ce,ae.sibling),Te=k(ae,fe.children||[]),Te.return=ce,ce=Te;break e}else{c(ce,ae);break}else i(ce,ae);ae=ae.sibling}Te=hm(fe,ce.mode,Te),Te.return=ce,ce=Te}return B(ce);case L:return fe=zo(fe),Ut(ce,ae,fe,Te)}if(K(fe))return $e(ce,ae,fe,Te);if($(fe)){if(it=$(fe),typeof it!="function")throw Error(s(150));return fe=it.call(fe),ut(ce,ae,fe,Te)}if(typeof fe.then=="function")return Ut(ce,ae,Hd(fe),Te);if(fe.$$typeof===y)return Ut(ce,ae,Id(ce,fe),Te);Fd(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,ae!==null&&ae.tag===6?(c(ce,ae.sibling),Te=k(ae,fe),Te.return=ce,ce=Te):(c(ce,ae),Te=fm(fe,ce.mode,Te),Te.return=ce,ce=Te),B(ce)):c(ce,ae)}return function(ce,ae,fe,Te){try{zc=0;var it=Ut(ce,ae,fe,Te);return ol=null,it}catch(Ze){if(Ze===il||Ze===Bd)throw Ze;var Mt=Lr(29,Ze,null,ce.mode);return Mt.lanes=Te,Mt.return=ce,Mt}}}var Fo=yb(!0),bb=yb(!1),Ni=!1;function Em(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rm(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Bi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function zi(r,i,c){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(jt&2)!==0){var k=m.pending;return k===null?i.next=i:(i.next=k.next,k.next=i),m.pending=i,i=Md(r),rb(r,null,c),i}return Od(r,m,i,c),Md(r)}function Fc(r,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var m=i.lanes;m&=r.pendingLanes,c|=m,i.lanes=c,Ht(r,c)}}function km(r,i){var c=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var k=null,O=null;if(c=c.firstBaseUpdate,c!==null){do{var B={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};O===null?k=O=B:O=O.next=B,c=c.next}while(c!==null);O===null?k=O=i:O=O.next=i}else k=O=i;c={baseState:m.baseState,firstBaseUpdate:k,lastBaseUpdate:O,shared:m.shared,callbacks:m.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=i:r.next=i,c.lastBaseUpdate=i}var Tm=!1;function Vc(){if(Tm){var r=sl;if(r!==null)throw r}}function Uc(r,i,c,m){Tm=!1;var k=r.updateQueue;Ni=!1;var O=k.firstBaseUpdate,B=k.lastBaseUpdate,Z=k.shared.pending;if(Z!==null){k.shared.pending=null;var ie=Z,he=ie.next;ie.next=null,B===null?O=he:B.next=he,B=ie;var Ce=r.alternate;Ce!==null&&(Ce=Ce.updateQueue,Z=Ce.lastBaseUpdate,Z!==B&&(Z===null?Ce.firstBaseUpdate=he:Z.next=he,Ce.lastBaseUpdate=ie))}if(O!==null){var Le=k.baseState;B=0,Ce=he=ie=null,Z=O;do{var me=Z.lane&-536870913,ye=me!==Z.lane;if(ye?(Tt&me)===me:(m&me)===me){me!==0&&me===rl&&(Tm=!0),Ce!==null&&(Ce=Ce.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var $e=r,ut=Z;me=i;var Ut=c;switch(ut.tag){case 1:if($e=ut.payload,typeof $e=="function"){Le=$e.call(Ut,Le,me);break e}Le=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=ut.payload,me=typeof $e=="function"?$e.call(Ut,Le,me):$e,me==null)break e;Le=f({},Le,me);break e;case 2:Ni=!0}}me=Z.callback,me!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=k.callbacks,ye===null?k.callbacks=[me]:ye.push(me))}else ye={lane:me,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ce===null?(he=Ce=ye,ie=Le):Ce=Ce.next=ye,B|=me;if(Z=Z.next,Z===null){if(Z=k.shared.pending,Z===null)break;ye=Z,Z=ye.next,ye.next=null,k.lastBaseUpdate=ye,k.shared.pending=null}}while(!0);Ce===null&&(ie=Le),k.baseState=ie,k.firstBaseUpdate=he,k.lastBaseUpdate=Ce,O===null&&(k.shared.lanes=0),Wi|=B,r.lanes=B,r.memoizedState=Le}}function xb(r,i){if(typeof r!="function")throw Error(s(191,r));r.call(i)}function Sb(r,i){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)xb(c[r],i)}var al=P(null),Vd=P(0);function Cb(r,i){r=mi,F(Vd,r),F(al,i),mi=r|i.baseLanes}function Lm(){F(Vd,mi),F(al,al.current)}function Am(){mi=Vd.current,I(al),I(Vd)}var Ar=P(null),Yr=null;function Hi(r){var i=r.alternate;F(cn,cn.current&1),F(Ar,r),Yr===null&&(i===null||al.current!==null||i.memoizedState!==null)&&(Yr=r)}function Om(r){F(cn,cn.current),F(Ar,r),Yr===null&&(Yr=r)}function wb(r){r.tag===22?(F(cn,cn.current),F(Ar,r),Yr===null&&(Yr=r)):Fi()}function Fi(){F(cn,cn.current),F(Ar,Ar.current)}function Or(r){I(Ar),Yr===r&&(Yr=null),I(cn)}var cn=P(0);function Ud(r){for(var i=r;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ng(c)||Bg(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ai=0,gt=null,Ft=null,yn=null,Wd=!1,ll=!1,Vo=!1,qd=0,Wc=0,cl=null,vL=0;function an(){throw Error(s(321))}function Mm(r,i){if(i===null)return!1;for(var c=0;c<i.length&&c<r.length;c++)if(!Tr(r[c],i[c]))return!1;return!0}function Dm(r,i,c,m,k,O){return ai=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?a1:Km,Vo=!1,O=c(m,k),Vo=!1,ll&&(O=Rb(i,c,m,k)),Eb(r),O}function Eb(r){V.H=$c;var i=Ft!==null&&Ft.next!==null;if(ai=0,yn=Ft=gt=null,Wd=!1,Wc=0,cl=null,i)throw Error(s(300));r===null||bn||(r=r.dependencies,r!==null&&jd(r)&&(bn=!0))}function Rb(r,i,c,m){gt=r;var k=0;do{if(ll&&(cl=null),Wc=0,ll=!1,25<=k)throw Error(s(301));if(k+=1,yn=Ft=null,r.updateQueue!=null){var O=r.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}V.H=l1,O=i(c,m)}while(ll);return O}function _L(){var r=V.H,i=r.useState()[0];return i=typeof i.then=="function"?qc(i):i,r=r.useState()[0],(Ft!==null?Ft.memoizedState:null)!==r&&(gt.flags|=1024),i}function Pm(){var r=qd!==0;return qd=0,r}function jm(r,i,c){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~c}function Im(r){if(Wd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Wd=!1}ai=0,yn=Ft=gt=null,ll=!1,Wc=qd=0,cl=null}function rr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?gt.memoizedState=yn=r:yn=yn.next=r,yn}function un(){if(Ft===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=Ft.next;var i=yn===null?gt.memoizedState:yn.next;if(i!==null)yn=i,Ft=r;else{if(r===null)throw gt.alternate===null?Error(s(467)):Error(s(310));Ft=r,r={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},yn===null?gt.memoizedState=yn=r:yn=yn.next=r}return yn}function Gd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qc(r){var i=Wc;return Wc+=1,cl===null&&(cl=[]),r=gb(cl,r,i),i=gt,(yn===null?i.memoizedState:yn.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?a1:Km),r}function $d(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return qc(r);if(r.$$typeof===y)return Fn(r)}throw Error(s(438,String(r)))}function Nm(r){var i=null,c=gt.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var m=gt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(k){return k.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=Gd(),gt.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(r),m=0;m<r;m++)c[m]=z;return i.index++,c}function li(r,i){return typeof i=="function"?i(r):i}function Kd(r){var i=un();return Bm(i,Ft,r)}function Bm(r,i,c){var m=r.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var k=r.baseQueue,O=m.pending;if(O!==null){if(k!==null){var B=k.next;k.next=O.next,O.next=B}i.baseQueue=k=O,m.pending=null}if(O=r.baseState,k===null)r.memoizedState=O;else{i=k.next;var Z=B=null,ie=null,he=i,Ce=!1;do{var Le=he.lane&-536870913;if(Le!==he.lane?(Tt&Le)===Le:(ai&Le)===Le){var me=he.revertLane;if(me===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Le===rl&&(Ce=!0);else if((ai&me)===me){he=he.next,me===rl&&(Ce=!0);continue}else Le={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ie===null?(Z=ie=Le,B=O):ie=ie.next=Le,gt.lanes|=me,Wi|=me;Le=he.action,Vo&&c(O,Le),O=he.hasEagerState?he.eagerState:c(O,Le)}else me={lane:Le,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},ie===null?(Z=ie=me,B=O):ie=ie.next=me,gt.lanes|=Le,Wi|=Le;he=he.next}while(he!==null&&he!==i);if(ie===null?B=O:ie.next=Z,!Tr(O,r.memoizedState)&&(bn=!0,Ce&&(c=sl,c!==null)))throw c;r.memoizedState=O,r.baseState=B,r.baseQueue=ie,m.lastRenderedState=O}return k===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function zm(r){var i=un(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var m=c.dispatch,k=c.pending,O=i.memoizedState;if(k!==null){c.pending=null;var B=k=k.next;do O=r(O,B.action),B=B.next;while(B!==k);Tr(O,i.memoizedState)||(bn=!0),i.memoizedState=O,i.baseQueue===null&&(i.baseState=O),c.lastRenderedState=O}return[O,m]}function kb(r,i,c){var m=gt,k=un(),O=At;if(O){if(c===void 0)throw Error(s(407));c=c()}else c=i();var B=!Tr((Ft||k).memoizedState,c);if(B&&(k.memoizedState=c,bn=!0),k=k.queue,Vm(Ab.bind(null,m,k,r),[r]),k.getSnapshot!==i||B||yn!==null&&yn.memoizedState.tag&1){if(m.flags|=2048,ul(9,{destroy:void 0},Lb.bind(null,m,k,c,i),null),qt===null)throw Error(s(349));O||(ai&127)!==0||Tb(m,i,c)}return c}function Tb(r,i,c){r.flags|=16384,r={getSnapshot:i,value:c},i=gt.updateQueue,i===null?(i=Gd(),gt.updateQueue=i,i.stores=[r]):(c=i.stores,c===null?i.stores=[r]:c.push(r))}function Lb(r,i,c,m){i.value=c,i.getSnapshot=m,Ob(i)&&Mb(r)}function Ab(r,i,c){return c(function(){Ob(i)&&Mb(r)})}function Ob(r){var i=r.getSnapshot;r=r.value;try{var c=i();return!Tr(r,c)}catch{return!0}}function Mb(r){var i=Do(r,2);i!==null&&mr(i,r,2)}function Hm(r){var i=rr();if(typeof r=="function"){var c=r;if(r=c(),Vo){nt(!0);try{c()}finally{nt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:r},i}function Db(r,i,c,m){return r.baseState=c,Bm(r,Ft,typeof m=="function"?m:li)}function yL(r,i,c,m,k){if(Qd(r))throw Error(s(485));if(r=i.action,r!==null){var O={payload:k,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){O.listeners.push(B)}};V.T!==null?c(!0):O.isTransition=!1,m(O),c=i.pending,c===null?(O.next=i.pending=O,Pb(i,O)):(O.next=c.next,i.pending=c.next=O)}}function Pb(r,i){var c=i.action,m=i.payload,k=r.state;if(i.isTransition){var O=V.T,B={};V.T=B;try{var Z=c(k,m),ie=V.S;ie!==null&&ie(B,Z),jb(r,i,Z)}catch(he){Fm(r,i,he)}finally{O!==null&&B.types!==null&&(O.types=B.types),V.T=O}}else try{O=c(k,m),jb(r,i,O)}catch(he){Fm(r,i,he)}}function jb(r,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){Ib(r,i,m)},function(m){return Fm(r,i,m)}):Ib(r,i,c)}function Ib(r,i,c){i.status="fulfilled",i.value=c,Nb(i),r.state=c,i=r.pending,i!==null&&(c=i.next,c===i?r.pending=null:(c=c.next,i.next=c,Pb(r,c)))}function Fm(r,i,c){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=c,Nb(i),i=i.next;while(i!==m)}r.action=null}function Nb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Bb(r,i){return i}function zb(r,i){if(At){var c=qt.formState;if(c!==null){e:{var m=gt;if(At){if(Yt){t:{for(var k=Yt,O=Kr;k.nodeType!==8;){if(!O){k=null;break t}if(k=Xr(k.nextSibling),k===null){k=null;break t}}O=k.data,k=O==="F!"||O==="F"?k:null}if(k){Yt=Xr(k.nextSibling),m=k.data==="F!";break e}}ji(m)}m=!1}m&&(i=c[0])}}return c=rr(),c.memoizedState=c.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bb,lastRenderedState:i},c.queue=m,c=s1.bind(null,gt,m),m.dispatch=c,m=Hm(!1),O=$m.bind(null,gt,!1,m.queue),m=rr(),k={state:i,dispatch:null,action:r,pending:null},m.queue=k,c=yL.bind(null,gt,k,O,c),k.dispatch=c,m.memoizedState=r,[i,c,!1]}function Hb(r){var i=un();return Fb(i,Ft,r)}function Fb(r,i,c){if(i=Bm(r,i,Bb)[0],r=Kd(li)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=qc(i)}catch(B){throw B===il?Bd:B}else m=i;i=un();var k=i.queue,O=k.dispatch;return c!==i.memoizedState&&(gt.flags|=2048,ul(9,{destroy:void 0},bL.bind(null,k,c),null)),[m,O,r]}function bL(r,i){r.action=i}function Vb(r){var i=un(),c=Ft;if(c!==null)return Fb(i,c,r);un(),i=i.memoizedState,c=un();var m=c.queue.dispatch;return c.memoizedState=r,[i,m,!1]}function ul(r,i,c,m){return r={tag:r,create:c,deps:m,inst:i,next:null},i=gt.updateQueue,i===null&&(i=Gd(),gt.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=r.next=r:(m=c.next,c.next=r,r.next=m,i.lastEffect=r),r}function Ub(){return un().memoizedState}function Yd(r,i,c,m){var k=rr();gt.flags|=r,k.memoizedState=ul(1|i,{destroy:void 0},c,m===void 0?null:m)}function Xd(r,i,c,m){var k=un();m=m===void 0?null:m;var O=k.memoizedState.inst;Ft!==null&&m!==null&&Mm(m,Ft.memoizedState.deps)?k.memoizedState=ul(i,O,c,m):(gt.flags|=r,k.memoizedState=ul(1|i,O,c,m))}function Wb(r,i){Yd(8390656,8,r,i)}function Vm(r,i){Xd(2048,8,r,i)}function xL(r){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=Gd(),gt.updateQueue=i,i.events=[r];else{var c=i.events;c===null?i.events=[r]:c.push(r)}}function qb(r){var i=un().memoizedState;return xL({ref:i,nextImpl:r}),function(){if((jt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Gb(r,i){return Xd(4,2,r,i)}function $b(r,i){return Xd(4,4,r,i)}function Kb(r,i){if(typeof i=="function"){r=r();var c=i(r);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Yb(r,i,c){c=c!=null?c.concat([r]):null,Xd(4,4,Kb.bind(null,i,r),c)}function Um(){}function Xb(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&Mm(i,m[1])?m[0]:(c.memoizedState=[r,i],r)}function Qb(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;if(i!==null&&Mm(i,m[1]))return m[0];if(m=r(),Vo){nt(!0);try{r()}finally{nt(!1)}}return c.memoizedState=[m,i],m}function Wm(r,i,c){return c===void 0||(ai&1073741824)!==0&&(Tt&261930)===0?r.memoizedState=i:(r.memoizedState=c,r=Z1(),gt.lanes|=r,Wi|=r,c)}function Zb(r,i,c,m){return Tr(c,i)?c:al.current!==null?(r=Wm(r,c,m),Tr(r,i)||(bn=!0),r):(ai&42)===0||(ai&1073741824)!==0&&(Tt&261930)===0?(bn=!0,r.memoizedState=c):(r=Z1(),gt.lanes|=r,Wi|=r,i)}function Jb(r,i,c,m,k){var O=Y.p;Y.p=O!==0&&8>O?O:8;var B=V.T,Z={};V.T=Z,$m(r,!1,i,c);try{var ie=k(),he=V.S;if(he!==null&&he(Z,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ce=gL(ie,m);Gc(r,i,Ce,Pr(r))}else Gc(r,i,m,Pr(r))}catch(Le){Gc(r,i,{then:function(){},status:"rejected",reason:Le},Pr())}finally{Y.p=O,B!==null&&Z.types!==null&&(B.types=Z.types),V.T=B}}function SL(){}function qm(r,i,c,m){if(r.tag!==5)throw Error(s(476));var k=e1(r).queue;Jb(r,k,i,G,c===null?SL:function(){return t1(r),c(m)})}function e1(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:G},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:li,lastRenderedState:c},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function t1(r){var i=e1(r);i.next===null&&(i=r.alternate.memoizedState),Gc(r,i.next.queue,{},Pr())}function Gm(){return Fn(cu)}function n1(){return un().memoizedState}function r1(){return un().memoizedState}function CL(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var c=Pr();r=Bi(c);var m=zi(i,r,c);m!==null&&(mr(m,i,c),Fc(m,i,c)),i={cache:xm()},r.payload=i;return}i=i.return}}function wL(r,i,c){var m=Pr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Qd(r)?i1(i,c):(c=um(r,i,c,m),c!==null&&(mr(c,r,m),o1(c,i,m)))}function s1(r,i,c){var m=Pr();Gc(r,i,c,m)}function Gc(r,i,c,m){var k={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Qd(r))i1(i,k);else{var O=r.alternate;if(r.lanes===0&&(O===null||O.lanes===0)&&(O=i.lastRenderedReducer,O!==null))try{var B=i.lastRenderedState,Z=O(B,c);if(k.hasEagerState=!0,k.eagerState=Z,Tr(Z,B))return Od(r,i,k,0),qt===null&&Ad(),!1}catch{}if(c=um(r,i,k,m),c!==null)return mr(c,r,m),o1(c,i,m),!0}return!1}function $m(r,i,c,m){if(m={lane:2,revertLane:Eg(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Qd(r)){if(i)throw Error(s(479))}else i=um(r,c,m,2),i!==null&&mr(i,r,2)}function Qd(r){var i=r.alternate;return r===gt||i!==null&&i===gt}function i1(r,i){ll=Wd=!0;var c=r.pending;c===null?i.next=i:(i.next=c.next,c.next=i),r.pending=i}function o1(r,i,c){if((c&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,c|=m,i.lanes=c,Ht(r,c)}}var $c={readContext:Fn,use:$d,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useLayoutEffect:an,useInsertionEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useSyncExternalStore:an,useId:an,useHostTransitionStatus:an,useFormState:an,useActionState:an,useOptimistic:an,useMemoCache:an,useCacheRefresh:an};$c.useEffectEvent=an;var a1={readContext:Fn,use:$d,useCallback:function(r,i){return rr().memoizedState=[r,i===void 0?null:i],r},useContext:Fn,useEffect:Wb,useImperativeHandle:function(r,i,c){c=c!=null?c.concat([r]):null,Yd(4194308,4,Kb.bind(null,i,r),c)},useLayoutEffect:function(r,i){return Yd(4194308,4,r,i)},useInsertionEffect:function(r,i){Yd(4,2,r,i)},useMemo:function(r,i){var c=rr();i=i===void 0?null:i;var m=r();if(Vo){nt(!0);try{r()}finally{nt(!1)}}return c.memoizedState=[m,i],m},useReducer:function(r,i,c){var m=rr();if(c!==void 0){var k=c(i);if(Vo){nt(!0);try{c(i)}finally{nt(!1)}}}else k=i;return m.memoizedState=m.baseState=k,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:k},m.queue=r,r=r.dispatch=wL.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=Hm(r);var i=r.queue,c=s1.bind(null,gt,i);return i.dispatch=c,[r.memoizedState,c]},useDebugValue:Um,useDeferredValue:function(r,i){var c=rr();return Wm(c,r,i)},useTransition:function(){var r=Hm(!1);return r=Jb.bind(null,gt,r.queue,!0,!1),rr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,c){var m=gt,k=rr();if(At){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),qt===null)throw Error(s(349));(Tt&127)!==0||Tb(m,i,c)}k.memoizedState=c;var O={value:c,getSnapshot:i};return k.queue=O,Wb(Ab.bind(null,m,O,r),[r]),m.flags|=2048,ul(9,{destroy:void 0},Lb.bind(null,m,O,c,i),null),c},useId:function(){var r=rr(),i=qt.identifierPrefix;if(At){var c=Ls,m=Ts;c=(m&~(1<<32-lt(m)-1)).toString(32)+c,i="_"+i+"R_"+c,c=qd++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=vL++,i="_"+i+"r_"+c.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Gm,useFormState:zb,useActionState:zb,useOptimistic:function(r){var i=rr();i.memoizedState=i.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=$m.bind(null,gt,!0,c),c.dispatch=i,[r,i]},useMemoCache:Nm,useCacheRefresh:function(){return rr().memoizedState=CL.bind(null,gt)},useEffectEvent:function(r){var i=rr(),c={impl:r};return i.memoizedState=c,function(){if((jt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Km={readContext:Fn,use:$d,useCallback:Xb,useContext:Fn,useEffect:Vm,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:$b,useMemo:Qb,useReducer:Kd,useRef:Ub,useState:function(){return Kd(li)},useDebugValue:Um,useDeferredValue:function(r,i){var c=un();return Zb(c,Ft.memoizedState,r,i)},useTransition:function(){var r=Kd(li)[0],i=un().memoizedState;return[typeof r=="boolean"?r:qc(r),i]},useSyncExternalStore:kb,useId:n1,useHostTransitionStatus:Gm,useFormState:Hb,useActionState:Hb,useOptimistic:function(r,i){var c=un();return Db(c,Ft,r,i)},useMemoCache:Nm,useCacheRefresh:r1};Km.useEffectEvent=qb;var l1={readContext:Fn,use:$d,useCallback:Xb,useContext:Fn,useEffect:Vm,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:$b,useMemo:Qb,useReducer:zm,useRef:Ub,useState:function(){return zm(li)},useDebugValue:Um,useDeferredValue:function(r,i){var c=un();return Ft===null?Wm(c,r,i):Zb(c,Ft.memoizedState,r,i)},useTransition:function(){var r=zm(li)[0],i=un().memoizedState;return[typeof r=="boolean"?r:qc(r),i]},useSyncExternalStore:kb,useId:n1,useHostTransitionStatus:Gm,useFormState:Vb,useActionState:Vb,useOptimistic:function(r,i){var c=un();return Ft!==null?Db(c,Ft,r,i):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Nm,useCacheRefresh:r1};l1.useEffectEvent=qb;function Ym(r,i,c,m){i=r.memoizedState,c=c(m,i),c=c==null?i:f({},i,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Xm={enqueueSetState:function(r,i,c){r=r._reactInternals;var m=Pr(),k=Bi(m);k.payload=i,c!=null&&(k.callback=c),i=zi(r,k,m),i!==null&&(mr(i,r,m),Fc(i,r,m))},enqueueReplaceState:function(r,i,c){r=r._reactInternals;var m=Pr(),k=Bi(m);k.tag=1,k.payload=i,c!=null&&(k.callback=c),i=zi(r,k,m),i!==null&&(mr(i,r,m),Fc(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var c=Pr(),m=Bi(c);m.tag=2,i!=null&&(m.callback=i),i=zi(r,m,c),i!==null&&(mr(i,r,c),Fc(i,r,c))}};function c1(r,i,c,m,k,O,B){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,B):i.prototype&&i.prototype.isPureReactComponent?!Dc(c,m)||!Dc(k,O):!0}function u1(r,i,c,m){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,m),i.state!==r&&Xm.enqueueReplaceState(i,i.state,null)}function Uo(r,i){var c=i;if("ref"in i){c={};for(var m in i)m!=="ref"&&(c[m]=i[m])}if(r=r.defaultProps){c===i&&(c=f({},c));for(var k in r)c[k]===void 0&&(c[k]=r[k])}return c}function d1(r){Ld(r)}function f1(r){console.error(r)}function h1(r){Ld(r)}function Zd(r,i){try{var c=r.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function p1(r,i,c){try{var m=r.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Qm(r,i,c){return c=Bi(c),c.tag=3,c.payload={element:null},c.callback=function(){Zd(r,i)},c}function m1(r){return r=Bi(r),r.tag=3,r}function g1(r,i,c,m){var k=c.type.getDerivedStateFromError;if(typeof k=="function"){var O=m.value;r.payload=function(){return k(O)},r.callback=function(){p1(i,c,m)}}var B=c.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(r.callback=function(){p1(i,c,m),typeof k!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var Z=m.stack;this.componentDidCatch(m.value,{componentStack:Z!==null?Z:""})})}function EL(r,i,c,m,k){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=c.alternate,i!==null&&nl(i,c,k,!0),c=Ar.current,c!==null){switch(c.tag){case 31:case 13:return Yr===null?df():c.alternate===null&&ln===0&&(ln=3),c.flags&=-257,c.flags|=65536,c.lanes=k,m===zd?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([m]):i.add(m),Sg(r,m,k)),!1;case 22:return c.flags|=65536,m===zd?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([m]):c.add(m)),Sg(r,m,k)),!1}throw Error(s(435,c.tag))}return Sg(r,m,k),df(),!1}if(At)return i=Ar.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=k,m!==gm&&(r=Error(s(422),{cause:m}),Ic(qr(r,c)))):(m!==gm&&(i=Error(s(423),{cause:m}),Ic(qr(i,c))),r=r.current.alternate,r.flags|=65536,k&=-k,r.lanes|=k,m=qr(m,c),k=Qm(r.stateNode,m,k),km(r,k),ln!==4&&(ln=2)),!1;var O=Error(s(520),{cause:m});if(O=qr(O,c),tu===null?tu=[O]:tu.push(O),ln!==4&&(ln=2),i===null)return!0;m=qr(m,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,r=k&-k,c.lanes|=r,r=Qm(c.stateNode,m,r),km(c,r),!1;case 1:if(i=c.type,O=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(qi===null||!qi.has(O))))return c.flags|=65536,k&=-k,c.lanes|=k,k=m1(k),g1(k,r,c,m),km(c,k),!1}c=c.return}while(c!==null);return!1}var Zm=Error(s(461)),bn=!1;function Vn(r,i,c,m){i.child=r===null?bb(i,null,c,m):Fo(i,r.child,c,m)}function v1(r,i,c,m,k){c=c.render;var O=i.ref;if("ref"in m){var B={};for(var Z in m)Z!=="ref"&&(B[Z]=m[Z])}else B=m;return No(i),m=Dm(r,i,c,B,O,k),Z=Pm(),r!==null&&!bn?(jm(r,i,k),ci(r,i,k)):(At&&Z&&pm(i),i.flags|=1,Vn(r,i,m,k),i.child)}function _1(r,i,c,m,k){if(r===null){var O=c.type;return typeof O=="function"&&!dm(O)&&O.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=O,y1(r,i,O,m,k)):(r=Dd(c.type,null,m,i,i.mode,k),r.ref=i.ref,r.return=i,i.child=r)}if(O=r.child,!og(r,k)){var B=O.memoizedProps;if(c=c.compare,c=c!==null?c:Dc,c(B,m)&&r.ref===i.ref)return ci(r,i,k)}return i.flags|=1,r=ri(O,m),r.ref=i.ref,r.return=i,i.child=r}function y1(r,i,c,m,k){if(r!==null){var O=r.memoizedProps;if(Dc(O,m)&&r.ref===i.ref)if(bn=!1,i.pendingProps=m=O,og(r,k))(r.flags&131072)!==0&&(bn=!0);else return i.lanes=r.lanes,ci(r,i,k)}return Jm(r,i,c,m,k)}function b1(r,i,c,m){var k=m.children,O=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(O=O!==null?O.baseLanes|c:c,r!==null){for(m=i.child=r.child,k=0;m!==null;)k=k|m.lanes|m.childLanes,m=m.sibling;m=k&~O}else m=0,i.child=null;return x1(r,i,O,c,m)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Nd(i,O!==null?O.cachePool:null),O!==null?Cb(i,O):Lm(),wb(i);else return m=i.lanes=536870912,x1(r,i,O!==null?O.baseLanes|c:c,c,m)}else O!==null?(Nd(i,O.cachePool),Cb(i,O),Fi(),i.memoizedState=null):(r!==null&&Nd(i,null),Lm(),Fi());return Vn(r,i,k,c),i.child}function Kc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function x1(r,i,c,m,k){var O=Cm();return O=O===null?null:{parent:_n._currentValue,pool:O},i.memoizedState={baseLanes:c,cachePool:O},r!==null&&Nd(i,null),Lm(),wb(i),r!==null&&nl(r,i,m,!0),i.childLanes=k,null}function Jd(r,i){return i=tf({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function S1(r,i,c){return Fo(i,r.child,null,c),r=Jd(i,i.pendingProps),r.flags|=2,Or(i),i.memoizedState=null,r}function RL(r,i,c){var m=i.pendingProps,k=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(m.mode==="hidden")return r=Jd(i,m),i.lanes=536870912,Kc(null,r);if(Om(i),(r=Yt)?(r=Px(r,Kr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Di!==null?{id:Ts,overflow:Ls}:null,retryLane:536870912,hydrationErrors:null},c=ib(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw ji(i);return i.lanes=536870912,null}return Jd(i,m)}var O=r.memoizedState;if(O!==null){var B=O.dehydrated;if(Om(i),k)if(i.flags&256)i.flags&=-257,i=S1(r,i,c);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(s(558));else if(bn||nl(r,i,c,!1),k=(c&r.childLanes)!==0,bn||k){if(m=qt,m!==null&&(B=kn(m,c),B!==0&&B!==O.retryLane))throw O.retryLane=B,Do(r,B),mr(m,r,B),Zm;df(),i=S1(r,i,c)}else r=O.treeContext,Yt=Xr(B.nextSibling),Hn=i,At=!0,Pi=null,Kr=!1,r!==null&&lb(i,r),i=Jd(i,m),i.flags|=4096;return i}return r=ri(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function ef(r,i){var c=i.ref;if(c===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(i.flags|=4194816)}}function Jm(r,i,c,m,k){return No(i),c=Dm(r,i,c,m,void 0,k),m=Pm(),r!==null&&!bn?(jm(r,i,k),ci(r,i,k)):(At&&m&&pm(i),i.flags|=1,Vn(r,i,c,k),i.child)}function C1(r,i,c,m,k,O){return No(i),i.updateQueue=null,c=Rb(i,m,c,k),Eb(r),m=Pm(),r!==null&&!bn?(jm(r,i,O),ci(r,i,O)):(At&&m&&pm(i),i.flags|=1,Vn(r,i,c,O),i.child)}function w1(r,i,c,m,k){if(No(i),i.stateNode===null){var O=Za,B=c.contextType;typeof B=="object"&&B!==null&&(O=Fn(B)),O=new c(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Xm,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},Em(i),B=c.contextType,O.context=typeof B=="object"&&B!==null?Fn(B):Za,O.state=i.memoizedState,B=c.getDerivedStateFromProps,typeof B=="function"&&(Ym(i,c,B,m),O.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(B=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),B!==O.state&&Xm.enqueueReplaceState(O,O.state,null),Uc(i,m,O,k),Vc(),O.state=i.memoizedState),typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(r===null){O=i.stateNode;var Z=i.memoizedProps,ie=Uo(c,Z);O.props=ie;var he=O.context,Ce=c.contextType;B=Za,typeof Ce=="object"&&Ce!==null&&(B=Fn(Ce));var Le=c.getDerivedStateFromProps;Ce=typeof Le=="function"||typeof O.getSnapshotBeforeUpdate=="function",Z=i.pendingProps!==Z,Ce||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Z||he!==B)&&u1(i,O,m,B),Ni=!1;var me=i.memoizedState;O.state=me,Uc(i,m,O,k),Vc(),he=i.memoizedState,Z||me!==he||Ni?(typeof Le=="function"&&(Ym(i,c,Le,m),he=i.memoizedState),(ie=Ni||c1(i,c,ie,m,me,he,B))?(Ce||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(i.flags|=4194308)):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=he),O.props=m,O.state=he,O.context=B,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,Rm(r,i),B=i.memoizedProps,Ce=Uo(c,B),O.props=Ce,Le=i.pendingProps,me=O.context,he=c.contextType,ie=Za,typeof he=="object"&&he!==null&&(ie=Fn(he)),Z=c.getDerivedStateFromProps,(he=typeof Z=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(B!==Le||me!==ie)&&u1(i,O,m,ie),Ni=!1,me=i.memoizedState,O.state=me,Uc(i,m,O,k),Vc();var ye=i.memoizedState;B!==Le||me!==ye||Ni||r!==null&&r.dependencies!==null&&jd(r.dependencies)?(typeof Z=="function"&&(Ym(i,c,Z,m),ye=i.memoizedState),(Ce=Ni||c1(i,c,Ce,m,me,ye,ie)||r!==null&&r.dependencies!==null&&jd(r.dependencies))?(he||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(m,ye,ie),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(m,ye,ie)),typeof O.componentDidUpdate=="function"&&(i.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof O.componentDidUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=ye),O.props=m,O.state=ye,O.context=ie,m=Ce):(typeof O.componentDidUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||B===r.memoizedProps&&me===r.memoizedState||(i.flags|=1024),m=!1)}return O=m,ef(r,i),m=(i.flags&128)!==0,O||m?(O=i.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:O.render(),i.flags|=1,r!==null&&m?(i.child=Fo(i,r.child,null,k),i.child=Fo(i,null,c,k)):Vn(r,i,c,k),i.memoizedState=O.state,r=i.child):r=ci(r,i,k),r}function E1(r,i,c,m){return jo(),i.flags|=256,Vn(r,i,c,m),i.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(r){return{baseLanes:r,cachePool:pb()}}function ng(r,i,c){return r=r!==null?r.childLanes&~c:0,i&&(r|=Dr),r}function R1(r,i,c){var m=i.pendingProps,k=!1,O=(i.flags&128)!==0,B;if((B=O)||(B=r!==null&&r.memoizedState===null?!1:(cn.current&2)!==0),B&&(k=!0,i.flags&=-129),B=(i.flags&32)!==0,i.flags&=-33,r===null){if(At){if(k?Hi(i):Fi(),(r=Yt)?(r=Px(r,Kr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Di!==null?{id:Ts,overflow:Ls}:null,retryLane:536870912,hydrationErrors:null},c=ib(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw ji(i);return Bg(r)?i.lanes=32:i.lanes=536870912,null}var Z=m.children;return m=m.fallback,k?(Fi(),k=i.mode,Z=tf({mode:"hidden",children:Z},k),m=Po(m,k,c,null),Z.return=i,m.return=i,Z.sibling=m,i.child=Z,m=i.child,m.memoizedState=tg(c),m.childLanes=ng(r,B,c),i.memoizedState=eg,Kc(null,m)):(Hi(i),rg(i,Z))}var ie=r.memoizedState;if(ie!==null&&(Z=ie.dehydrated,Z!==null)){if(O)i.flags&256?(Hi(i),i.flags&=-257,i=sg(r,i,c)):i.memoizedState!==null?(Fi(),i.child=r.child,i.flags|=128,i=null):(Fi(),Z=m.fallback,k=i.mode,m=tf({mode:"visible",children:m.children},k),Z=Po(Z,k,c,null),Z.flags|=2,m.return=i,Z.return=i,m.sibling=Z,i.child=m,Fo(i,r.child,null,c),m=i.child,m.memoizedState=tg(c),m.childLanes=ng(r,B,c),i.memoizedState=eg,i=Kc(null,m));else if(Hi(i),Bg(Z)){if(B=Z.nextSibling&&Z.nextSibling.dataset,B)var he=B.dgst;B=he,m=Error(s(419)),m.stack="",m.digest=B,Ic({value:m,source:null,stack:null}),i=sg(r,i,c)}else if(bn||nl(r,i,c,!1),B=(c&r.childLanes)!==0,bn||B){if(B=qt,B!==null&&(m=kn(B,c),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Do(r,m),mr(B,r,m),Zm;Ng(Z)||df(),i=sg(r,i,c)}else Ng(Z)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,Yt=Xr(Z.nextSibling),Hn=i,At=!0,Pi=null,Kr=!1,r!==null&&lb(i,r),i=rg(i,m.children),i.flags|=4096);return i}return k?(Fi(),Z=m.fallback,k=i.mode,ie=r.child,he=ie.sibling,m=ri(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,he!==null?Z=ri(he,Z):(Z=Po(Z,k,c,null),Z.flags|=2),Z.return=i,m.return=i,m.sibling=Z,i.child=m,Kc(null,m),m=i.child,Z=r.child.memoizedState,Z===null?Z=tg(c):(k=Z.cachePool,k!==null?(ie=_n._currentValue,k=k.parent!==ie?{parent:ie,pool:ie}:k):k=pb(),Z={baseLanes:Z.baseLanes|c,cachePool:k}),m.memoizedState=Z,m.childLanes=ng(r,B,c),i.memoizedState=eg,Kc(r.child,m)):(Hi(i),c=r.child,r=c.sibling,c=ri(c,{mode:"visible",children:m.children}),c.return=i,c.sibling=null,r!==null&&(B=i.deletions,B===null?(i.deletions=[r],i.flags|=16):B.push(r)),i.child=c,i.memoizedState=null,c)}function rg(r,i){return i=tf({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function tf(r,i){return r=Lr(22,r,null,i),r.lanes=0,r}function sg(r,i,c){return Fo(i,r.child,null,c),r=rg(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function k1(r,i,c){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),ym(r.return,i,c)}function ig(r,i,c,m,k,O){var B=r.memoizedState;B===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:k,treeForkCount:O}:(B.isBackwards=i,B.rendering=null,B.renderingStartTime=0,B.last=m,B.tail=c,B.tailMode=k,B.treeForkCount=O)}function T1(r,i,c){var m=i.pendingProps,k=m.revealOrder,O=m.tail;m=m.children;var B=cn.current,Z=(B&2)!==0;if(Z?(B=B&1|2,i.flags|=128):B&=1,F(cn,B),Vn(r,i,m,c),m=At?jc:0,!Z&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&k1(r,c,i);else if(r.tag===19)k1(r,c,i);else if(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;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(k){case"forwards":for(c=i.child,k=null;c!==null;)r=c.alternate,r!==null&&Ud(r)===null&&(k=c),c=c.sibling;c=k,c===null?(k=i.child,i.child=null):(k=c.sibling,c.sibling=null),ig(i,!1,k,c,O,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,k=i.child,i.child=null;k!==null;){if(r=k.alternate,r!==null&&Ud(r)===null){i.child=k;break}r=k.sibling,k.sibling=c,c=k,k=r}ig(i,!0,c,null,O,m);break;case"together":ig(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function ci(r,i,c){if(r!==null&&(i.dependencies=r.dependencies),Wi|=i.lanes,(c&i.childLanes)===0)if(r!==null){if(nl(r,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(s(153));if(i.child!==null){for(r=i.child,c=ri(r,r.pendingProps),i.child=c,c.return=i;r.sibling!==null;)r=r.sibling,c=c.sibling=ri(r,r.pendingProps),c.return=i;c.sibling=null}return i.child}function og(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&jd(r)))}function kL(r,i,c){switch(i.tag){case 3:U(i,i.stateNode.containerInfo),Ii(i,_n,r.memoizedState.cache),jo();break;case 27:case 5:ne(i);break;case 4:U(i,i.stateNode.containerInfo);break;case 10:Ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Om(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(Hi(i),i.flags|=128,null):(c&i.child.childLanes)!==0?R1(r,i,c):(Hi(i),r=ci(r,i,c),r!==null?r.sibling:null);Hi(i);break;case 19:var k=(r.flags&128)!==0;if(m=(c&i.childLanes)!==0,m||(nl(r,i,c,!1),m=(c&i.childLanes)!==0),k){if(m)return T1(r,i,c);i.flags|=128}if(k=i.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),F(cn,cn.current),m)break;return null;case 22:return i.lanes=0,b1(r,i,c,i.pendingProps);case 24:Ii(i,_n,r.memoizedState.cache)}return ci(r,i,c)}function L1(r,i,c){if(r!==null)if(r.memoizedProps!==i.pendingProps)bn=!0;else{if(!og(r,c)&&(i.flags&128)===0)return bn=!1,kL(r,i,c);bn=(r.flags&131072)!==0}else bn=!1,At&&(i.flags&1048576)!==0&&ab(i,jc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=zo(i.elementType),i.type=r,typeof r=="function")dm(r)?(m=Uo(r,m),i.tag=1,i=w1(null,i,r,m,c)):(i.tag=0,i=Jm(null,i,r,m,c));else{if(r!=null){var k=r.$$typeof;if(k===E){i.tag=11,i=v1(null,i,r,m,c);break e}else if(k===M){i.tag=14,i=_1(null,i,r,m,c);break e}}throw i=q(r)||r,Error(s(306,i,""))}}return i;case 0:return Jm(r,i,i.type,i.pendingProps,c);case 1:return m=i.type,k=Uo(m,i.pendingProps),w1(r,i,m,k,c);case 3:e:{if(U(i,i.stateNode.containerInfo),r===null)throw Error(s(387));m=i.pendingProps;var O=i.memoizedState;k=O.element,Rm(r,i),Uc(i,m,null,c);var B=i.memoizedState;if(m=B.cache,Ii(i,_n,m),m!==O.cache&&bm(i,[_n],c,!0),Vc(),m=B.element,O.isDehydrated)if(O={element:m,isDehydrated:!1,cache:B.cache},i.updateQueue.baseState=O,i.memoizedState=O,i.flags&256){i=E1(r,i,m,c);break e}else if(m!==k){k=qr(Error(s(424)),i),Ic(k),i=E1(r,i,m,c);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Yt=Xr(r.firstChild),Hn=i,At=!0,Pi=null,Kr=!0,c=bb(i,null,m,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(jo(),m===k){i=ci(r,i,c);break e}Vn(r,i,m,c)}i=i.child}return i;case 26:return ef(r,i),r===null?(c=Hx(i.type,null,i.pendingProps,null))?i.memoizedState=c:At||(c=i.type,r=i.pendingProps,m=_f(ee.current).createElement(c),m[pn]=i,m[mn]=r,Un(m,c,r),gn(m),i.stateNode=m):i.memoizedState=Hx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ne(i),r===null&&At&&(m=i.stateNode=Nx(i.type,i.pendingProps,ee.current),Hn=i,Kr=!0,k=Yt,Yi(i.type)?(zg=k,Yt=Xr(m.firstChild)):Yt=k),Vn(r,i,i.pendingProps.children,c),ef(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((k=m=Yt)&&(m=rA(m,i.type,i.pendingProps,Kr),m!==null?(i.stateNode=m,Hn=i,Yt=Xr(m.firstChild),Kr=!1,k=!0):k=!1),k||ji(i)),ne(i),k=i.type,O=i.pendingProps,B=r!==null?r.memoizedProps:null,m=O.children,Pg(k,O)?m=null:B!==null&&Pg(k,B)&&(i.flags|=32),i.memoizedState!==null&&(k=Dm(r,i,_L,null,null,c),cu._currentValue=k),ef(r,i),Vn(r,i,m,c),i.child;case 6:return r===null&&At&&((r=c=Yt)&&(c=sA(c,i.pendingProps,Kr),c!==null?(i.stateNode=c,Hn=i,Yt=null,r=!0):r=!1),r||ji(i)),null;case 13:return R1(r,i,c);case 4:return U(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=Fo(i,null,m,c):Vn(r,i,m,c),i.child;case 11:return v1(r,i,i.type,i.pendingProps,c);case 7:return Vn(r,i,i.pendingProps,c),i.child;case 8:return Vn(r,i,i.pendingProps.children,c),i.child;case 12:return Vn(r,i,i.pendingProps.children,c),i.child;case 10:return m=i.pendingProps,Ii(i,i.type,m.value),Vn(r,i,m.children,c),i.child;case 9:return k=i.type._context,m=i.pendingProps.children,No(i),k=Fn(k),m=m(k),i.flags|=1,Vn(r,i,m,c),i.child;case 14:return _1(r,i,i.type,i.pendingProps,c);case 15:return y1(r,i,i.type,i.pendingProps,c);case 19:return T1(r,i,c);case 31:return RL(r,i,c);case 22:return b1(r,i,c,i.pendingProps);case 24:return No(i),m=Fn(_n),r===null?(k=Cm(),k===null&&(k=qt,O=xm(),k.pooledCache=O,O.refCount++,O!==null&&(k.pooledCacheLanes|=c),k=O),i.memoizedState={parent:m,cache:k},Em(i),Ii(i,_n,k)):((r.lanes&c)!==0&&(Rm(r,i),Uc(i,null,null,c),Vc()),k=r.memoizedState,O=i.memoizedState,k.parent!==m?(k={parent:m,cache:m},i.memoizedState=k,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=k),Ii(i,_n,m)):(m=O.cache,Ii(i,_n,m),m!==k.cache&&bm(i,[_n],c,!0))),Vn(r,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function ui(r){r.flags|=4}function ag(r,i,c,m,k){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(k&335544128)===k)if(r.stateNode.complete)r.flags|=8192;else if(nx())r.flags|=8192;else throw Ho=zd,wm}else r.flags&=-16777217}function A1(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!qx(i))if(nx())r.flags|=8192;else throw Ho=zd,wm}function nf(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ot():536870912,r.lanes|=i,pl|=i)}function Yc(r,i){if(!At)switch(r.tailMode){case"hidden":i=r.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function Xt(r){var i=r.alternate!==null&&r.alternate.child===r.child,c=0,m=0;if(i)for(var k=r.child;k!==null;)c|=k.lanes|k.childLanes,m|=k.subtreeFlags&65011712,m|=k.flags&65011712,k.return=r,k=k.sibling;else for(k=r.child;k!==null;)c|=k.lanes|k.childLanes,m|=k.subtreeFlags,m|=k.flags,k.return=r,k=k.sibling;return r.subtreeFlags|=m,r.childLanes=c,i}function TL(r,i,c){var m=i.pendingProps;switch(mm(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(i),null;case 1:return Xt(i),null;case 3:return c=i.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),oi(_n),se(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(tl(i)?ui(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,vm())),Xt(i),null;case 26:var k=i.type,O=i.memoizedState;return r===null?(ui(i),O!==null?(Xt(i),A1(i,O)):(Xt(i),ag(i,k,null,m,c))):O?O!==r.memoizedState?(ui(i),Xt(i),A1(i,O)):(Xt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&ui(i),Xt(i),ag(i,k,r,m,c)),null;case 27:if(re(i),c=ee.current,k=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}r=X.current,tl(i)?cb(i):(r=Nx(k,m,c),i.stateNode=r,ui(i))}return Xt(i),null;case 5:if(re(i),k=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(O=X.current,tl(i))cb(i);else{var B=_f(ee.current);switch(O){case 1:O=B.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:O=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":O=B.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":O=B.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":O=B.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof m.is=="string"?B.createElement("select",{is:m.is}):B.createElement("select"),m.multiple?O.multiple=!0:m.size&&(O.size=m.size);break;default:O=typeof m.is=="string"?B.createElement(k,{is:m.is}):B.createElement(k)}}O[pn]=i,O[mn]=m;e:for(B=i.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===i)break e;for(;B.sibling===null;){if(B.return===null||B.return===i)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}i.stateNode=O;e:switch(Un(O,k,m),k){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ui(i)}}return Xt(i),ag(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,c),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&ui(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(r=ee.current,tl(i)){if(r=i.stateNode,c=i.memoizedProps,m=null,k=Hn,k!==null)switch(k.tag){case 27:case 5:m=k.memoizedProps}r[pn]=i,r=!!(r.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||Rx(r.nodeValue,c)),r||ji(i,!0)}else r=_f(r).createTextNode(m),r[pn]=i,i.stateNode=r}return Xt(i),null;case 31:if(c=i.memoizedState,r===null||r.memoizedState!==null){if(m=tl(i),c!==null){if(r===null){if(!m)throw Error(s(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[pn]=i}else jo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else c=vm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return i.flags&256?(Or(i),i):(Or(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Xt(i),null;case 13:if(m=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(k=tl(i),m!==null&&m.dehydrated!==null){if(r===null){if(!k)throw Error(s(318));if(k=i.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(s(317));k[pn]=i}else jo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),k=!1}else k=vm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=k),k=!0;if(!k)return i.flags&256?(Or(i),i):(Or(i),null)}return Or(i),(i.flags&128)!==0?(i.lanes=c,i):(c=m!==null,r=r!==null&&r.memoizedState!==null,c&&(m=i.child,k=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(k=m.alternate.memoizedState.cachePool.pool),O=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(O=m.memoizedState.cachePool.pool),O!==k&&(m.flags|=2048)),c!==r&&c&&(i.child.flags|=8192),nf(i,i.updateQueue),Xt(i),null);case 4:return se(),r===null&&Lg(i.stateNode.containerInfo),Xt(i),null;case 10:return oi(i.type),Xt(i),null;case 19:if(I(cn),m=i.memoizedState,m===null)return Xt(i),null;if(k=(i.flags&128)!==0,O=m.rendering,O===null)if(k)Yc(m,!1);else{if(ln!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(O=Ud(r),O!==null){for(i.flags|=128,Yc(m,!1),r=O.updateQueue,i.updateQueue=r,nf(i,r),i.subtreeFlags=0,r=c,c=i.child;c!==null;)sb(c,r),c=c.sibling;return F(cn,cn.current&1|2),At&&si(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&ke()>lf&&(i.flags|=128,k=!0,Yc(m,!1),i.lanes=4194304)}else{if(!k)if(r=Ud(O),r!==null){if(i.flags|=128,k=!0,r=r.updateQueue,i.updateQueue=r,nf(i,r),Yc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!O.alternate&&!At)return Xt(i),null}else 2*ke()-m.renderingStartTime>lf&&c!==536870912&&(i.flags|=128,k=!0,Yc(m,!1),i.lanes=4194304);m.isBackwards?(O.sibling=i.child,i.child=O):(r=m.last,r!==null?r.sibling=O:i.child=O,m.last=O)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=ke(),r.sibling=null,c=cn.current,F(cn,k?c&1|2:c&1),At&&si(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Or(i),Am(),m=i.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(c&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),c=i.updateQueue,c!==null&&nf(i,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048),r!==null&&I(Bo),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),oi(_n),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function LL(r,i){switch(mm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return oi(_n),se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return re(i),null;case 31:if(i.memoizedState!==null){if(Or(i),i.alternate===null)throw Error(s(340));jo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Or(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));jo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return I(cn),null;case 4:return se(),null;case 10:return oi(i.type),null;case 22:case 23:return Or(i),Am(),r!==null&&I(Bo),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return oi(_n),null;case 25:return null;default:return null}}function O1(r,i){switch(mm(i),i.tag){case 3:oi(_n),se();break;case 26:case 27:case 5:re(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Or(i);break;case 13:Or(i);break;case 19:I(cn);break;case 10:oi(i.type);break;case 22:case 23:Or(i),Am(),r!==null&&I(Bo);break;case 24:oi(_n)}}function Xc(r,i){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var k=m.next;c=k;do{if((c.tag&r)===r){m=void 0;var O=c.create,B=c.inst;m=O(),B.destroy=m}c=c.next}while(c!==k)}}catch(Z){zt(i,i.return,Z)}}function Vi(r,i,c){try{var m=i.updateQueue,k=m!==null?m.lastEffect:null;if(k!==null){var O=k.next;m=O;do{if((m.tag&r)===r){var B=m.inst,Z=B.destroy;if(Z!==void 0){B.destroy=void 0,k=i;var ie=c,he=Z;try{he()}catch(Ce){zt(k,ie,Ce)}}}m=m.next}while(m!==O)}}catch(Ce){zt(i,i.return,Ce)}}function M1(r){var i=r.updateQueue;if(i!==null){var c=r.stateNode;try{Sb(i,c)}catch(m){zt(r,r.return,m)}}}function D1(r,i,c){c.props=Uo(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(m){zt(r,i,m)}}function Qc(r,i){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof c=="function"?r.refCleanup=c(m):c.current=m}}catch(k){zt(r,i,k)}}function As(r,i){var c=r.ref,m=r.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(k){zt(r,i,k)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(k){zt(r,i,k)}else c.current=null}function P1(r){var i=r.type,c=r.memoizedProps,m=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(k){zt(r,r.return,k)}}function lg(r,i,c){try{var m=r.stateNode;QL(m,r.type,c,i),m[mn]=i}catch(k){zt(r,r.return,k)}}function j1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Yi(r.type)||r.tag===4}function cg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||j1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Yi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function ug(r,i,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(r),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=hs));else if(m!==4&&(m===27&&Yi(r.type)&&(c=r.stateNode,i=null),r=r.child,r!==null))for(ug(r,i,c),r=r.sibling;r!==null;)ug(r,i,c),r=r.sibling}function rf(r,i,c){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?c.insertBefore(r,i):c.appendChild(r);else if(m!==4&&(m===27&&Yi(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(rf(r,i,c),r=r.sibling;r!==null;)rf(r,i,c),r=r.sibling}function I1(r){var i=r.stateNode,c=r.memoizedProps;try{for(var m=r.type,k=i.attributes;k.length;)i.removeAttributeNode(k[0]);Un(i,m,c),i[pn]=r,i[mn]=c}catch(O){zt(r,r.return,O)}}var di=!1,xn=!1,dg=!1,N1=typeof WeakSet=="function"?WeakSet:Set,Nn=null;function AL(r,i){if(r=r.containerInfo,Mg=Ef,r=Yy(r),sm(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var k=m.anchorOffset,O=m.focusNode;m=m.focusOffset;try{c.nodeType,O.nodeType}catch{c=null;break e}var B=0,Z=-1,ie=-1,he=0,Ce=0,Le=r,me=null;t:for(;;){for(var ye;Le!==c||k!==0&&Le.nodeType!==3||(Z=B+k),Le!==O||m!==0&&Le.nodeType!==3||(ie=B+m),Le.nodeType===3&&(B+=Le.nodeValue.length),(ye=Le.firstChild)!==null;)me=Le,Le=ye;for(;;){if(Le===r)break t;if(me===c&&++he===k&&(Z=B),me===O&&++Ce===m&&(ie=B),(ye=Le.nextSibling)!==null)break;Le=me,me=Le.parentNode}Le=ye}c=Z===-1||ie===-1?null:{start:Z,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(Dg={focusedElem:r,selectionRange:c},Ef=!1,Nn=i;Nn!==null;)if(i=Nn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Nn=r;else for(;Nn!==null;){switch(i=Nn,O=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)k=r[c],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&O!==null){r=void 0,c=i,k=O.memoizedProps,O=O.memoizedState,m=c.stateNode;try{var $e=Uo(c.type,k);r=m.getSnapshotBeforeUpdate($e,O),m.__reactInternalSnapshotBeforeUpdate=r}catch(ut){zt(c,c.return,ut)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,c=r.nodeType,c===9)Ig(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ig(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=i.sibling,r!==null){r.return=i.return,Nn=r;break}Nn=i.return}}function B1(r,i,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:hi(r,c),m&4&&Xc(5,c);break;case 1:if(hi(r,c),m&4)if(r=c.stateNode,i===null)try{r.componentDidMount()}catch(B){zt(c,c.return,B)}else{var k=Uo(c.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(k,i,r.__reactInternalSnapshotBeforeUpdate)}catch(B){zt(c,c.return,B)}}m&64&&M1(c),m&512&&Qc(c,c.return);break;case 3:if(hi(r,c),m&64&&(r=c.updateQueue,r!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{Sb(r,i)}catch(B){zt(c,c.return,B)}}break;case 27:i===null&&m&4&&I1(c);case 26:case 5:hi(r,c),i===null&&m&4&&P1(c),m&512&&Qc(c,c.return);break;case 12:hi(r,c);break;case 31:hi(r,c),m&4&&F1(r,c);break;case 13:hi(r,c),m&4&&V1(r,c),m&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=zL.bind(null,c),iA(r,c))));break;case 22:if(m=c.memoizedState!==null||di,!m){i=i!==null&&i.memoizedState!==null||xn,k=di;var O=xn;di=m,(xn=i)&&!O?pi(r,c,(c.subtreeFlags&8772)!==0):hi(r,c),di=k,xn=O}break;case 30:break;default:hi(r,c)}}function z1(r){var i=r.alternate;i!==null&&(r.alternate=null,z1(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&To(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Jt=null,dr=!1;function fi(r,i,c){for(c=c.child;c!==null;)H1(r,i,c),c=c.sibling}function H1(r,i,c){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(He,c)}catch{}switch(c.tag){case 26:xn||As(c,i),fi(r,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:xn||As(c,i);var m=Jt,k=dr;Yi(c.type)&&(Jt=c.stateNode,dr=!1),fi(r,i,c),ou(c.stateNode),Jt=m,dr=k;break;case 5:xn||As(c,i);case 6:if(m=Jt,k=dr,Jt=null,fi(r,i,c),Jt=m,dr=k,Jt!==null)if(dr)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(c.stateNode)}catch(O){zt(c,i,O)}else try{Jt.removeChild(c.stateNode)}catch(O){zt(c,i,O)}break;case 18:Jt!==null&&(dr?(r=Jt,Mx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Sl(r)):Mx(Jt,c.stateNode));break;case 4:m=Jt,k=dr,Jt=c.stateNode.containerInfo,dr=!0,fi(r,i,c),Jt=m,dr=k;break;case 0:case 11:case 14:case 15:Vi(2,c,i),xn||Vi(4,c,i),fi(r,i,c);break;case 1:xn||(As(c,i),m=c.stateNode,typeof m.componentWillUnmount=="function"&&D1(c,i,m)),fi(r,i,c);break;case 21:fi(r,i,c);break;case 22:xn=(m=xn)||c.memoizedState!==null,fi(r,i,c),xn=m;break;default:fi(r,i,c)}}function F1(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Sl(r)}catch(c){zt(i,i.return,c)}}}function V1(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Sl(r)}catch(c){zt(i,i.return,c)}}function OL(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new N1),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new N1),i;default:throw Error(s(435,r.tag))}}function sf(r,i){var c=OL(r);i.forEach(function(m){if(!c.has(m)){c.add(m);var k=HL.bind(null,r,m);m.then(k,k)}})}function fr(r,i){var c=i.deletions;if(c!==null)for(var m=0;m<c.length;m++){var k=c[m],O=r,B=i,Z=B;e:for(;Z!==null;){switch(Z.tag){case 27:if(Yi(Z.type)){Jt=Z.stateNode,dr=!1;break e}break;case 5:Jt=Z.stateNode,dr=!1;break e;case 3:case 4:Jt=Z.stateNode.containerInfo,dr=!0;break e}Z=Z.return}if(Jt===null)throw Error(s(160));H1(O,B,k),Jt=null,dr=!1,O=k.alternate,O!==null&&(O.return=null),k.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)U1(i,r),i=i.sibling}var ms=null;function U1(r,i){var c=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:fr(i,r),hr(r),m&4&&(Vi(3,r,r.return),Xc(3,r),Vi(5,r,r.return));break;case 1:fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),m&64&&di&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var k=ms;if(fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),m&4){var O=c!==null?c.memoizedState:null;if(m=r.memoizedState,c===null)if(m===null)if(r.stateNode===null){e:{m=r.type,c=r.memoizedProps,k=k.ownerDocument||k;t:switch(m){case"title":O=k.getElementsByTagName("title")[0],(!O||O[ko]||O[pn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=k.createElement(m),k.head.insertBefore(O,k.querySelector("head > title"))),Un(O,m,c),O[pn]=r,gn(O),m=O;break e;case"link":var B=Ux("link","href",k).get(m+(c.href||""));if(B){for(var Z=0;Z<B.length;Z++)if(O=B[Z],O.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&O.getAttribute("rel")===(c.rel==null?null:c.rel)&&O.getAttribute("title")===(c.title==null?null:c.title)&&O.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){B.splice(Z,1);break t}}O=k.createElement(m),Un(O,m,c),k.head.appendChild(O);break;case"meta":if(B=Ux("meta","content",k).get(m+(c.content||""))){for(Z=0;Z<B.length;Z++)if(O=B[Z],O.getAttribute("content")===(c.content==null?null:""+c.content)&&O.getAttribute("name")===(c.name==null?null:c.name)&&O.getAttribute("property")===(c.property==null?null:c.property)&&O.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&O.getAttribute("charset")===(c.charSet==null?null:c.charSet)){B.splice(Z,1);break t}}O=k.createElement(m),Un(O,m,c),k.head.appendChild(O);break;default:throw Error(s(468,m))}O[pn]=r,gn(O),m=O}r.stateNode=m}else Wx(k,r.type,r.stateNode);else r.stateNode=Vx(k,m,r.memoizedProps);else O!==m?(O===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):O.count--,m===null?Wx(k,r.type,r.stateNode):Vx(k,m,r.memoizedProps)):m===null&&r.stateNode!==null&&lg(r,r.memoizedProps,c.memoizedProps)}break;case 27:fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),c!==null&&m&4&&lg(r,r.memoizedProps,c.memoizedProps);break;case 5:if(fr(i,r),hr(r),m&512&&(xn||c===null||As(c,c.return)),r.flags&32){k=r.stateNode;try{rt(k,"")}catch($e){zt(r,r.return,$e)}}m&4&&r.stateNode!=null&&(k=r.memoizedProps,lg(r,k,c!==null?c.memoizedProps:k)),m&1024&&(dg=!0);break;case 6:if(fr(i,r),hr(r),m&4){if(r.stateNode===null)throw Error(s(162));m=r.memoizedProps,c=r.stateNode;try{c.nodeValue=m}catch($e){zt(r,r.return,$e)}}break;case 3:if(xf=null,k=ms,ms=yf(i.containerInfo),fr(i,r),ms=k,hr(r),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Sl(i.containerInfo)}catch($e){zt(r,r.return,$e)}dg&&(dg=!1,W1(r));break;case 4:m=ms,ms=yf(r.stateNode.containerInfo),fr(i,r),hr(r),ms=m;break;case 12:fr(i,r),hr(r);break;case 31:fr(i,r),hr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,sf(r,m)));break;case 13:fr(i,r),hr(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(af=ke()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,sf(r,m)));break;case 22:k=r.memoizedState!==null;var ie=c!==null&&c.memoizedState!==null,he=di,Ce=xn;if(di=he||k,xn=Ce||ie,fr(i,r),xn=Ce,di=he,hr(r),m&8192)e:for(i=r.stateNode,i._visibility=k?i._visibility&-2:i._visibility|1,k&&(c===null||ie||di||xn||Wo(r)),c=null,i=r;;){if(i.tag===5||i.tag===26){if(c===null){ie=c=i;try{if(O=ie.stateNode,k)B=O.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{Z=ie.stateNode;var Le=ie.memoizedProps.style,me=Le!=null&&Le.hasOwnProperty("display")?Le.display:null;Z.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch($e){zt(ie,ie.return,$e)}}}else if(i.tag===6){if(c===null){ie=i;try{ie.stateNode.nodeValue=k?"":ie.memoizedProps}catch($e){zt(ie,ie.return,$e)}}}else if(i.tag===18){if(c===null){ie=i;try{var ye=ie.stateNode;k?Dx(ye,!0):Dx(ie.stateNode,!1)}catch($e){zt(ie,ie.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&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;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=r.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,sf(r,c))));break;case 19:fr(i,r),hr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,sf(r,m)));break;case 30:break;case 21:break;default:fr(i,r),hr(r)}}function hr(r){var i=r.flags;if(i&2){try{for(var c,m=r.return;m!==null;){if(j1(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var k=c.stateNode,O=cg(r);rf(r,O,k);break;case 5:var B=c.stateNode;c.flags&32&&(rt(B,""),c.flags&=-33);var Z=cg(r);rf(r,Z,B);break;case 3:case 4:var ie=c.stateNode.containerInfo,he=cg(r);ug(r,he,ie);break;default:throw Error(s(161))}}catch(Ce){zt(r,r.return,Ce)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function W1(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;W1(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function hi(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)B1(r,i.alternate,i),i=i.sibling}function Wo(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Vi(4,i,i.return),Wo(i);break;case 1:As(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&D1(i,i.return,c),Wo(i);break;case 27:ou(i.stateNode);case 26:case 5:As(i,i.return),Wo(i);break;case 22:i.memoizedState===null&&Wo(i);break;case 30:Wo(i);break;default:Wo(i)}r=r.sibling}}function pi(r,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,k=r,O=i,B=O.flags;switch(O.tag){case 0:case 11:case 15:pi(k,O,c),Xc(4,O);break;case 1:if(pi(k,O,c),m=O,k=m.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(he){zt(m,m.return,he)}if(m=O,k=m.updateQueue,k!==null){var Z=m.stateNode;try{var ie=k.shared.hiddenCallbacks;if(ie!==null)for(k.shared.hiddenCallbacks=null,k=0;k<ie.length;k++)xb(ie[k],Z)}catch(he){zt(m,m.return,he)}}c&&B&64&&M1(O),Qc(O,O.return);break;case 27:I1(O);case 26:case 5:pi(k,O,c),c&&m===null&&B&4&&P1(O),Qc(O,O.return);break;case 12:pi(k,O,c);break;case 31:pi(k,O,c),c&&B&4&&F1(k,O);break;case 13:pi(k,O,c),c&&B&4&&V1(k,O);break;case 22:O.memoizedState===null&&pi(k,O,c),Qc(O,O.return);break;case 30:break;default:pi(k,O,c)}i=i.sibling}}function fg(r,i){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Nc(c))}function hg(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Nc(r))}function gs(r,i,c,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)q1(r,i,c,m),i=i.sibling}function q1(r,i,c,m){var k=i.flags;switch(i.tag){case 0:case 11:case 15:gs(r,i,c,m),k&2048&&Xc(9,i);break;case 1:gs(r,i,c,m);break;case 3:gs(r,i,c,m),k&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Nc(r)));break;case 12:if(k&2048){gs(r,i,c,m),r=i.stateNode;try{var O=i.memoizedProps,B=O.id,Z=O.onPostCommit;typeof Z=="function"&&Z(B,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){zt(i,i.return,ie)}}else gs(r,i,c,m);break;case 31:gs(r,i,c,m);break;case 13:gs(r,i,c,m);break;case 23:break;case 22:O=i.stateNode,B=i.alternate,i.memoizedState!==null?O._visibility&2?gs(r,i,c,m):Zc(r,i):O._visibility&2?gs(r,i,c,m):(O._visibility|=2,dl(r,i,c,m,(i.subtreeFlags&10256)!==0||!1)),k&2048&&fg(B,i);break;case 24:gs(r,i,c,m),k&2048&&hg(i.alternate,i);break;default:gs(r,i,c,m)}}function dl(r,i,c,m,k){for(k=k&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var O=r,B=i,Z=c,ie=m,he=B.flags;switch(B.tag){case 0:case 11:case 15:dl(O,B,Z,ie,k),Xc(8,B);break;case 23:break;case 22:var Ce=B.stateNode;B.memoizedState!==null?Ce._visibility&2?dl(O,B,Z,ie,k):Zc(O,B):(Ce._visibility|=2,dl(O,B,Z,ie,k)),k&&he&2048&&fg(B.alternate,B);break;case 24:dl(O,B,Z,ie,k),k&&he&2048&&hg(B.alternate,B);break;default:dl(O,B,Z,ie,k)}i=i.sibling}}function Zc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=r,m=i,k=m.flags;switch(m.tag){case 22:Zc(c,m),k&2048&&fg(m.alternate,m);break;case 24:Zc(c,m),k&2048&&hg(m.alternate,m);break;default:Zc(c,m)}i=i.sibling}}var Jc=8192;function fl(r,i,c){if(r.subtreeFlags&Jc)for(r=r.child;r!==null;)G1(r,i,c),r=r.sibling}function G1(r,i,c){switch(r.tag){case 26:fl(r,i,c),r.flags&Jc&&r.memoizedState!==null&&vA(c,ms,r.memoizedState,r.memoizedProps);break;case 5:fl(r,i,c);break;case 3:case 4:var m=ms;ms=yf(r.stateNode.containerInfo),fl(r,i,c),ms=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=Jc,Jc=16777216,fl(r,i,c),Jc=m):fl(r,i,c));break;default:fl(r,i,c)}}function $1(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function eu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Nn=m,Y1(m,r)}$1(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)K1(r),r=r.sibling}function K1(r){switch(r.tag){case 0:case 11:case 15:eu(r),r.flags&2048&&Vi(9,r,r.return);break;case 3:eu(r);break;case 12:eu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,of(r)):eu(r);break;default:eu(r)}}function of(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Nn=m,Y1(m,r)}$1(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Vi(8,i,i.return),of(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,of(i));break;default:of(i)}r=r.sibling}}function Y1(r,i){for(;Nn!==null;){var c=Nn;switch(c.tag){case 0:case 11:case 15:Vi(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Nc(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Nn=m;else e:for(c=r;Nn!==null;){m=Nn;var k=m.sibling,O=m.return;if(z1(m),m===c){Nn=null;break e}if(k!==null){k.return=O,Nn=k;break e}Nn=O}}}var ML={getCacheForType:function(r){var i=Fn(_n),c=i.data.get(r);return c===void 0&&(c=r(),i.data.set(r,c)),c},cacheSignal:function(){return Fn(_n).controller.signal}},DL=typeof WeakMap=="function"?WeakMap:Map,jt=0,qt=null,Et=null,Tt=0,Bt=0,Mr=null,Ui=!1,hl=!1,pg=!1,mi=0,ln=0,Wi=0,qo=0,mg=0,Dr=0,pl=0,tu=null,pr=null,gg=!1,af=0,X1=0,lf=1/0,cf=null,qi=null,Tn=0,Gi=null,ml=null,gi=0,vg=0,_g=null,Q1=null,nu=0,yg=null;function Pr(){return(jt&2)!==0&&Tt!==0?Tt&-Tt:V.T!==null?Eg():Es()}function Z1(){if(Dr===0)if((Tt&536870912)===0||At){var r=nn;nn<<=1,(nn&3932160)===0&&(nn=262144),Dr=r}else Dr=536870912;return r=Ar.current,r!==null&&(r.flags|=32),Dr}function mr(r,i,c){(r===qt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(gl(r,0),$i(r,Tt,Dr,!1)),bt(r,c),((jt&2)===0||r!==qt)&&(r===qt&&((jt&2)===0&&(qo|=c),ln===4&&$i(r,Tt,Dr,!1)),Os(r))}function J1(r,i,c){if((jt&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),k=m?IL(r,i):xg(r,i,!0),O=m;do{if(k===0){hl&&!m&&$i(r,i,0,!1);break}else{if(c=r.current.alternate,O&&!PL(c)){k=xg(r,i,!1),O=!1;continue}if(k===2){if(O=i,r.errorRecoveryDisabledLanes&O)var B=0;else B=r.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){i=B;e:{var Z=r;k=tu;var ie=Z.current.memoizedState.isDehydrated;if(ie&&(gl(Z,B).flags|=256),B=xg(Z,B,!1),B!==2){if(pg&&!ie){Z.errorRecoveryDisabledLanes|=O,qo|=O,k=4;break e}O=pr,pr=k,O!==null&&(pr===null?pr=O:pr.push.apply(pr,O))}k=B}if(O=!1,k!==2)continue}}if(k===1){gl(r,0),$i(r,i,0,!0);break}e:{switch(m=r,O=k,O){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:$i(m,i,Dr,!Ui);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(k=af+300-ke(),10<k)){if($i(m,i,Dr,!Ui),Je(m,0,!0)!==0)break e;gi=i,m.timeoutHandle=Ax(ex.bind(null,m,c,pr,cf,gg,i,Dr,qo,pl,Ui,O,"Throttled",-0,0),k);break e}ex(m,c,pr,cf,gg,i,Dr,qo,pl,Ui,O,null,-0,0)}}break}while(!0);Os(r)}function ex(r,i,c,m,k,O,B,Z,ie,he,Ce,Le,me,ye){if(r.timeoutHandle=-1,Le=i.subtreeFlags,Le&8192||(Le&16785408)===16785408){Le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hs},G1(i,O,Le);var $e=(O&62914560)===O?af-ke():(O&4194048)===O?X1-ke():0;if($e=_A(Le,$e),$e!==null){gi=O,r.cancelPendingCommit=$e(lx.bind(null,r,i,O,c,m,k,B,Z,ie,Ce,Le,null,me,ye)),$i(r,O,B,!he);return}}lx(r,i,O,c,m,k,B,Z,ie)}function PL(r){for(var i=r;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var k=c[m],O=k.getSnapshot;k=k.value;try{if(!Tr(O(),k))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function $i(r,i,c,m){i&=~mg,i&=~qo,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var k=i;0<k;){var O=31-lt(k),B=1<<O;m[O]=-1,k&=~B}c!==0&&Qe(r,c,i)}function uf(){return(jt&6)===0?(ru(0),!1):!0}function bg(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,ii=Io=null,Im(r),ol=null,zc=0,r=Et;for(;r!==null;)O1(r.alternate,r),r=r.return;Et=null}}function gl(r,i){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,eA(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),gi=0,bg(),qt=r,Et=c=ri(r.current,null),Tt=i,Bt=0,Mr=null,Ui=!1,hl=Ot(r,i),pg=!1,pl=Dr=mg=qo=Wi=ln=0,pr=tu=null,gg=!1,(i&8)!==0&&(i|=i&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=i;0<m;){var k=31-lt(m),O=1<<k;i|=r[k],m&=~O}return mi=i,Ad(),c}function tx(r,i){gt=null,V.H=$c,i===il||i===Bd?(i=vb(),Bt=3):i===wm?(i=vb(),Bt=4):Bt=i===Zm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Mr=i,Et===null&&(ln=1,Zd(r,qr(i,r.current)))}function nx(){var r=Ar.current;return r===null?!0:(Tt&4194048)===Tt?Yr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===Yr:!1}function rx(){var r=V.H;return V.H=$c,r===null?$c:r}function sx(){var r=V.A;return V.A=ML,r}function df(){ln=4,Ui||(Tt&4194048)!==Tt&&Ar.current!==null||(hl=!0),(Wi&134217727)===0&&(qo&134217727)===0||qt===null||$i(qt,Tt,Dr,!1)}function xg(r,i,c){var m=jt;jt|=2;var k=rx(),O=sx();(qt!==r||Tt!==i)&&(cf=null,gl(r,i)),i=!1;var B=ln;e:do try{if(Bt!==0&&Et!==null){var Z=Et,ie=Mr;switch(Bt){case 8:bg(),B=6;break e;case 3:case 2:case 9:case 6:Ar.current===null&&(i=!0);var he=Bt;if(Bt=0,Mr=null,vl(r,Z,ie,he),c&&hl){B=0;break e}break;default:he=Bt,Bt=0,Mr=null,vl(r,Z,ie,he)}}jL(),B=ln;break}catch(Ce){tx(r,Ce)}while(!0);return i&&r.shellSuspendCounter++,ii=Io=null,jt=m,V.H=k,V.A=O,Et===null&&(qt=null,Tt=0,Ad()),B}function jL(){for(;Et!==null;)ix(Et)}function IL(r,i){var c=jt;jt|=2;var m=rx(),k=sx();qt!==r||Tt!==i?(cf=null,lf=ke()+500,gl(r,i)):hl=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=Mr;t:switch(Bt){case 1:Bt=0,Mr=null,vl(r,i,O,1);break;case 2:case 9:if(mb(O)){Bt=0,Mr=null,ox(i);break}i=function(){Bt!==2&&Bt!==9||qt!==r||(Bt=7),Os(r)},O.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:mb(O)?(Bt=0,Mr=null,ox(i)):(Bt=0,Mr=null,vl(r,i,O,7));break;case 5:var B=null;switch(Et.tag){case 26:B=Et.memoizedState;case 5:case 27:var Z=Et;if(B?qx(B):Z.stateNode.complete){Bt=0,Mr=null;var ie=Z.sibling;if(ie!==null)Et=ie;else{var he=Z.return;he!==null?(Et=he,ff(he)):Et=null}break t}}Bt=0,Mr=null,vl(r,i,O,5);break;case 6:Bt=0,Mr=null,vl(r,i,O,6);break;case 8:bg(),ln=6;break e;default:throw Error(s(462))}}NL();break}catch(Ce){tx(r,Ce)}while(!0);return ii=Io=null,V.H=m,V.A=k,jt=c,Et!==null?0:(qt=null,Tt=0,Ad(),ln)}function NL(){for(;Et!==null&&!Me();)ix(Et)}function ix(r){var i=L1(r.alternate,r,mi);r.memoizedProps=r.pendingProps,i===null?ff(r):Et=i}function ox(r){var i=r,c=i.alternate;switch(i.tag){case 15:case 0:i=C1(c,i,i.pendingProps,i.type,void 0,Tt);break;case 11:i=C1(c,i,i.pendingProps,i.type.render,i.ref,Tt);break;case 5:Im(i);default:O1(c,i),i=Et=sb(i,mi),i=L1(c,i,mi)}r.memoizedProps=r.pendingProps,i===null?ff(r):Et=i}function vl(r,i,c,m){ii=Io=null,Im(i),ol=null,zc=0;var k=i.return;try{if(EL(r,k,i,c,Tt)){ln=1,Zd(r,qr(c,r.current)),Et=null;return}}catch(O){if(k!==null)throw Et=k,O;ln=1,Zd(r,qr(c,r.current)),Et=null;return}i.flags&32768?(At||m===1?r=!0:hl||(Tt&536870912)!==0?r=!1:(Ui=r=!0,(m===2||m===9||m===3||m===6)&&(m=Ar.current,m!==null&&m.tag===13&&(m.flags|=16384))),ax(i,r)):ff(i)}function ff(r){var i=r;do{if((i.flags&32768)!==0){ax(i,Ui);return}r=i.return;var c=TL(i.alternate,i,mi);if(c!==null){Et=c;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);ln===0&&(ln=5)}function ax(r,i){do{var c=LL(r.alternate,r);if(c!==null){c.flags&=32767,Et=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(r=r.sibling,r!==null)){Et=r;return}Et=r=c}while(r!==null);ln=6,Et=null}function lx(r,i,c,m,k,O,B,Z,ie){r.cancelPendingCommit=null;do hf();while(Tn!==0);if((jt&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=cm,xt(r,c,O,B,Z,ie),r===qt&&(Et=qt=null,Tt=0),ml=i,Gi=r,gi=c,vg=O,_g=k,Q1=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,FL(xe,function(){return hx(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=V.T,V.T=null,k=Y.p,Y.p=2,B=jt,jt|=4;try{AL(r,i,c)}finally{jt=B,Y.p=k,V.T=m}}Tn=1,cx(),ux(),dx()}}function cx(){if(Tn===1){Tn=0;var r=Gi,i=ml,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=V.T,V.T=null;var m=Y.p;Y.p=2;var k=jt;jt|=4;try{U1(i,r);var O=Dg,B=Yy(r.containerInfo),Z=O.focusedElem,ie=O.selectionRange;if(B!==Z&&Z&&Z.ownerDocument&&Ky(Z.ownerDocument.documentElement,Z)){if(ie!==null&&sm(Z)){var he=ie.start,Ce=ie.end;if(Ce===void 0&&(Ce=he),"selectionStart"in Z)Z.selectionStart=he,Z.selectionEnd=Math.min(Ce,Z.value.length);else{var Le=Z.ownerDocument||document,me=Le&&Le.defaultView||window;if(me.getSelection){var ye=me.getSelection(),$e=Z.textContent.length,ut=Math.min(ie.start,$e),Ut=ie.end===void 0?ut:Math.min(ie.end,$e);!ye.extend&&ut>Ut&&(B=Ut,Ut=ut,ut=B);var ce=$y(Z,ut),ae=$y(Z,Ut);if(ce&&ae&&(ye.rangeCount!==1||ye.anchorNode!==ce.node||ye.anchorOffset!==ce.offset||ye.focusNode!==ae.node||ye.focusOffset!==ae.offset)){var fe=Le.createRange();fe.setStart(ce.node,ce.offset),ye.removeAllRanges(),ut>Ut?(ye.addRange(fe),ye.extend(ae.node,ae.offset)):(fe.setEnd(ae.node,ae.offset),ye.addRange(fe))}}}}for(Le=[],ye=Z;ye=ye.parentNode;)ye.nodeType===1&&Le.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<Le.length;Z++){var Te=Le[Z];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}Ef=!!Mg,Dg=Mg=null}finally{jt=k,Y.p=m,V.T=c}}r.current=i,Tn=2}}function ux(){if(Tn===2){Tn=0;var r=Gi,i=ml,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=V.T,V.T=null;var m=Y.p;Y.p=2;var k=jt;jt|=4;try{B1(r,i.alternate,i)}finally{jt=k,Y.p=m,V.T=c}}Tn=3}}function dx(){if(Tn===4||Tn===3){Tn=0,pe();var r=Gi,i=ml,c=gi,m=Q1;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Tn=5:(Tn=0,ml=Gi=null,fx(r,r.pendingLanes));var k=r.pendingLanes;if(k===0&&(qi=null),zn(c),i=i.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(He,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=V.T,k=Y.p,Y.p=2,V.T=null;try{for(var O=r.onRecoverableError,B=0;B<m.length;B++){var Z=m[B];O(Z.value,{componentStack:Z.stack})}}finally{V.T=i,Y.p=k}}(gi&3)!==0&&hf(),Os(r),k=r.pendingLanes,(c&261930)!==0&&(k&42)!==0?r===yg?nu++:(nu=0,yg=r):nu=0,ru(0)}}function fx(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Nc(i)))}function hf(){return cx(),ux(),dx(),hx()}function hx(){if(Tn!==5)return!1;var r=Gi,i=vg;vg=0;var c=zn(gi),m=V.T,k=Y.p;try{Y.p=32>c?32:c,V.T=null,c=_g,_g=null;var O=Gi,B=gi;if(Tn=0,ml=Gi=null,gi=0,(jt&6)!==0)throw Error(s(331));var Z=jt;if(jt|=4,K1(O.current),q1(O,O.current,B,c),jt=Z,ru(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(He,O)}catch{}return!0}finally{Y.p=k,V.T=m,fx(r,i)}}function px(r,i,c){i=qr(c,i),i=Qm(r.stateNode,i,2),r=zi(r,i,2),r!==null&&(bt(r,2),Os(r))}function zt(r,i,c){if(r.tag===3)px(r,r,c);else for(;i!==null;){if(i.tag===3){px(i,r,c);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(qi===null||!qi.has(m))){r=qr(c,r),c=m1(2),m=zi(i,c,2),m!==null&&(g1(c,m,i,r),bt(m,2),Os(m));break}}i=i.return}}function Sg(r,i,c){var m=r.pingCache;if(m===null){m=r.pingCache=new DL;var k=new Set;m.set(i,k)}else k=m.get(i),k===void 0&&(k=new Set,m.set(i,k));k.has(c)||(pg=!0,k.add(c),r=BL.bind(null,r,i,c),i.then(r,r))}function BL(r,i,c){var m=r.pingCache;m!==null&&m.delete(i),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,qt===r&&(Tt&c)===c&&(ln===4||ln===3&&(Tt&62914560)===Tt&&300>ke()-af?(jt&2)===0&&gl(r,0):mg|=c,pl===Tt&&(pl=0)),Os(r)}function mx(r,i){i===0&&(i=ot()),r=Do(r,i),r!==null&&(bt(r,i),Os(r))}function zL(r){var i=r.memoizedState,c=0;i!==null&&(c=i.retryLane),mx(r,c)}function HL(r,i){var c=0;switch(r.tag){case 31:case 13:var m=r.stateNode,k=r.memoizedState;k!==null&&(c=k.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),mx(r,c)}function FL(r,i){return Oe(r,i)}var pf=null,_l=null,Cg=!1,mf=!1,wg=!1,Ki=0;function Os(r){r!==_l&&r.next===null&&(_l===null?pf=_l=r:_l=_l.next=r),mf=!0,Cg||(Cg=!0,UL())}function ru(r,i){if(!wg&&mf){wg=!0;do for(var c=!1,m=pf;m!==null;){if(r!==0){var k=m.pendingLanes;if(k===0)var O=0;else{var B=m.suspendedLanes,Z=m.pingedLanes;O=(1<<31-lt(42|r)+1)-1,O&=k&~(B&~Z),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(c=!0,yx(m,O))}else O=Tt,O=Je(m,m===qt?O:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(O&3)===0||Ot(m,O)||(c=!0,yx(m,O));m=m.next}while(c);wg=!1}}function VL(){gx()}function gx(){mf=Cg=!1;var r=0;Ki!==0&&JL()&&(r=Ki);for(var i=ke(),c=null,m=pf;m!==null;){var k=m.next,O=vx(m,i);O===0?(m.next=null,c===null?pf=k:c.next=k,k===null&&(_l=c)):(c=m,(r!==0||(O&3)!==0)&&(mf=!0)),m=k}Tn!==0&&Tn!==5||ru(r),Ki!==0&&(Ki=0)}function vx(r,i){for(var c=r.suspendedLanes,m=r.pingedLanes,k=r.expirationTimes,O=r.pendingLanes&-62914561;0<O;){var B=31-lt(O),Z=1<<B,ie=k[B];ie===-1?((Z&c)===0||(Z&m)!==0)&&(k[B]=It(Z,i)):ie<=i&&(r.expiredLanes|=Z),O&=~Z}if(i=qt,c=Tt,c=Je(r,r===i?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,c===0||r===i&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&be(m),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||Ot(r,c)){if(i=c&-c,i===r.callbackPriority)return i;switch(m!==null&&be(m),zn(c)){case 2:case 8:c=et;break;case 32:c=xe;break;case 268435456:c=tt;break;default:c=xe}return m=_x.bind(null,r),c=Oe(c,m),r.callbackPriority=i,r.callbackNode=c,i}return m!==null&&m!==null&&be(m),r.callbackPriority=2,r.callbackNode=null,2}function _x(r,i){if(Tn!==0&&Tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(hf()&&r.callbackNode!==c)return null;var m=Tt;return m=Je(r,r===qt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(J1(r,m,i),vx(r,ke()),r.callbackNode!=null&&r.callbackNode===c?_x.bind(null,r):null)}function yx(r,i){if(hf())return null;J1(r,i,!0)}function UL(){tA(function(){(jt&6)!==0?Oe(We,VL):gx()})}function Eg(){if(Ki===0){var r=rl;r===0&&(r=ct,ct<<=1,(ct&261888)===0&&(ct=256)),Ki=r}return Ki}function bx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ti(""+r)}function xx(r,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,r.id&&c.setAttribute("form",r.id),i.parentNode.insertBefore(c,i),r=new FormData(r),c.parentNode.removeChild(c),r}function WL(r,i,c,m,k){if(i==="submit"&&c&&c.stateNode===k){var O=bx((k[mn]||null).action),B=m.submitter;B&&(i=(i=B[mn]||null)?bx(i.formAction):B.getAttribute("formAction"),i!==null&&(O=i,B=null));var Z=new Rd("action","action",null,m,k);r.push({event:Z,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ki!==0){var ie=B?xx(k,B):new FormData(k);qm(c,{pending:!0,data:ie,method:k.method,action:O},null,ie)}}else typeof O=="function"&&(Z.preventDefault(),ie=B?xx(k,B):new FormData(k),qm(c,{pending:!0,data:ie,method:k.method,action:O},O,ie))},currentTarget:k}]})}}for(var Rg=0;Rg<lm.length;Rg++){var kg=lm[Rg],qL=kg.toLowerCase(),GL=kg[0].toUpperCase()+kg.slice(1);ps(qL,"on"+GL)}ps(Zy,"onAnimationEnd"),ps(Jy,"onAnimationIteration"),ps(eb,"onAnimationStart"),ps("dblclick","onDoubleClick"),ps("focusin","onFocus"),ps("focusout","onBlur"),ps(lL,"onTransitionRun"),ps(cL,"onTransitionStart"),ps(uL,"onTransitionCancel"),ps(tb,"onTransitionEnd"),fs("onMouseEnter",["mouseout","mouseover"]),fs("onMouseLeave",["mouseout","mouseover"]),fs("onPointerEnter",["pointerout","pointerover"]),fs("onPointerLeave",["pointerout","pointerover"]),Rr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var su="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(" "),$L=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(su));function Sx(r,i){i=(i&4)!==0;for(var c=0;c<r.length;c++){var m=r[c],k=m.event;m=m.listeners;e:{var O=void 0;if(i)for(var B=m.length-1;0<=B;B--){var Z=m[B],ie=Z.instance,he=Z.currentTarget;if(Z=Z.listener,ie!==O&&k.isPropagationStopped())break e;O=Z,k.currentTarget=he;try{O(k)}catch(Ce){Ld(Ce)}k.currentTarget=null,O=ie}else for(B=0;B<m.length;B++){if(Z=m[B],ie=Z.instance,he=Z.currentTarget,Z=Z.listener,ie!==O&&k.isPropagationStopped())break e;O=Z,k.currentTarget=he;try{O(k)}catch(Ce){Ld(Ce)}k.currentTarget=null,O=ie}}}}function Rt(r,i){var c=i[Er];c===void 0&&(c=i[Er]=new Set);var m=r+"__bubble";c.has(m)||(Cx(i,r,2,!1),c.add(m))}function Tg(r,i,c){var m=0;i&&(m|=4),Cx(c,r,m,i)}var gf="_reactListening"+Math.random().toString(36).slice(2);function Lg(r){if(!r[gf]){r[gf]=!0,tr.forEach(function(c){c!=="selectionchange"&&($L.has(c)||Tg(c,!1,r),Tg(c,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[gf]||(i[gf]=!0,Tg("selectionchange",!1,i))}}function Cx(r,i,c,m){switch(Zx(i)){case 2:var k=xA;break;case 8:k=SA;break;default:k=Wg}c=k.bind(null,i,c,r),k=void 0,!Yp||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(k=!0),m?k!==void 0?r.addEventListener(i,c,{capture:!0,passive:k}):r.addEventListener(i,c,!0):k!==void 0?r.addEventListener(i,c,{passive:k}):r.addEventListener(i,c,!1)}function Ag(r,i,c,m,k){var O=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var B=m.tag;if(B===3||B===4){var Z=m.stateNode.containerInfo;if(Z===k)break;if(B===4)for(B=m.return;B!==null;){var ie=B.tag;if((ie===3||ie===4)&&B.stateNode.containerInfo===k)return;B=B.return}for(;Z!==null;){if(B=Qs(Z),B===null)return;if(ie=B.tag,ie===5||ie===6||ie===26||ie===27){m=O=B;continue e}Z=Z.parentNode}}m=m.return}Ty(function(){var he=O,Ce=$p(c),Le=[];e:{var me=nb.get(r);if(me!==void 0){var ye=Rd,$e=r;switch(r){case"keypress":if(wd(c)===0)break e;case"keydown":case"keyup":ye=H5;break;case"focusin":$e="focus",ye=Jp;break;case"focusout":$e="blur",ye=Jp;break;case"beforeblur":case"afterblur":ye=Jp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Oy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=T5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=U5;break;case Zy:case Jy:case eb:ye=O5;break;case tb:ye=q5;break;case"scroll":case"scrollend":ye=R5;break;case"wheel":ye=$5;break;case"copy":case"cut":case"paste":ye=D5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Dy;break;case"toggle":case"beforetoggle":ye=Y5}var ut=(i&4)!==0,Ut=!ut&&(r==="scroll"||r==="scrollend"),ce=ut?me!==null?me+"Capture":null:me;ut=[];for(var ae=he,fe;ae!==null;){var Te=ae;if(fe=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||fe===null||ce===null||(Te=Rc(ae,ce),Te!=null&&ut.push(iu(ae,Te,fe))),Ut)break;ae=ae.return}0<ut.length&&(me=new ye(me,$e,null,c,Ce),Le.push({event:me,listeners:ut}))}}if((i&7)===0){e:{if(me=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",me&&c!==Sd&&($e=c.relatedTarget||c.fromElement)&&(Qs($e)||$e[Rs]))break e;if((ye||me)&&(me=Ce.window===Ce?Ce:(me=Ce.ownerDocument)?me.defaultView||me.parentWindow:window,ye?($e=c.relatedTarget||c.toElement,ye=he,$e=$e?Qs($e):null,$e!==null&&(Ut=u($e),ut=$e.tag,$e!==Ut||ut!==5&&ut!==27&&ut!==6)&&($e=null)):(ye=null,$e=he),ye!==$e)){if(ut=Oy,Te="onMouseLeave",ce="onMouseEnter",ae="mouse",(r==="pointerout"||r==="pointerover")&&(ut=Dy,Te="onPointerLeave",ce="onPointerEnter",ae="pointer"),Ut=ye==null?me:Lo(ye),fe=$e==null?me:Lo($e),me=new ut(Te,ae+"leave",ye,c,Ce),me.target=Ut,me.relatedTarget=fe,Te=null,Qs(Ce)===he&&(ut=new ut(ce,ae+"enter",$e,c,Ce),ut.target=fe,ut.relatedTarget=Ut,Te=ut),Ut=Te,ye&&$e)t:{for(ut=KL,ce=ye,ae=$e,fe=0,Te=ce;Te;Te=ut(Te))fe++;Te=0;for(var it=ae;it;it=ut(it))Te++;for(;0<fe-Te;)ce=ut(ce),fe--;for(;0<Te-fe;)ae=ut(ae),Te--;for(;fe--;){if(ce===ae||ae!==null&&ce===ae.alternate){ut=ce;break t}ce=ut(ce),ae=ut(ae)}ut=null}else ut=null;ye!==null&&wx(Le,me,ye,ut,!1),$e!==null&&Ut!==null&&wx(Le,Ut,$e,ut,!0)}}e:{if(me=he?Lo(he):window,ye=me.nodeName&&me.nodeName.toLowerCase(),ye==="select"||ye==="input"&&me.type==="file")var Mt=Fy;else if(zy(me))if(Vy)Mt=iL;else{Mt=rL;var Ze=nL}else ye=me.nodeName,!ye||ye.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?he&&vn(he.elementType)&&(Mt=Fy):Mt=sL;if(Mt&&(Mt=Mt(r,he))){Hy(Le,Mt,c,Ce);break e}Ze&&Ze(r,me,he),r==="focusout"&&he&&me.type==="number"&&he.memoizedProps.value!=null&&Ec(me,"number",me.value)}switch(Ze=he?Lo(he):window,r){case"focusin":(zy(Ze)||Ze.contentEditable==="true")&&(Ya=Ze,im=he,Pc=null);break;case"focusout":Pc=im=Ya=null;break;case"mousedown":om=!0;break;case"contextmenu":case"mouseup":case"dragend":om=!1,Xy(Le,c,Ce);break;case"selectionchange":if(aL)break;case"keydown":case"keyup":Xy(Le,c,Ce)}var _t;if(tm)e:{switch(r){case"compositionstart":var Lt="onCompositionStart";break e;case"compositionend":Lt="onCompositionEnd";break e;case"compositionupdate":Lt="onCompositionUpdate";break e}Lt=void 0}else Ka?Ny(r,c)&&(Lt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Lt="onCompositionStart");Lt&&(Py&&c.locale!=="ko"&&(Ka||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&Ka&&(_t=Ly()):(Mi=Ce,Xp="value"in Mi?Mi.value:Mi.textContent,Ka=!0)),Ze=vf(he,Lt),0<Ze.length&&(Lt=new My(Lt,r,null,c,Ce),Le.push({event:Lt,listeners:Ze}),_t?Lt.data=_t:(_t=By(c),_t!==null&&(Lt.data=_t)))),(_t=Q5?Z5(r,c):J5(r,c))&&(Lt=vf(he,"onBeforeInput"),0<Lt.length&&(Ze=new My("onBeforeInput","beforeinput",null,c,Ce),Le.push({event:Ze,listeners:Lt}),Ze.data=_t)),WL(Le,r,he,c,Ce)}Sx(Le,i)})}function iu(r,i,c){return{instance:r,listener:i,currentTarget:c}}function vf(r,i){for(var c=i+"Capture",m=[];r!==null;){var k=r,O=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||O===null||(k=Rc(r,c),k!=null&&m.unshift(iu(r,k,O)),k=Rc(r,i),k!=null&&m.push(iu(r,k,O))),r.tag===3)return m;r=r.return}return[]}function KL(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function wx(r,i,c,m,k){for(var O=i._reactName,B=[];c!==null&&c!==m;){var Z=c,ie=Z.alternate,he=Z.stateNode;if(Z=Z.tag,ie!==null&&ie===m)break;Z!==5&&Z!==26&&Z!==27||he===null||(ie=he,k?(he=Rc(c,O),he!=null&&B.unshift(iu(c,he,ie))):k||(he=Rc(c,O),he!=null&&B.push(iu(c,he,ie)))),c=c.return}B.length!==0&&r.push({event:i,listeners:B})}var YL=/\r\n?/g,XL=/\u0000|\uFFFD/g;function Ex(r){return(typeof r=="string"?r:""+r).replace(YL,`
10
+ `).replace(XL,"")}function Rx(r,i){return i=Ex(i),Ex(r)===i}function Vt(r,i,c,m,k,O){switch(c){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||rt(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&rt(r,""+m);break;case"className":Li(r,"class",m);break;case"tabIndex":Li(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Li(r,c,m);break;case"style":rn(r,m,O);break;case"data":if(i!=="object"){Li(r,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||c!=="href")){r.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=ti(""+m),r.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(c==="formAction"?(i!=="input"&&Vt(r,i,"name",k.name,k,null),Vt(r,i,"formEncType",k.formEncType,k,null),Vt(r,i,"formMethod",k.formMethod,k,null),Vt(r,i,"formTarget",k.formTarget,k,null)):(Vt(r,i,"encType",k.encType,k,null),Vt(r,i,"method",k.method,k,null),Vt(r,i,"target",k.target,k,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=ti(""+m),r.setAttribute(c,m);break;case"onClick":m!=null&&(r.onclick=hs);break;case"onScroll":m!=null&&Rt("scroll",r);break;case"onScrollEnd":m!=null&&Rt("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(k.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}c=ti(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""+m):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":m===!0?r.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(c,m):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(c,m):r.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(c):r.setAttribute(c,m);break;case"popover":Rt("beforetoggle",r),Rt("toggle",r),Zs(r,"popover",m);break;case"xlinkActuate":kr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":kr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":kr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":kr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":kr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":kr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":kr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":kr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":kr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Zs(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Js.get(c)||c,Zs(r,c,m))}}function Og(r,i,c,m,k,O){switch(c){case"style":rn(r,m,O);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(k.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof m=="string"?rt(r,m):(typeof m=="number"||typeof m=="bigint")&&rt(r,""+m);break;case"onScroll":m!=null&&Rt("scroll",r);break;case"onScrollEnd":m!=null&&Rt("scrollend",r);break;case"onClick":m!=null&&(r.onclick=hs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!nr.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(k=c.endsWith("Capture"),i=c.slice(2,k?c.length-7:void 0),O=r[mn]||null,O=O!=null?O[c]:null,typeof O=="function"&&r.removeEventListener(i,O,k),typeof m=="function")){typeof O!="function"&&O!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(i,m,k);break e}c in r?r[c]=m:m===!0?r.setAttribute(c,""):Zs(r,c,m)}}}function Un(r,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",r),Rt("load",r);var m=!1,k=!1,O;for(O in c)if(c.hasOwnProperty(O)){var B=c[O];if(B!=null)switch(O){case"src":m=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Vt(r,i,O,B,c,null)}}k&&Vt(r,i,"srcSet",c.srcSet,c,null),m&&Vt(r,i,"src",c.src,c,null);return;case"input":Rt("invalid",r);var Z=O=B=k=null,ie=null,he=null;for(m in c)if(c.hasOwnProperty(m)){var Ce=c[m];if(Ce!=null)switch(m){case"name":k=Ce;break;case"type":B=Ce;break;case"checked":ie=Ce;break;case"defaultChecked":he=Ce;break;case"value":O=Ce;break;case"defaultValue":Z=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(s(137,i));break;default:Vt(r,i,m,Ce,c,null)}}bd(r,O,Z,ie,he,B,k,!1);return;case"select":Rt("invalid",r),m=B=O=null;for(k in c)if(c.hasOwnProperty(k)&&(Z=c[k],Z!=null))switch(k){case"value":O=Z;break;case"defaultValue":B=Z;break;case"multiple":m=Z;default:Vt(r,i,k,Z,c,null)}i=O,c=B,r.multiple=!!m,i!=null?Oi(r,!!m,i,!1):c!=null&&Oi(r,!!m,c,!0);return;case"textarea":Rt("invalid",r),O=k=m=null;for(B in c)if(c.hasOwnProperty(B)&&(Z=c[B],Z!=null))switch(B){case"value":m=Z;break;case"defaultValue":k=Z;break;case"children":O=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(91));break;default:Vt(r,i,B,Z,c,null)}Ve(r,m,k,O);return;case"option":for(ie in c)c.hasOwnProperty(ie)&&(m=c[ie],m!=null)&&(ie==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":Vt(r,i,ie,m,c,null));return;case"dialog":Rt("beforetoggle",r),Rt("toggle",r),Rt("cancel",r),Rt("close",r);break;case"iframe":case"object":Rt("load",r);break;case"video":case"audio":for(m=0;m<su.length;m++)Rt(su[m],r);break;case"image":Rt("error",r),Rt("load",r);break;case"details":Rt("toggle",r);break;case"embed":case"source":case"link":Rt("error",r),Rt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(he in c)if(c.hasOwnProperty(he)&&(m=c[he],m!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Vt(r,i,he,m,c,null)}return;default:if(vn(i)){for(Ce in c)c.hasOwnProperty(Ce)&&(m=c[Ce],m!==void 0&&Og(r,i,Ce,m,c,void 0));return}}for(Z in c)c.hasOwnProperty(Z)&&(m=c[Z],m!=null&&Vt(r,i,Z,m,c,null))}function QL(r,i,c,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,O=null,B=null,Z=null,ie=null,he=null,Ce=null;for(ye in c){var Le=c[ye];if(c.hasOwnProperty(ye)&&Le!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ie=Le;default:m.hasOwnProperty(ye)||Vt(r,i,ye,null,m,Le)}}for(var me in m){var ye=m[me];if(Le=c[me],m.hasOwnProperty(me)&&(ye!=null||Le!=null))switch(me){case"type":O=ye;break;case"name":k=ye;break;case"checked":he=ye;break;case"defaultChecked":Ce=ye;break;case"value":B=ye;break;case"defaultValue":Z=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:ye!==Le&&Vt(r,i,me,ye,m,Le)}}wc(r,B,Z,ie,he,Ce,O,k);return;case"select":ye=B=Z=me=null;for(O in c)if(ie=c[O],c.hasOwnProperty(O)&&ie!=null)switch(O){case"value":break;case"multiple":ye=ie;default:m.hasOwnProperty(O)||Vt(r,i,O,null,m,ie)}for(k in m)if(O=m[k],ie=c[k],m.hasOwnProperty(k)&&(O!=null||ie!=null))switch(k){case"value":me=O;break;case"defaultValue":Z=O;break;case"multiple":B=O;default:O!==ie&&Vt(r,i,k,O,m,ie)}i=Z,c=B,m=ye,me!=null?Oi(r,!!c,me,!1):!!m!=!!c&&(i!=null?Oi(r,!!c,i,!0):Oi(r,!!c,c?[]:"",!1));return;case"textarea":ye=me=null;for(Z in c)if(k=c[Z],c.hasOwnProperty(Z)&&k!=null&&!m.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:Vt(r,i,Z,null,m,k)}for(B in m)if(k=m[B],O=c[B],m.hasOwnProperty(B)&&(k!=null||O!=null))switch(B){case"value":me=k;break;case"defaultValue":ye=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:k!==O&&Vt(r,i,B,k,m,O)}xd(r,me,ye);return;case"option":for(var $e in c)me=c[$e],c.hasOwnProperty($e)&&me!=null&&!m.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Vt(r,i,$e,null,m,me));for(ie in m)me=m[ie],ye=c[ie],m.hasOwnProperty(ie)&&me!==ye&&(me!=null||ye!=null)&&(ie==="selected"?r.selected=me&&typeof me!="function"&&typeof me!="symbol":Vt(r,i,ie,me,m,ye));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 ut in c)me=c[ut],c.hasOwnProperty(ut)&&me!=null&&!m.hasOwnProperty(ut)&&Vt(r,i,ut,null,m,me);for(he in m)if(me=m[he],ye=c[he],m.hasOwnProperty(he)&&me!==ye&&(me!=null||ye!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,i));break;default:Vt(r,i,he,me,m,ye)}return;default:if(vn(i)){for(var Ut in c)me=c[Ut],c.hasOwnProperty(Ut)&&me!==void 0&&!m.hasOwnProperty(Ut)&&Og(r,i,Ut,void 0,m,me);for(Ce in m)me=m[Ce],ye=c[Ce],!m.hasOwnProperty(Ce)||me===ye||me===void 0&&ye===void 0||Og(r,i,Ce,me,m,ye);return}}for(var ce in c)me=c[ce],c.hasOwnProperty(ce)&&me!=null&&!m.hasOwnProperty(ce)&&Vt(r,i,ce,null,m,me);for(Le in m)me=m[Le],ye=c[Le],!m.hasOwnProperty(Le)||me===ye||me==null&&ye==null||Vt(r,i,Le,me,m,ye)}function kx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ZL(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var k=c[m],O=k.transferSize,B=k.initiatorType,Z=k.duration;if(O&&Z&&kx(B)){for(B=0,Z=k.responseEnd,m+=1;m<c.length;m++){var ie=c[m],he=ie.startTime;if(he>Z)break;var Ce=ie.transferSize,Le=ie.initiatorType;Ce&&kx(Le)&&(ie=ie.responseEnd,B+=Ce*(ie<Z?1:(Z-he)/(ie-he)))}if(--m,i+=8*(O+B)/(k.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Mg=null,Dg=null;function _f(r){return r.nodeType===9?r:r.ownerDocument}function Tx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lx(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Pg(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var jg=null;function JL(){var r=window.event;return r&&r.type==="popstate"?r===jg?!1:(jg=r,!0):(jg=null,!1)}var Ax=typeof setTimeout=="function"?setTimeout:void 0,eA=typeof clearTimeout=="function"?clearTimeout:void 0,Ox=typeof Promise=="function"?Promise:void 0,tA=typeof queueMicrotask=="function"?queueMicrotask:typeof Ox<"u"?function(r){return Ox.resolve(null).then(r).catch(nA)}:Ax;function nA(r){setTimeout(function(){throw r})}function Yi(r){return r==="head"}function Mx(r,i){var c=i,m=0;do{var k=c.nextSibling;if(r.removeChild(c),k&&k.nodeType===8)if(c=k.data,c==="/$"||c==="/&"){if(m===0){r.removeChild(k),Sl(i);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")ou(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ou(c);for(var O=c.firstChild;O;){var B=O.nextSibling,Z=O.nodeName;O[ko]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&O.rel.toLowerCase()==="stylesheet"||c.removeChild(O),O=B}}else c==="body"&&ou(r.ownerDocument.body);c=k}while(c);Sl(i)}function Dx(r,i){var c=r;r=0;do{var m=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=m}while(c)}function Ig(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ig(c),To(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function rA(r,i,c,m){for(;r.nodeType===1;){var k=c;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[ko])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(O=r.getAttribute("rel"),O==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(O!==k.rel||r.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||r.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||r.getAttribute("title")!==(k.title==null?null:k.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(O=r.getAttribute("src"),(O!==(k.src==null?null:k.src)||r.getAttribute("type")!==(k.type==null?null:k.type)||r.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&O&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var O=k.name==null?null:""+k.name;if(k.type==="hidden"&&r.getAttribute("name")===O)return r}else return r;if(r=Xr(r.nextSibling),r===null)break}return null}function sA(r,i,c){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Xr(r.nextSibling),r===null))return null;return r}function Px(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Xr(r.nextSibling),r===null))return null;return r}function Ng(r){return r.data==="$?"||r.data==="$~"}function Bg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function iA(r,i){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||c.readyState!=="loading")i();else{var m=function(){i(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function Xr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var zg=null;function jx(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(i===0)return Xr(r.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}r=r.nextSibling}return null}function Ix(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return r;i--}else c!=="/$"&&c!=="/&"||i++}r=r.previousSibling}return null}function Nx(r,i,c){switch(i=_f(c),r){case"html":if(r=i.documentElement,!r)throw Error(s(452));return r;case"head":if(r=i.head,!r)throw Error(s(453));return r;case"body":if(r=i.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function ou(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);To(r)}var Qr=new Map,Bx=new Set;function yf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var vi=Y.d;Y.d={f:oA,r:aA,D:lA,C:cA,L:uA,m:dA,X:hA,S:fA,M:pA};function oA(){var r=vi.f(),i=uf();return r||i}function aA(r){var i=ks(r);i!==null&&i.tag===5&&i.type==="form"?t1(i):vi.r(r)}var yl=typeof document>"u"?null:document;function zx(r,i,c){var m=yl;if(m&&typeof i=="string"&&i){var k=cr(i);k='link[rel="'+r+'"][href="'+k+'"]',typeof c=="string"&&(k+='[crossorigin="'+c+'"]'),Bx.has(k)||(Bx.add(k),r={rel:r,crossOrigin:c,href:i},m.querySelector(k)===null&&(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function lA(r){vi.D(r),zx("dns-prefetch",r,null)}function cA(r,i){vi.C(r,i),zx("preconnect",r,i)}function uA(r,i,c){vi.L(r,i,c);var m=yl;if(m&&r&&i){var k='link[rel="preload"][as="'+cr(i)+'"]';i==="image"&&c&&c.imageSrcSet?(k+='[imagesrcset="'+cr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(k+='[imagesizes="'+cr(c.imageSizes)+'"]')):k+='[href="'+cr(r)+'"]';var O=k;switch(i){case"style":O=bl(r);break;case"script":O=xl(r)}Qr.has(O)||(r=f({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:r,as:i},c),Qr.set(O,r),m.querySelector(k)!==null||i==="style"&&m.querySelector(au(O))||i==="script"&&m.querySelector(lu(O))||(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function dA(r,i){vi.m(r,i);var c=yl;if(c&&r){var m=i&&typeof i.as=="string"?i.as:"script",k='link[rel="modulepreload"][as="'+cr(m)+'"][href="'+cr(r)+'"]',O=k;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=xl(r)}if(!Qr.has(O)&&(r=f({rel:"modulepreload",href:r},i),Qr.set(O,r),c.querySelector(k)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(lu(O)))return}m=c.createElement("link"),Un(m,"link",r),gn(m),c.head.appendChild(m)}}}function fA(r,i,c){vi.S(r,i,c);var m=yl;if(m&&r){var k=ds(m).hoistableStyles,O=bl(r);i=i||"default";var B=k.get(O);if(!B){var Z={loading:0,preload:null};if(B=m.querySelector(au(O)))Z.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},c),(c=Qr.get(O))&&Hg(r,c);var ie=B=m.createElement("link");gn(ie),Un(ie,"link",r),ie._p=new Promise(function(he,Ce){ie.onload=he,ie.onerror=Ce}),ie.addEventListener("load",function(){Z.loading|=1}),ie.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,bf(B,i,m)}B={type:"stylesheet",instance:B,count:1,state:Z},k.set(O,B)}}}function hA(r,i){vi.X(r,i);var c=yl;if(c&&r){var m=ds(c).hoistableScripts,k=xl(r),O=m.get(k);O||(O=c.querySelector(lu(k)),O||(r=f({src:r,async:!0},i),(i=Qr.get(k))&&Fg(r,i),O=c.createElement("script"),gn(O),Un(O,"link",r),c.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(k,O))}}function pA(r,i){vi.M(r,i);var c=yl;if(c&&r){var m=ds(c).hoistableScripts,k=xl(r),O=m.get(k);O||(O=c.querySelector(lu(k)),O||(r=f({src:r,async:!0,type:"module"},i),(i=Qr.get(k))&&Fg(r,i),O=c.createElement("script"),gn(O),Un(O,"link",r),c.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(k,O))}}function Hx(r,i,c,m){var k=(k=ee.current)?yf(k):null;if(!k)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=bl(c.href),c=ds(k).hoistableStyles,m=c.get(i),m||(m={type:"style",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=bl(c.href);var O=ds(k).hoistableStyles,B=O.get(r);if(B||(k=k.ownerDocument||k,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(r,B),(O=k.querySelector(au(r)))&&!O._p&&(B.instance=O,B.state.loading=5),Qr.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Qr.set(r,c),O||mA(k,r,c,B.state))),i&&m===null)throw Error(s(528,""));return B}if(i&&m!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=xl(c),c=ds(k).hoistableScripts,m=c.get(i),m||(m={type:"script",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function bl(r){return'href="'+cr(r)+'"'}function au(r){return'link[rel="stylesheet"]['+r+"]"}function Fx(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function mA(r,i,c,m){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=r.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Un(i,"link",c),gn(i),r.head.appendChild(i))}function xl(r){return'[src="'+cr(r)+'"]'}function lu(r){return"script[async]"+r}function Vx(r,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+cr(c.href)+'"]');if(m)return i.instance=m,gn(m),m;var k=f({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),gn(m),Un(m,"style",k),bf(m,c.precedence,r),i.instance=m;case"stylesheet":k=bl(c.href);var O=r.querySelector(au(k));if(O)return i.state.loading|=4,i.instance=O,gn(O),O;m=Fx(c),(k=Qr.get(k))&&Hg(m,k),O=(r.ownerDocument||r).createElement("link"),gn(O);var B=O;return B._p=new Promise(function(Z,ie){B.onload=Z,B.onerror=ie}),Un(O,"link",m),i.state.loading|=4,bf(O,c.precedence,r),i.instance=O;case"script":return O=xl(c.src),(k=r.querySelector(lu(O)))?(i.instance=k,gn(k),k):(m=c,(k=Qr.get(O))&&(m=f({},c),Fg(m,k)),r=r.ownerDocument||r,k=r.createElement("script"),gn(k),Un(k,"link",m),r.head.appendChild(k),i.instance=k);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,bf(m,c.precedence,r));return i.instance}function bf(r,i,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=m.length?m[m.length-1]:null,O=k,B=0;B<m.length;B++){var Z=m[B];if(Z.dataset.precedence===i)O=Z;else if(O!==k)break}O?O.parentNode.insertBefore(r,O.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(r,i.firstChild))}function Hg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Fg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var xf=null;function Ux(r,i,c){if(xf===null){var m=new Map,k=xf=new Map;k.set(c,m)}else k=xf,m=k.get(c),m||(m=new Map,k.set(c,m));if(m.has(r))return m;for(m.set(r,null),c=c.getElementsByTagName(r),k=0;k<c.length;k++){var O=c[k];if(!(O[ko]||O[pn]||r==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var B=O.getAttribute(i)||"";B=r+B;var Z=m.get(B);Z?Z.push(O):m.set(B,[O])}}return m}function Wx(r,i,c){r=r.ownerDocument||r,r.head.insertBefore(c,i==="title"?r.querySelector("head > title"):null)}function gA(r,i,c){if(c===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function qx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function vA(r,i,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var k=bl(m.href),O=i.querySelector(au(k));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Sf.bind(r),i.then(r,r)),c.state.loading|=4,c.instance=O,gn(O);return}O=i.ownerDocument||i,m=Fx(m),(k=Qr.get(k))&&Hg(m,k),O=O.createElement("link"),gn(O);var B=O;B._p=new Promise(function(Z,ie){B.onload=Z,B.onerror=ie}),Un(O,"link",m),c.instance=O}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=Sf.bind(r),i.addEventListener("load",c),i.addEventListener("error",c))}}var Vg=0;function _A(r,i){return r.stylesheets&&r.count===0&&wf(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var m=setTimeout(function(){if(r.stylesheets&&wf(r,r.stylesheets),r.unsuspend){var O=r.unsuspend;r.unsuspend=null,O()}},6e4+i);0<r.imgBytes&&Vg===0&&(Vg=62500*ZL());var k=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&wf(r,r.stylesheets),r.unsuspend)){var O=r.unsuspend;r.unsuspend=null,O()}},(r.imgBytes>Vg?50:800)+i);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(k)}}:null}function Sf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Cf=null;function wf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Cf=new Map,i.forEach(yA,r),Cf=null,Sf.call(r))}function yA(r,i){if(!(i.state.loading&4)){var c=Cf.get(r);if(c)var m=c.get(null);else{c=new Map,Cf.set(r,c);for(var k=r.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<k.length;O++){var B=k[O];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(c.set(B.dataset.precedence,B),m=B)}m&&c.set(null,m)}k=i.instance,B=k.getAttribute("data-precedence"),O=c.get(B)||m,O===m&&c.set(null,k),c.set(B,k),this.count++,m=Sf.bind(this),k.addEventListener("load",m),k.addEventListener("error",m),O?O.parentNode.insertBefore(k,O.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(k,r.firstChild)),i.state.loading|=4}}var cu={$$typeof:y,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function bA(r,i,c,m,k,O,B,Z,ie){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=m,this.onUncaughtError=k,this.onCaughtError=O,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Gx(r,i,c,m,k,O,B,Z,ie,he,Ce,Le){return r=new bA(r,i,c,B,ie,he,Ce,Le,Z),i=1,O===!0&&(i|=24),O=Lr(3,null,null,i),r.current=O,O.stateNode=r,i=xm(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:c,cache:i},Em(O),r}function $x(r){return r?(r=Za,r):Za}function Kx(r,i,c,m,k,O){k=$x(k),m.context===null?m.context=k:m.pendingContext=k,m=Bi(i),m.payload={element:c},O=O===void 0?null:O,O!==null&&(m.callback=O),c=zi(r,m,i),c!==null&&(mr(c,r,i),Fc(c,r,i))}function Yx(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<i?c:i}}function Ug(r,i){Yx(r,i),(r=r.alternate)&&Yx(r,i)}function Xx(r){if(r.tag===13||r.tag===31){var i=Do(r,67108864);i!==null&&mr(i,r,67108864),Ug(r,67108864)}}function Qx(r){if(r.tag===13||r.tag===31){var i=Pr();i=Yn(i);var c=Do(r,i);c!==null&&mr(c,r,i),Ug(r,i)}}var Ef=!0;function xA(r,i,c,m){var k=V.T;V.T=null;var O=Y.p;try{Y.p=2,Wg(r,i,c,m)}finally{Y.p=O,V.T=k}}function SA(r,i,c,m){var k=V.T;V.T=null;var O=Y.p;try{Y.p=8,Wg(r,i,c,m)}finally{Y.p=O,V.T=k}}function Wg(r,i,c,m){if(Ef){var k=qg(m);if(k===null)Ag(r,i,m,Rf,c),Jx(r,m);else if(wA(k,r,i,c,m))m.stopPropagation();else if(Jx(r,m),i&4&&-1<CA.indexOf(r)){for(;k!==null;){var O=ks(k);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var B=vt(O.pendingLanes);if(B!==0){var Z=O;for(Z.pendingLanes|=2,Z.entangledLanes|=2;B;){var ie=1<<31-lt(B);Z.entanglements[1]|=ie,B&=~ie}Os(O),(jt&6)===0&&(lf=ke()+500,ru(0))}}break;case 31:case 13:Z=Do(O,2),Z!==null&&mr(Z,O,2),uf(),Ug(O,2)}if(O=qg(m),O===null&&Ag(r,i,m,Rf,c),O===k)break;k=O}k!==null&&m.stopPropagation()}else Ag(r,i,m,null,c)}}function qg(r){return r=$p(r),Gg(r)}var Rf=null;function Gg(r){if(Rf=null,r=Qs(r),r!==null){var i=u(r);if(i===null)r=null;else{var c=i.tag;if(c===13){if(r=h(i),r!==null)return r;r=null}else if(c===31){if(r=a(i),r!==null)return r;r=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Rf=r,null}function Zx(r){switch(r){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(we()){case We:return 2;case et:return 8;case xe:case Ge:return 32;case tt:return 268435456;default:return 32}default:return 32}}var $g=!1,Xi=null,Qi=null,Zi=null,uu=new Map,du=new Map,Ji=[],CA="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 Jx(r,i){switch(r){case"focusin":case"focusout":Xi=null;break;case"dragenter":case"dragleave":Qi=null;break;case"mouseover":case"mouseout":Zi=null;break;case"pointerover":case"pointerout":uu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":du.delete(i.pointerId)}}function fu(r,i,c,m,k,O){return r===null||r.nativeEvent!==O?(r={blockedOn:i,domEventName:c,eventSystemFlags:m,nativeEvent:O,targetContainers:[k]},i!==null&&(i=ks(i),i!==null&&Xx(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,k!==null&&i.indexOf(k)===-1&&i.push(k),r)}function wA(r,i,c,m,k){switch(i){case"focusin":return Xi=fu(Xi,r,i,c,m,k),!0;case"dragenter":return Qi=fu(Qi,r,i,c,m,k),!0;case"mouseover":return Zi=fu(Zi,r,i,c,m,k),!0;case"pointerover":var O=k.pointerId;return uu.set(O,fu(uu.get(O)||null,r,i,c,m,k)),!0;case"gotpointercapture":return O=k.pointerId,du.set(O,fu(du.get(O)||null,r,i,c,m,k)),!0}return!1}function eS(r){var i=Qs(r.target);if(i!==null){var c=u(i);if(c!==null){if(i=c.tag,i===13){if(i=h(c),i!==null){r.blockedOn=i,Va(r.priority,function(){Qx(c)});return}}else if(i===31){if(i=a(c),i!==null){r.blockedOn=i,Va(r.priority,function(){Qx(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function kf(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var c=qg(r.nativeEvent);if(c===null){c=r.nativeEvent;var m=new c.constructor(c.type,c);Sd=m,c.target.dispatchEvent(m),Sd=null}else return i=ks(c),i!==null&&Xx(i),r.blockedOn=c,!1;i.shift()}return!0}function tS(r,i,c){kf(r)&&c.delete(i)}function EA(){$g=!1,Xi!==null&&kf(Xi)&&(Xi=null),Qi!==null&&kf(Qi)&&(Qi=null),Zi!==null&&kf(Zi)&&(Zi=null),uu.forEach(tS),du.forEach(tS)}function Tf(r,i){r.blockedOn===i&&(r.blockedOn=null,$g||($g=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,EA)))}var Lf=null;function nS(r){Lf!==r&&(Lf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lf===r&&(Lf=null);for(var i=0;i<r.length;i+=3){var c=r[i],m=r[i+1],k=r[i+2];if(typeof m!="function"){if(Gg(m||c)===null)continue;break}var O=ks(c);O!==null&&(r.splice(i,3),i-=3,qm(O,{pending:!0,data:k,method:c.method,action:m},m,k))}}))}function Sl(r){function i(ie){return Tf(ie,r)}Xi!==null&&Tf(Xi,r),Qi!==null&&Tf(Qi,r),Zi!==null&&Tf(Zi,r),uu.forEach(i),du.forEach(i);for(var c=0;c<Ji.length;c++){var m=Ji[c];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Ji.length&&(c=Ji[0],c.blockedOn===null);)eS(c),c.blockedOn===null&&Ji.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var k=c[m],O=c[m+1],B=k[mn]||null;if(typeof O=="function")B||nS(c);else if(B){var Z=null;if(O&&O.hasAttribute("formAction")){if(k=O,B=O[mn]||null)Z=B.formAction;else if(Gg(k)!==null)continue}else Z=B.action;typeof Z=="function"?c[m+1]=Z:(c.splice(m,3),m-=3),nS(c)}}}function rS(){function r(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(B){return k=B})},focusReset:"manual",scroll:"manual"})}function i(){k!==null&&(k(),k=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,k=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),k!==null&&(k(),k=null)}}}function Kg(r){this._internalRoot=r}Af.prototype.render=Kg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=Pr();Kx(c,m,r,i,null,null)},Af.prototype.unmount=Kg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Kx(r.current,2,null,r,null,null),uf(),i[Rs]=null}};function Af(r){this._internalRoot=r}Af.prototype.unstable_scheduleHydration=function(r){if(r){var i=Es();r={blockedOn:null,target:r,priority:i};for(var c=0;c<Ji.length&&i!==0&&i<Ji[c].priority;c++);Ji.splice(c,0,r),c===0&&eS(r)}};var sS=t.version;if(sS!=="19.2.3")throw Error(s(527,sS,"19.2.3"));Y.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=d(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var RA={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Of.isDisabled&&Of.supportsFiber)try{He=Of.inject(RA),Re=Of}catch{}}return pu.createRoot=function(r,i){if(!o(r))throw Error(s(299));var c=!1,m="",k=d1,O=f1,B=h1;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(k=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(B=i.onRecoverableError)),i=Gx(r,1,!1,null,null,c,m,null,k,O,B,rS),r[Rs]=i.current,Lg(r),new Kg(i)},pu.hydrateRoot=function(r,i,c){if(!o(r))throw Error(s(299));var m=!1,k="",O=d1,B=f1,Z=h1,ie=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(k=c.identifierPrefix),c.onUncaughtError!==void 0&&(O=c.onUncaughtError),c.onCaughtError!==void 0&&(B=c.onCaughtError),c.onRecoverableError!==void 0&&(Z=c.onRecoverableError),c.formState!==void 0&&(ie=c.formState)),i=Gx(r,1,!0,i,c??null,m,k,ie,O,B,Z,rS),i.context=$x(null),c=i.current,m=Pr(),m=Yn(m),k=Bi(m),k.callback=null,zi(c,k,m),c=m,i.current.lanes=c,bt(i,c),Os(i),r[Rs]=i.current,Lg(r),new Af(i)},pu.version="19.2.3",pu}var pS;function IA(){if(pS)return Qg.exports;pS=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(),Qg.exports=jA(),Qg.exports}var NA=IA();const $v=new WeakMap,BA=new WeakMap,bh={current:[]};let tv=!1,Lu=0;const Eu=new Set,Mf=new Map;function l2(e){for(const t of e){if(bh.current.includes(t))continue;bh.current.push(t),t.recompute();const n=BA.get(t);if(n)for(const s of n){const o=$v.get(s);o?.length&&l2(o)}}}function zA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function HA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function c2(e){if(Lu>0&&!Mf.has(e)&&Mf.set(e,e.prevState),Eu.add(e),!(Lu>0)&&!tv)try{for(tv=!0;Eu.size>0;){const t=Array.from(Eu);Eu.clear();for(const n of t){const s=Mf.get(n)??n.prevState;n.prevState=s,zA(n)}for(const n of t){const s=$v.get(n);s&&(bh.current.push(n),l2(s))}for(const n of t){const s=$v.get(n);if(s)for(const o of s)HA(o)}}}finally{tv=!1,bh.current=[],Mf.clear()}}function Au(e){Lu++;try{e()}finally{if(Lu--,Lu===0){const t=Eu.values().next().value;t&&c2(t)}}}function FA(e){return typeof e=="function"}let VA=class{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var o,u;this.listeners.add(s);const h=(u=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:u.call(o,s,this);return()=>{this.listeners.delete(s),h?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):FA(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),c2(this)}};const co="__TSR_index",mS="popstate",gS="beforeunload";function UA(e){let t=e.getLocation();const n=new Set,s=h=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:h}))},o=h=>{e.notifyOnIndexChange??!0?s(h):t=e.getLocation()},u=async({task:h,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){h();return}const p=e.getBlockers?.()??[],f=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const S=xh(l.path,l.state);if(await g.blockerFn({currentLocation:t,nextLocation:S,action:l.type})){e.onBlocked?.();return}}h()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:h=>(n.add(h),()=>{n.delete(h)}),push:(h,a,l)=>{const d=t.state[co];a=vS(d+1,a),u({task:()=>{e.pushState(h,a),s({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:h,state:a})},replace:(h,a,l)=>{const d=t.state[co];a=vS(d,a),u({task:()=>{e.replaceState(h,a),s({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:h,state:a})},go:(h,a)=>{u({task:()=>{e.go(h),o({type:"GO",index:h})},navigateOpts:a,type:"GO"})},back:h=>{u({task:()=>{e.back(h?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:h,type:"BACK"})},forward:h=>{u({task:()=>{e.forward(h?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:h,type:"FORWARD"})},canGoBack:()=>t.state[co]!==0,createHref:h=>e.createHref(h),block:h=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,h]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(d=>d!==h))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function vS(e,t){t||(t={});const n=W_();return{...t,key:n,__TSR_key:n,[co]:e}}function WA(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let o=[];const u=()=>o,h=L=>o=L,a=(L=>L),l=(()=>xh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=W_();t.history.replaceState({[co]:0,key:L,__TSR_key:L},"")}let d=l(),p,f=!1,g=!1,S=!1,C=!1;const w=()=>d;let b,x;const _=()=>{b&&(M._ignoreSubscribers=!0,(b.isPush?t.history.pushState:t.history.replaceState)(b.state,"",b.href),M._ignoreSubscribers=!1,b=void 0,x=void 0,p=void 0)},y=(L,D,z)=>{const H=a(D);x||(p=d),d=xh(D,z),b={href:H,state:z,isPush:b?.isPush||L==="push"},x||(x=Promise.resolve().then(()=>_()))},E=L=>{d=l(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=l(),D=L.state[co]-d.state[co],z=D===1,H=D===-1,$=!z&&!H||f;f=!1;const N=$?"GO":H?"BACK":"FORWARD",q=$?{type:"GO",index:D}:{type:H?"BACK":"FORWARD"};if(S)S=!1;else{const K=u();if(typeof document<"u"&&K.length){for(const V of K)if(await V.blockerFn({currentLocation:d,nextLocation:L,action:N})){g=!0,t.history.go(1),M.notify(q);return}}}d=l(),M.notify(q)},A=L=>{if(C){C=!1;return}let D=!1;const z=u();if(typeof document<"u"&&z.length)for(const H of z){const $=H.enableBeforeUnload??!0;if($===!0){D=!0;break}if(typeof $=="function"&&$()===!0){D=!0;break}}if(D)return L.preventDefault(),L.returnValue=""},M=UA({getLocation:w,getLength:()=>t.history.length,pushState:(L,D)=>y("push",L,D),replaceState:(L,D)=>y("replace",L,D),back:L=>(L&&(S=!0),C=!0,t.history.back()),forward:L=>{L&&(S=!0),C=!0,t.history.forward()},go:L=>{f=!0,t.history.go(L)},createHref:L=>a(L),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(gS,A,{capture:!0}),t.removeEventListener(mS,T)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:u,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener(gS,A,{capture:!0}),t.addEventListener(mS,T),t.history.pushState=function(...L){const D=n.apply(t.history,L);return M._ignoreSubscribers||E("PUSH"),D},t.history.replaceState=function(...L){const D=s.apply(t.history,L);return M._ignoreSubscribers||E("REPLACE"),D},M}function xh(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=W_();return{href:e,pathname:e.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:e.length),hash:n>-1?e.substring(n):"",search:s>-1?e.slice(s,n===-1?void 0:n):"",state:t||{[co]:0,key:o,__TSR_key:o}}}function W_(){return(Math.random()+1).toString(36).substring(7)}function Sh(e){return e[e.length-1]}function qA(e){return typeof e=="function"}function so(e,t){return qA(e)?e(t):e}const GA=Object.prototype.hasOwnProperty;function es(e,t){if(e===t)return e;const n=t,s=bS(e)&&bS(n);if(!s&&!(Ch(e)&&Ch(n)))return n;const o=s?e:_S(e);if(!o)return n;const u=s?n:_S(n);if(!u)return n;const h=o.length,a=u.length,l=s?new Array(a):{};let d=0;for(let p=0;p<a;p++){const f=s?p:u[p],g=e[f],S=n[f];if(g===S){l[f]=g,(s?p<h:GA.call(e,f))&&d++;continue}if(g===null||S===null||typeof g!="object"||typeof S!="object"){l[f]=S;continue}const C=es(g,S);l[f]=C,C===g&&d++}return h===a&&d===h?e:l}function _S(e){const t=[],n=Object.getOwnPropertyNames(e);for(const o of n){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}const s=Object.getOwnPropertySymbols(e);for(const o of s){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}return t}function Ch(e){if(!yS(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!yS(n)||!n.hasOwnProperty("isPrototypeOf"))}function yS(e){return Object.prototype.toString.call(e)==="[object Object]"}function bS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function da(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!da(e[s],t[s],n))return!1;return!0}if(Ch(e)&&Ch(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const h in t)if((!s||t[h]!==void 0)&&!da(e[h],t[h],n))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const h in e)e[h]!==void 0&&o++;let u=0;for(const h in t)if((!s||t[h]!==void 0)&&(u++,u>o||!da(e[h],t[h],n)))return!1;return o===u}return!1}function Fl(e){let t,n;const s=new Promise((o,u)=>{t=o,n=u});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",n(o)},s}function uo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function xS(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function SS(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,o="",u;for(;(u=n.exec(e))!==null;)o+=xS(e.slice(s,u.index))+u[0],s=n.lastIndex;return o+xS(s?e.slice(s):e)}var $A="Invariant failed";function xi(e,t){if(!e)throw new Error($A)}function wh(e){const t=new Map;let n,s;const o=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,s&&(s.next=u,u.prev=s)):(u.next.prev=void 0,n=u.next,u.next=void 0,s&&(u.prev=s,s.next=u)),s=u)};return{get(u){const h=t.get(u);if(h)return o(h),h.value},set(u,h){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===s&&(s=void 0)}const a=t.get(u);if(a)a.value=h,o(a);else{const l={key:u,value:h,prev:s};s&&(s.next=l),s=l,n||(n=l),t.set(u,l)}},clear(){t.clear(),n=void 0,s=void 0}}}const Vl=0,Sa=1,Ca=2,Iu=3,KA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,YA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,XA=/^([^{]*)\{\$\}([^}]*)$/;function q_(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,u=e.substring(t,o);if(!u||!u.includes("$"))return n[0]=Vl,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(u==="$"){const d=e.length;return n[0]=Ca,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=Sa,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const h=u.match(XA);if(h){const p=h[1].length;return n[0]=Ca,n[1]=t+p,n[2]=t+p+1,n[3]=t+p+2,n[4]=t+p+3,n[5]=e.length,n}const a=u.match(YA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=Iu,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+p.length,n[4]=o-f.length,n[5]=o,n}const l=u.match(KA);if(l){const d=l[1],p=l[2],f=l[3],g=d.length;return n[0]=Sa,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+p.length,n[4]=o-f.length,n[5]=o,n}return n[0]=Vl,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function op(e,t,n,s,o,u,h){h?.(n);let a=s;{const l=n.fullPath??n.from,d=l.length,p=n.options?.caseSensitive??e;for(;a<d;){const f=q_(l,a,t);let g;const S=a,C=f[5];switch(a=C+1,u++,f[0]){case Vl:{const b=l.substring(f[2],f[3]);if(p){const x=o.static?.get(b);if(x)g=x;else{o.static??=new Map;const _=Nu(n.fullPath??n.from);_.parent=o,_.depth=u,g=_,o.static.set(b,_)}}else{const x=b.toLowerCase(),_=o.staticInsensitive?.get(x);if(_)g=_;else{o.staticInsensitive??=new Map;const y=Nu(n.fullPath??n.from);y.parent=o,y.depth=u,g=y,o.staticInsensitive.set(x,y)}}break}case Sa:{const b=l.substring(S,f[1]),x=l.substring(f[4],C),_=p&&!!(b||x),y=b?_?b:b.toLowerCase():void 0,E=x?_?x:x.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===_&&A.prefix===y&&A.suffix===E);if(T)g=T;else{const A=rv(Sa,n.fullPath??n.from,_,y,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case Iu:{const b=l.substring(S,f[1]),x=l.substring(f[4],C),_=p&&!!(b||x),y=b?_?b:b.toLowerCase():void 0,E=x?_?x:x.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===_&&A.prefix===y&&A.suffix===E);if(T)g=T;else{const A=rv(Iu,n.fullPath??n.from,_,y,E);g=A,A.parent=o,A.depth=u,o.optional??=[],o.optional.push(A)}break}case Ca:{const b=l.substring(S,f[1]),x=l.substring(f[4],C),_=p&&!!(b||x),y=b?_?b:b.toLowerCase():void 0,E=x?_?x:x.toLowerCase():void 0,T=rv(Ca,n.fullPath??n.from,_,y,E);g=T,T.parent=o,T.depth=u,o.wildcard??=[],o.wildcard.push(T)}}o=g}if((n.path||!n.children)&&!n.isRoot){const f=l.endsWith("/");f||(o.notFound=n),(!o.route||!o.isIndex&&f)&&(o.route=n,o.fullPath=n.fullPath??n.from),o.isIndex||=f}}if(n.children)for(const l of n.children)op(e,t,l,a,o,u,h)}function nv(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Jo(e){if(e.static)for(const t of e.static.values())Jo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Jo(t);if(e.dynamic?.length){e.dynamic.sort(nv);for(const t of e.dynamic)Jo(t)}if(e.optional?.length){e.optional.sort(nv);for(const t of e.optional)Jo(t)}if(e.wildcard?.length){e.wildcard.sort(nv);for(const t of e.wildcard)Jo(t)}}function Nu(e){return{kind:Vl,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function rv(e,t,n,s,o){return{kind:e,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null,caseSensitive:n,prefix:s,suffix:o}}function QA(e,t){const n=Nu("/"),s=new Uint16Array(6);for(const o of e)op(!1,s,o,1,n,0);Jo(n),t.masksTree=n,t.flatCache=wh(1e3)}function ZA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=G_(e,t.masksTree);return t.flatCache.set(e,s),s}function JA(e,t,n,s,o){e||="/",s||="/";const u=t?`case\0${e}`:e;let h=o.singleCache.get(u);if(!h){h=Nu("/");const a=new Uint16Array(6);op(t,a,{from:e},1,h,0),o.singleCache.set(u,h)}return G_(s,h,n)}function e3(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";const u=G_(e,t.segmentTree,n);return u&&(u.branch=s3(u.route)),t.matchCache.set(s,u),u}function t3(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function n3(e,t=!1,n){const s=Nu(e.fullPath),o=new Uint16Array(6),u={},h={};let a=0;return op(t,o,e,1,s,0,d=>{if(n?.(d,a),xi(!(d.id in u),`Duplicate routes found with id: ${String(d.id)}`),u[d.id]=d,a!==0&&d.path){const p=t3(d.fullPath);(!h[p]||d.fullPath.endsWith("/"))&&(h[p]=d)}a++}),Jo(s),{processedTree:{segmentTree:s,singleCache:wh(1e3),matchCache:wh(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:h}}function G_(e,t,n=!1){const s=e.split("/"),o=o3(e,s,t,n);if(!o)return null;const u=r3(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function r3(e,t,n){const s=i3(n.node);let o=null;const u={};for(let h=0,a=0,l=0;a<s.length;h++,a++,l++){const d=s[a],p=t[h],f=l;if(p&&(l+=p.length),d.kind===Sa){o??=n.node.fullPath.split("/");const g=o[a],S=d.prefix?.length??0;if(g.charCodeAt(S)===123){const w=d.suffix?.length??0,b=g.substring(S+2,g.length-w-1),x=p.substring(S,p.length-w);u[b]=decodeURIComponent(x)}else{const w=g.substring(1);u[w]=decodeURIComponent(p)}}else if(d.kind===Iu){if(n.skipped&1<<a){h--;continue}o??=n.node.fullPath.split("/");const g=o[a],S=d.prefix?.length??0,C=d.suffix?.length??0,w=g.substring(S+3,g.length-C-1),b=d.suffix||d.prefix?p.substring(S,p.length-C):p;b&&(u[w]=decodeURIComponent(b))}else if(d.kind===Ca){const g=d,S=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),C=decodeURIComponent(S);u["*"]=C,u._splat=C;break}}return u}function s3(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function i3(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function o3(e,t,n,s){const o=!Sh(t),u=o&&e!=="/",h=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,d=null,p=null;for(;a.length;){const f=a.pop();let{node:g,index:S,skipped:C,depth:w,statics:b,dynamics:x,optionals:_}=f;s&&g.notFound&&Df(d,f)&&(d=f);const y=S===h;if(y){if(g.route&&(!u||g.isIndex)&&(Df(p,f)&&(p=f),b===h&&g.isIndex))return p;if(!g.optional&&!g.wildcard)continue}const E=y?void 0:t[S];let T;if(g.wildcard&&Df(l,f))for(const A of g.wildcard){const{prefix:M,suffix:L}=A;if(!(M&&(y||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(y)continue;const D=t.slice(S).join("/").slice(-L.length);if((A.caseSensitive?D:D.toLowerCase())!==L)continue}l={node:A,index:S,skipped:C,depth:w,statics:b,dynamics:x,optionals:_};break}}if(g.optional){const A=C|1<<w,M=w+1;for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L];a.push({node:D,index:S,skipped:A,depth:M,statics:b,dynamics:x,optionals:_})}if(!y)for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L],{prefix:z,suffix:H}=D;if(z||H){const $=D.caseSensitive?E:T??=E.toLowerCase();if(z&&!$.startsWith(z)||H&&!$.endsWith(H))continue}a.push({node:D,index:S+1,skipped:C,depth:M,statics:b,dynamics:x,optionals:_+1})}}if(!y&&g.dynamic&&E)for(let A=g.dynamic.length-1;A>=0;A--){const M=g.dynamic[A],{prefix:L,suffix:D}=M;if(L||D){const z=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!z.startsWith(L)||D&&!z.endsWith(D))continue}a.push({node:M,index:S+1,skipped:C,depth:w+1,statics:b,dynamics:x+1,optionals:_})}if(!y&&g.staticInsensitive){const A=g.staticInsensitive.get(T??=E.toLowerCase());A&&a.push({node:A,index:S+1,skipped:C,depth:w+1,statics:b+1,dynamics:x,optionals:_})}if(!y&&g.static){const A=g.static.get(E);A&&a.push({node:A,index:S+1,skipped:C,depth:w+1,statics:b+1,dynamics:x,optionals:_})}}if(p&&l)return Df(l,p)?p:l;if(p)return p;if(l)return l;if(s&&d){let f=d.index;for(let S=0;S<d.index;S++)f+=t[S].length;const g=f===e.length?"/":e.slice(f);return{node:d.node,skipped:d.skipped,"**":decodeURIComponent(g)}}return null}function Df(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&(t.node.isIndex>e.node.isIndex||t.node.isIndex===e.node.isIndex&&t.depth>e.depth))):!0}function fh(e){return $_(e.filter(t=>t!==void 0).join("/"))}function $_(e){return e.replace(/\/{2,}/g,"/")}function u2(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function fa(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function d2(e){return fa(u2(e))}function Eh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function a3(e,t,n){return Eh(e,n)===Eh(t,n)}function l3({base:e,to:t,trailingSlash:n="never",cache:s}){const o=t.startsWith("/"),u=!o&&t===".";let h;if(s){h=o?t:u?e:e+"\0"+t;const f=s.get(h);if(f)return f}let a;if(u)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&Sh(a)==="";)a.pop();const f=t.split("/");for(let g=0,S=f.length;g<S;g++){const C=f[g];C===""?g?g===S-1&&a.push(C):a=[C]:C===".."?a.pop():C==="."||a.push(C)}}a.length>1&&(Sh(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,d="";for(let f=0;f<a.length;f++){f>0&&(d+="/");const g=a[f];if(!g)continue;l=q_(g,0,l);const S=l[0];if(S===Vl){d+=g;continue}const C=l[5],w=g.substring(0,l[1]),b=g.substring(l[4],C),x=g.substring(l[2],l[3]);S===Sa?d+=w||b?`${w}{$${x}}${b}`:`$${x}`:S===Ca?d+=w||b?`${w}{$}${b}`:"$":d+=`${w}{-$${x}}${b}`}d=$_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function sv(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):c3(s,n)}function iv({path:e,params:t,decodeCharMap:n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const u=e.length;let h=0,a,l="";for(;h<u;){const p=h;a=q_(e,p,a);const f=a[5];if(h=f+1,p===f)continue;const g=a[0];if(g===Vl){l+="/"+e.substring(p,f);continue}if(g===Ca){const S=t._splat;o._splat=S,o["*"]=S;const C=e.substring(p,a[1]),w=e.substring(a[4],f);if(!S){s=!0,(C||w)&&(l+="/"+C+w);continue}const b=sv("_splat",t,n);l+="/"+C+b+w;continue}if(g===Sa){const S=e.substring(a[2],a[3]);!s&&!(S in t)&&(s=!0),o[S]=t[S];const C=e.substring(p,a[1]),w=e.substring(a[4],f),b=sv(S,t,n)??"undefined";l+="/"+C+b+w;continue}if(g===Iu){const S=e.substring(a[2],a[3]),C=t[S];if(C==null)continue;o[S]=C;const w=e.substring(p,a[1]),b=e.substring(a[4],f),x=sv(S,t,n)??"";l+="/"+w+x+b;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function c3(e,t){let n=encodeURIComponent(e);if(t)for(const[s,o]of t)n=n.replaceAll(s,o);return n}function is(e){return!!e?.isNotFound}function u3(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Rh="tsr-scroll-restoration-v1_3",d3=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function f3(){const e=u3();if(!e)return null;const t=e.getItem(Rh);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=so(s,n)||n,e.setItem(Rh,JSON.stringify(n)))}}const Pf=f3(),Kv=e=>e.state.__TSR_key||e.href;function h3(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let kh=!1;function f2({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:o,location:u}){let h;try{h=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(d){console.error(d);return}const a=t||window.history.state?.__TSR_key,l=h[a];kh=!0;e:{if(s&&l&&Object.keys(l).length>0){for(const f in l){const g=l[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const S=document.querySelector(f);S&&(S.scrollLeft=g.scrollX,S.scrollTop=g.scrollY)}}break e}const d=(u??window.location).hash.split("#",2)[1];if(d){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const g=document.getElementById(d);g&&g.scrollIntoView(f)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),o)for(const f of o){if(f==="window")continue;const g=typeof f=="function"?f():document.querySelector(f);g&&g.scrollTo(p)}}kh=!1}function p3(e,t){if(!Pf&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Pf))return;e.isScrollRestorationSetup=!0,kh=!1;const s=e.options.getScrollRestorationKey||Kv;window.history.scrollRestoration="manual";const o=u=>{if(kh||!e.isScrollRestoring)return;let h="";if(u.target===document||u.target===window)h="window";else{const l=u.target.getAttribute("data-scroll-restoration-id");l?h=`[data-scroll-restoration-id="${l}"]`:h=h3(u.target)}const a=s(e.state.location);Pf.set(l=>{const d=l[a]||={},p=d[h]||={};if(h==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(h){const f=document.querySelector(h);f&&(p.scrollX=f.scrollLeft||0,p.scrollY=f.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",d3(o,100),!0),e.subscribe("onRendered",u=>{const h=s(u.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(f2({storageKey:Rh,key:h,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Pf.set(a=>(a[h]||={},a)))})}function m3(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function g3(e,t=String){const n=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&n.set(s,t(o))}return n.toString()}function ov(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function v3(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=ov(o):Array.isArray(u)?u.push(ov(o)):n[s]=[u,ov(o)]}return n}const _3=b3(JSON.parse),y3=x3(JSON.stringify,JSON.parse);function b3(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=v3(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function x3(e,t){const n=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const u=g3(o,s);return u?`?${u}`:""}}const Ir="__root__";function h2(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function bs(e){return e instanceof Response&&!!e.options}const hh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ap=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),K_=(e,t,n=!0)=>{const s={...e.router.options.context??{}},o=n?t:t-1;for(let u=0;u<=o;u++){const h=e.matches[u];if(!h)continue;const a=e.router.getMatch(h.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},p2=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),xi(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);xi(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,p2(e,t))},io=(e,t,n)=>{if(!(!bs(n)&&!is(n))){if(bs(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=bs(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,isFetching:!1,error:n})),is(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw bs(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(p2(e,n),n)}},m2=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},mu=(e,t,n,s)=>{const{id:o,routeId:u}=e.matches[t],h=e.router.looseRoutesById[u];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,io(e,e.router.getMatch(o),n);try{h.options.onError?.(n)}catch(a){n=a,io(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},S3=(e,t,n,s)=>{const o=e.router.getMatch(t),u=e.matches[n-1]?.id,h=u?e.router.getMatch(u):void 0;if(e.router.isShell()){o.ssr=s.id===Ir;return}if(h?.ssr===!1){o.ssr=!1;return}const a=S=>S===!0&&h?.ssr==="data-only"?"data-only":S,l=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(l);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:d,params:p}=o,f={search:jf(d,o.searchError),params:jf(p,o.paramsError),location:e.location,matches:e.matches.map(S=>({index:S.index,pathname:S.pathname,fullPath:S.fullPath,staticData:S.staticData,id:S.id,routeId:S.routeId,search:jf(S.search,S.searchError),params:jf(S.params,S.paramsError),ssr:S.ssr}))},g=s.options.ssr(f);if(uo(g))return g.then(S=>{o.ssr=a(S??l)});o.ssr=a(g??l)},g2=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!ap(e,t)&&(n.options.loader||n.options.beforeLoad||y2(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{hh(e)},o);s._nonReactive.pendingTimeout=h}},C3=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;g2(e,t,n,s);const o=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&io(e,u,u.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},w3=(e,t,n,s)=>{const o=e.router.getMatch(t),u=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Fl(()=>{u?.resolve()});const{paramsError:h,searchError:a}=o;h&&mu(e,n,h,"PARSE_PARAMS"),a&&mu(e,n,a,"VALIDATE_SEARCH"),g2(e,t,s,o);const l=new AbortController,d=e.matches[n-1]?.id;(d?e.router.getMatch(d):void 0)?.context??e.router.options.context;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:l})))},S=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!s.options.beforeLoad){Au(()=>{g(),S()});return}o._nonReactive.beforeLoadPromise=Fl();const C={...K_(e,n,!1),...o.__routeContext},{search:w,params:b,cause:x}=o,_=ap(e,t),y={search:w,abortController:l,params:b,preload:_,context:C,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?"preload":x,matches:e.matches,...e.router.options.additionalContext},E=A=>{if(A===void 0){Au(()=>{g(),S()});return}(bs(A)||is(A))&&(g(),mu(e,n,A,"BEFORE_LOAD")),Au(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:A})),S()})};let T;try{if(T=s.options.beforeLoad(y),uo(T))return g(),T.catch(A=>{mu(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){g(),mu(e,n,A,"BEFORE_LOAD")}E(T)},E3=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const l=S3(e,n,t,o);if(uo(l))return l.then(a)}return a()},h=()=>w3(e,n,t,o),a=()=>{if(m2(e,n))return;const l=C3(e,n,o);return uo(l)?l.then(h):h()};return u()},Ou=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([u,h,a])=>{const l=u?.meta,d=u?.links,p=u?.scripts,f=u?.styles;return{meta:l,links:d,headScripts:p,headers:a,scripts:h,styles:f}})},v2=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:l}=e.router.getMatch(t),d=K_(e,n),p=ap(e,t);return{params:u,deps:h,preload:!!p,parentMatchPromise:o,abortController:a,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:p?"preload":l,route:s,...e.router.options.additionalContext}},CS=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!e.router.isServer||o.ssr===!0)&&_2(s);const u=s.options.loader?.(v2(e,t,n,s)),h=s.options.loader&&uo(u);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,f=>({...f,isFetching:"loader"})),s.options.loader){const f=h?await u:u;io(e,e.router.getMatch(t),f),f!==void 0&&e.updateMatch(t,g=>({...g,loaderData:f}))}s._lazyPromise&&await s._lazyPromise;const l=Ou(e,t,s),d=l?await l:void 0,p=o._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,f=>({...f,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...d}))}catch(u){let h=u;const a=o._nonReactive.minPendingPromise;a&&await a,is(u)&&await s.options.notFoundComponent?.preload?.(),io(e,e.router.getMatch(t),u);try{s.options.onError?.(u)}catch(p){h=p,io(e,e.router.getMatch(t),p)}const l=Ou(e,t,s),d=l?await l:void 0;e.updateMatch(t,p=>({...p,error:h,status:"error",isFetching:!1,...d}))}}catch(o){const u=e.router.getMatch(t);if(u){const h=Ou(e,t,s);if(h){const a=await h;e.updateMatch(t,l=>({...l,...a}))}u._nonReactive.loaderPromise=void 0}io(e,u,o)}},R3=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let o=!1,u=!1;const h=e.router.looseRoutesById[s],a=()=>{e.updateMatch(n,p=>({...p,context:K_(e,t)}))};if(m2(e,n)){if(e.router.isServer){const p=Ou(e,n,h);if(p){const f=await p;e.updateMatch(n,g=>({...g,...f}))}return e.router.getMatch(n)}}else{const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const f=e.router.getMatch(n),g=f._nonReactive.error||f.error;g&&io(e,f,g)}else{const f=Date.now()-p.updatedAt,g=ap(e,n),S=g?h.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:h.options.staleTime??e.router.options.defaultStaleTime??0,C=h.options.shouldReload,w=typeof C=="function"?C(v2(e,n,t,h)):C,b=!!g&&!e.router.state.matches.some(E=>E.id===n),x=e.router.getMatch(n);x._nonReactive.loaderPromise=Fl(),b!==x.preload&&e.updateMatch(n,E=>({...E,preload:b}));const{status:_,invalid:y}=x;if(o=_==="success"&&(y||(w??f>S)),!(g&&h.options.preload===!1))if(o&&!e.sync)u=!0,(async()=>{try{await CS(e,n,t,h),a();const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){bs(E)&&await e.router.navigate(E.options)}})();else if(_!=="success"||o&&e.sync)await CS(e,n,t,h);else{const E=Ou(e,n,h);if(E){const T=await E;e.updateMatch(n,A=>({...A,...T}))}}}}const l=e.router.getMatch(n);u||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,u||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0,u||a();const d=u?l.isFetching:!1;return d!==l.isFetching||l.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:d,invalid:!1})),e.router.getMatch(n)):l};async function wS(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&hh(t);try{for(let o=0;o<t.matches.length;o++){const u=E3(t,o);uo(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(R3(t,o));await Promise.all(t.matchPromises);const s=hh(t);uo(s)&&await s}catch(n){if(is(n)&&!t.preload){const s=hh(t);throw uo(s)&&await s,n}if(bs(n))throw n}return t.matches}async function _2(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of b2){const o=e.options[s]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function jf(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function y2(e){for(const t of b2)if(e.options[t]?.preload)return!0;return!1}const b2=["component","errorComponent","pendingComponent","notFoundComponent"];function k3(e){return{input:({url:t})=>{for(const n of e)t=x2(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=S2(e[n],t);return t}}}function T3(e){const t=d2(e.basepath),n=`/${t}`,s=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),u=e.caseSensitive?s:s.toLowerCase();return{input:({url:h})=>{const a=e.caseSensitive?h.pathname:h.pathname.toLowerCase();return a===o?h.pathname="/":a.startsWith(u)&&(h.pathname=h.pathname.slice(n.length)),h},output:({url:h})=>(h.pathname=fh(["/",t,h.pathname]),h)}}function x2(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function S2(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ha(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,o=t?.href!==n.href,u=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:o,hashChanged:u}}class L3{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,o=this.basepath??s?.basepath??"/",u=this.basepath===void 0,h=s?.rewrite;this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=WA())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new VA(O3(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),p3(this));let a=!1;const l=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==l||h!==d){this.basepath=l;const g=[];d2(l)!==""&&g.push(T3({basepath:l})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:k3(g),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:s,processedTree:o}=n3(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&QA(this.options.routeMasks,o),this.routesById=n,this.routesByPath=s,this.processedTree=o;const u=this.options.notFoundRoute;u&&(u.init({originalIndex:99999999999}),this.routesById[u.id]=u)},this.subscribe=(n,s)=>{const o={eventType:n,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const o=({href:l,state:d})=>{const p=new URL(l,this.origin),f=x2(this.rewrite,p),g=this.options.parseSearch(f.search),S=this.options.stringifySearch(g);return f.search=S,{href:f.href.replace(f.origin,""),publicHref:l,url:f,pathname:SS(f.pathname),searchStr:S,search:es(s?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:es(s?.state,d)}},u=o(n),{__tempLocation:h,__tempKey:a}=u.state;if(h&&(!a||a===this.tempLocationKey)){const l=o(h);return l.state.key=u.state.key,l.state.__TSR_key=u.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:u}}return u},this.resolvePathCache=wh(1e3),this.resolvePathWithBase=(n,s)=>l3({base:n,to:$_(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},o):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>M3({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(u=>u.status==="pending"),s=this.state.matches.filter(u=>u.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(u=>{this.cancelMatch(u.id)})},this.buildLocation=n=>{const s=(u={})=>{const h=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(h,{_buildLocation:!0}),l=Sh(a);u.from;const d=u.unsafeRelative==="path"?h.pathname:u.from??l.fullPath,p=this.resolvePathWithBase(d,"."),f=l.search,g={...l.params},S=u.to?this.resolvePathWithBase(p,`${u.to}`):this.resolvePathWithBase(p,"."),C=u.params===!1||u.params===null?{}:(u.params??!0)===!0?g:Object.assign(g,so(u.params,g)),w=iv({path:S,params:C}).interpolatedPath,b=this.matchRoutes(w,void 0,{_buildLocation:!0}).map(z=>this.looseRoutesById[z.routeId]);if(Object.keys(C).length>0)for(const z of b){const H=z.options.params?.stringify??z.options.stringifyParams;H&&Object.assign(C,H(C))}const x=n.leaveParams?S:SS(iv({path:S,params:C,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let _=f;if(n._includeValidateSearch&&this.options.search?.strict){const z={};b.forEach(H=>{if(H.options.validateSearch)try{Object.assign(z,Yv(H.options.validateSearch,{...z,..._}))}catch{}}),_=z}_=D3({search:_,dest:u,destRoutes:b,_includeValidateSearch:n._includeValidateSearch}),_=es(f,_);const y=this.options.stringifySearch(_),E=u.hash===!0?h.hash:u.hash?so(u.hash,h.hash):void 0,T=E?`#${E}`:"";let A=u.state===!0?h.state:u.state?so(u.state,h.state):{};A=es(h.state,A);const M=`${x}${y}${T}`,L=new URL(M,this.origin),D=S2(this.rewrite,L);return{publicHref:D.pathname+D.search+D.hash,href:M,url:D,pathname:x,search:_,searchStr:y,state:A,hash:E??"",unmaskOnReload:u.unmaskOnReload}},o=(u={},h)=>{const a=s(u);let l=h?s(h):void 0;if(!l){const d={};if(this.options.routeMasks){const p=ZA(a.pathname,this.processedTree);if(p){Object.assign(d,p.params);const{from:f,params:g,...S}=p.route,C=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,so(g,d));h={from:n.from,...S,params:C},l=s(h)}}}return l&&(a.maskedLocation=l),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:s,...o})=>{const u=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const d=da(o.state,this.latestLocation.state);return l.forEach(p=>{delete o.state[p]}),d},h=fa(this.latestLocation.href)===fa(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Fl(()=>{a?.resolve()}),h&&u())this.load();else{let{maskedLocation:l,hashScrollIntoView:d,url:p,...f}=o;l&&(f={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:o,viewTransition:u,ignoreBlocker:h,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,g=xh(a,{__TSR_index:n?f:f+1});l.to=g.pathname,l.search=this.options.parseSearch(g.search),l.hash=g.hash.slice(1)}const d=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:u,replace:n,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:h});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:s,href:o,...u})=>{if(!s&&o)try{new URL(`${o}`),s=!0}catch{}if(s){if(o||(o=this.buildLocation({to:n,...u}).url.href),!u.ignoreBlocker){const a=this.history.getBlockers?.()??[];for(const l of a)if(l?.blockerFn&&await l.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(o):window.location.href=o,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const o=this.getParsedLocationHref(s);throw h2({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(o=>!n.some(u=>u.id===o.id))}))},this.load=async n=>{let s,o,u;for(u=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ha({resolvedLocation:d,location:l})}),this.emit({type:"onBeforeLoad",...ha({resolvedLocation:d,location:l})}),await wS({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];Au(()=>{this.__store.setState(S=>{const C=S.matches,w=S.pendingMatches||S.matches;return p=C.filter(b=>!w.some(x=>x.id===b.id)),f=w.filter(b=>!C.some(x=>x.id===b.id)),g=w.filter(b=>C.some(x=>x.id===b.id)),{...S,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(b=>b.status!=="error"&&b.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([S,C])=>{S.forEach(w=>{this.looseRoutesById[w.routeId].options[C]?.(w)})})})})}})}catch(l){bs(l)?(s=l,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):is(l)&&(o=l),this.__store.setState(d=>({...d,statusCode:s?s.status:o?404:d.matches.some(p=>p.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===u&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=u,await u;this.latestLoadPromise&&u!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.__store.state.matches.some(a=>a.status==="error")&&(h=500),h!==void 0&&this.__store.setState(a=>({...a,statusCode:h}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,h=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(ha({resolvedLocation:h,location:u})):s.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(u=>u.id===n)?"pendingMatches":this.state.matches.some(u=>u.id===n)?"matches":this.state.cachedMatches.some(u=>u.id===n)?"cachedMatches":"";o&&this.__store.setState(u=>({...u,[o]:u[o]?.map(h=>h.id===n?s(h):h)}))})},this.getMatch=n=>{const s=o=>o.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let s=n.url.href;return this.origin&&n.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=n=>{if(!n.options.href){const s=this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=s.href,n.headers.set("Location",o)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(u=>!s(u))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const u=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=u};this.clearCache({filter:n})},this.loadRouteChunk=_2,this.preloadRoute=async n=>{const s=this.buildLocation(n);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const u=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),h=new Set([...u,...this.state.cachedMatches.map(a=>a.id)]);Au(()=>{o.forEach(a=>{h.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return o=await wS({router:this,matches:o,location:s,preload:!0,updateMatch:(a,l)=>{u.has(a)?o=o.map(d=>d.id===a?l(d):d):this.updateMatch(a,l)}}),o}catch(a){if(bs(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});is(a)||console.error(a);return}},this.matchRoute=(n,s)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},u=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=JA(u.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!l||n.params&&!da(l.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?da(a.search,u.search,{partial:!0})?l.params:!1:l.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??y3,parseSearch:t.parseSearch??_3}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:u}=s;let{matchedRoutes:h}=s,a=!1;(o?o.path!=="/"&&u["**"]:fa(t.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let f=h.length-1;f>=0;f--){const g=h[f];if(g.children)return g.id}return Ir}})(),d=[],p=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((f,g)=>{const S=d[g-1],[C,w,b]=(()=>{const N=S?.search??t.search,q=S?._strictSearch??void 0;try{const K=Yv(f.options.validateSearch,{...N})??void 0;return[{...N,...K},{...q,...K},void 0]}catch(K){let V=K;if(K instanceof Th||(V=new Th(K.message,{cause:K})),n?.throwOnError)throw V;return[N,{},V]}})(),x=f.options.loaderDeps?.({search:C})??"",_=x?JSON.stringify(x):"",{interpolatedPath:y,usedParams:E}=iv({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+y+_,A=this.getMatch(T),M=this.state.matches.find(N=>N.routeId===f.id),L=A?._strictParams??E;let D;if(!A){const N=f.options.params?.parse??f.options.parseParams;if(N)try{Object.assign(L,N(L))}catch(q){if(is(q)||bs(q)?D=q:D=new A3(q.message,{cause:q}),n?.throwOnError)throw D}}Object.assign(u,L);const z=M?"stay":"enter";let H;if(A)H={...A,cause:z,params:M?es(M.params,u):u,_strictParams:L,search:es(M?M.search:A.search,C),_strictSearch:w};else{const N=f.options.loader||f.options.beforeLoad||f.lazyFn||y2(f)?"pending":"success";H={id:T,ssr:this.isServer?void 0:f.options.ssr,index:g,routeId:f.id,params:M?es(M.params,u):u,_strictParams:L,pathname:y,updatedAt:Date.now(),search:M?es(M.search,C):C,_strictSearch:w,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Fl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:z,loaderDeps:M?es(M.loaderDeps,x):x,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(H.globalNotFound=l===f.id),H.searchError=b;const $=p(S);H.context={...$,...H.__routeContext,...H.__beforeLoadContext},d.push(H)}),d.forEach((f,g)=>{const S=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)&&n?._buildLocation!==!0){const w=d[g-1],b=p(w);if(S.options.context){const x={deps:f.loaderDeps,params:f.params,context:b??{},location:t,navigate:_=>this.navigate({..._,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:d};f.__routeContext=S.options.context(x)??void 0}f.context={...b,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class Th extends Error{}class A3 extends Error{}function O3(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Yv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Th("Async validation not supported");if(n.issues)throw new Th(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function M3({pathname:e,routesById:t,processedTree:n}){const s={},o=fa(e);let u;const h=e3(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Ir]],routeParams:s,foundRoute:u}}function D3({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){const o=n.reduce((a,l)=>{const d=[];if("search"in l.options)l.options.search?.middlewares&&d.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const p=({search:f,next:g})=>{let S=f;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(S=l.options.preSearchFilters.reduce((w,b)=>b(w),f));const C=g(S);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((w,b)=>b(w),C):C};d.push(p)}if(s&&l.options.validateSearch){const p=({search:f,next:g})=>{const S=g(f);try{return{...S,...Yv(l.options.validateSearch,S)??void 0}}catch{return S}};d.push(p)}return a.concat(d)},[])??[],u=({search:a})=>t.search?t.search===!0?a:so(t.search,a):{};o.push(u);const h=(a,l)=>{if(a>=o.length)return l;const d=o[a];return d({search:l,next:f=>h(a+1,f)})};return h(0,e)}const P3="Error preloading route! ☝️";class C2{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Ir:this.parentRoute||xi(!1);let u=o?Ir:s?.path;u&&u!=="/"&&(u=u2(u));const h=s?.id||u;let a=o?Ir:fh([this.parentRoute.id===Ir?"":this.parentRoute.id,h]);u===Ir&&(u="/"),a!==Ir&&(a=fh(["/",a]));const l=a===Ir?"/":fh([this.parentRoute.fullPath,u]);this._path=u,this._id=a,this._fullPath=l,this._to=l},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class j3 extends C2{constructor(t){super(t)}}function Y_(e){const t=e.errorComponent??lp;return v.jsx(I3,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?R.createElement(t,{error:n,reset:s}):e.children})}class I3 extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function lp({error:e}){const[t,n]=R.useState(!1);return v.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[v.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),v.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),v.jsx("div",{style:{height:".25rem"}}),t?v.jsx("div",{children:v.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?v.jsx("code",{children:e.message}):null})}):null]})}function N3({children:e,fallback:t=null}){return B3()?v.jsx(ze.Fragment,{children:e}):v.jsx(ze.Fragment,{children:t})}function B3(){return ze.useSyncExternalStore(z3,()=>!0,()=>!1)}function z3(){return()=>{}}var av={exports:{}},lv={},cv={exports:{}},uv={};var ES;function H3(){if(ES)return uv;ES=1;var e=ed();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,h=e.useDebugValue;function a(f,g){var S=g(),C=s({inst:{value:S,getSnapshot:g}}),w=C[0].inst,b=C[1];return u(function(){w.value=S,w.getSnapshot=g,l(w)&&b({inst:w})},[f,S,g]),o(function(){return l(w)&&b({inst:w}),f(function(){l(w)&&b({inst:w})})},[f]),h(S),S}function l(f){var g=f.getSnapshot;f=f.value;try{var S=g();return!n(f,S)}catch{return!0}}function d(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return uv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,uv}var RS;function w2(){return RS||(RS=1,cv.exports=H3()),cv.exports}var kS;function F3(){if(kS)return lv;kS=1;var e=ed(),t=w2();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,u=e.useRef,h=e.useEffect,a=e.useMemo,l=e.useDebugValue;return lv.useSyncExternalStoreWithSelector=function(d,p,f,g,S){var C=u(null);if(C.current===null){var w={hasValue:!1,value:null};C.current=w}else w=C.current;C=a(function(){function x(A){if(!_){if(_=!0,y=A,A=g(A),S!==void 0&&w.hasValue){var M=w.value;if(S(M,A))return E=M}return E=A}if(M=E,s(y,A))return M;var L=g(A);return S!==void 0&&S(M,L)?(y=A,M):(y=A,E=L)}var _=!1,y,E,T=f===void 0?null:f;return[function(){return x(p())},T===null?void 0:function(){return x(T())}]},[p,f,g,S]);var b=o(d,C[0],C[1]);return h(function(){w.hasValue=!0,w.value=b},[b]),l(b),b},lv}var TS;function V3(){return TS||(TS=1,av.exports=F3()),av.exports}var E2=V3();function U3(e,t=s=>s,n={}){const s=n.equal??W3;return E2.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function W3(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!t.has(s)||!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=LS(e);if(n.length!==LS(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function LS(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const dv=R.createContext(null);function R2(){return typeof document>"u"?dv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=dv,dv)}function Vr(e){const t=R.useContext(R2());return e?.warn,t}function Jn(e){const t=Vr({warn:e?.router===void 0}),n=e?.router||t,s=R.useRef(void 0);return U3(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const u=es(s.current,e.select(o));return s.current=u,u}return e.select(o)}return o})}const cp=R.createContext(void 0),q3=R.createContext(void 0);function Vs(e){const t=R.useContext(e.from?q3:cp);return Jn({select:s=>{const o=s.matches.find(u=>e.from?e.from===u.routeId:u.id===t);if(xi(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function X_(e){return Vs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Q_(e){const{select:t,...n}=e;return Vs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Z_(e){return Vs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function J_(e){return Vs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const If=typeof window<"u"?R.useLayoutEffect:R.useEffect;function fv(e){const t=R.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function G3(e,t,n={},s={}){R.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([u])=>{t(u)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,s.disabled,e])}function $3(e){const t=R.useRef(null);return R.useImperativeHandle(e,()=>t.current,[]),t}function yo(e){const t=Vr();return R.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var er=a2();const K3=o2(er);function Y3(e,t){const n=Vr(),[s,o]=R.useState(!1),u=R.useRef(!1),h=$3(t),{activeProps:a,inactiveProps:l,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:S,replace:C,startTransition:w,resetScroll:b,viewTransition:x,children:_,target:y,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:D,onMouseLeave:z,onTouchStart:H,ignoreBlocker:$,params:N,search:q,hash:K,state:V,mask:Y,reloadDocument:G,unsafeRelative:j,from:W,_fromLocation:P,...I}=e,F=Jn({select:pe=>pe.location.search,structuralSharing:!0}),X=e.from,te=R.useMemo(()=>({...e,from:X}),[n,F,X,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=R.useMemo(()=>n.buildLocation({...te}),[n,te]),Q=R.useMemo(()=>{if(E)return;let pe=ee.maskedLocation?ee.maskedLocation.url.href:ee.url.href,ke=!1;return n.origin&&(pe.startsWith(n.origin)?pe=n.history.createHref(pe.replace(n.origin,""))||"/":ke=!0),{href:pe,external:ke}},[E,ee.maskedLocation,ee.url,n.origin,n.history]),U=R.useMemo(()=>{if(Q?.external)return Q.href;try{return new URL(p),p}catch{}},[p,Q]),se=e.reloadDocument||U?!1:f??n.options.defaultPreload,ne=g??n.options.defaultPreloadDelay??0,re=Jn({select:pe=>{if(U)return!1;if(d?.exact){if(!a3(pe.location.pathname,ee.pathname,n.basepath))return!1}else{const ke=Eh(pe.location.pathname,n.basepath),we=Eh(ee.pathname,n.basepath);if(!(ke.startsWith(we)&&(ke.length===we.length||ke[we.length]==="/")))return!1}return(d?.includeSearch??!0)&&!da(pe.location.search,ee.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?pe.location.hash===ee.hash:!0}}),oe=R.useCallback(()=>{n.preloadRoute({...te}).catch(pe=>{console.warn(pe),console.warn(P3)})},[n,te]),le=R.useCallback(pe=>{pe?.isIntersecting&&oe()},[oe]);G3(h,le,eO,{disabled:!!E||se!=="viewport"}),R.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const _e=pe=>{const ke=pe.currentTarget.getAttribute("target"),we=y!==void 0?y:ke;if(!E&&!tO(pe)&&!pe.defaultPrevented&&(!we||we==="_self")&&pe.button===0){pe.preventDefault(),er.flushSync(()=>{o(!0)});const We=n.subscribe("onResolved",()=>{We(),o(!1)});n.navigate({...te,replace:C,resetScroll:b,hashScrollIntoView:S,startTransition:w,viewTransition:x,ignoreBlocker:$})}};if(U)return{...I,ref:h,href:U,..._&&{children:_},...y&&{target:y},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...D&&{onMouseEnter:D},...z&&{onMouseLeave:z},...H&&{onTouchStart:H}};const ge=pe=>{E||se&&oe()},ue=ge,de=pe=>{if(!(E||!se))if(!ne)oe();else{const ke=pe.target;if(gu.has(ke))return;const we=setTimeout(()=>{gu.delete(ke),oe()},ne);gu.set(ke,we)}},Ie=pe=>{if(E||!se||!ne)return;const ke=pe.target,we=gu.get(ke);we&&(clearTimeout(we),gu.delete(ke))},De=re?so(a,{})??X3:hv,Oe=re?hv:so(l,{})??hv,be=[A,De.className,Oe.className].filter(Boolean).join(" "),Me=(T||De.style||Oe.style)&&{...T,...De.style,...Oe.style};return{...I,...De,...Oe,href:Q?.href,ref:h,onClick:vu([M,_e]),onFocus:vu([L,ge]),onMouseEnter:vu([D,de]),onMouseLeave:vu([z,Ie]),onTouchStart:vu([H,ue]),disabled:!!E,target:y,...Me&&{style:Me},...be&&{className:be},...E&&Q3,...re&&Z3,...s&&J3}}const hv={},X3={className:"active"},Q3={role:"link","aria-disabled":!0},Z3={"data-status":"active","aria-current":"page"},J3={"data-transitioning":"transitioning"},gu=new WeakMap,eO={rootMargin:"100px"},vu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},qn=R.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,ref:u,...h}=Y3(s,t),a=typeof s.children=="function"?s.children({isActive:h["data-status"]==="active"}):s.children;return n===void 0&&delete h.disabled,R.createElement(n||"a",{...h,ref:u},a)});function tO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let nO=class extends C2{constructor(t){super(t),this.useMatch=n=>Vs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Vs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>J_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Q_({...n,from:this.id}),this.useLoaderData=n=>X_({...n,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=ze.forwardRef((n,s)=>v.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function rO(e){return new nO(e)}class sO extends j3{constructor(t){super(t),this.useMatch=n=>Vs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Vs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>J_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Q_({...n,from:this.id}),this.useLoaderData=n=>X_({...n,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=ze.forwardRef((n,s)=>v.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function iO(e){return new sO(e)}function ws(e){return typeof e=="object"?new AS(e,{silent:!0}).createRoute(e):new AS(e,{silent:!0}).createRoute}class AS{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=rO(s);return o.isRoot=!1,o},this.silent=n?.silent}}class OS{constructor(t){this.useMatch=n=>Vs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Vs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>J_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Q_({...n,from:this.options.id}),this.useLoaderData=n=>X_({...n,from:this.options.id}),this.useNavigate=()=>{const n=Vr();return yo({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function MS(e){return typeof e=="object"?new OS(e):t=>new OS({id:e,...t})}function oO(){const e=Vr(),t=R.useRef({router:e,mounted:!1}),[n,s]=R.useState(!1),{hasPendingMatches:o,isLoading:u}=Jn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),h=fv(u),a=u||n||o,l=fv(a),d=u||o,p=fv(d);return e.startTransition=f=>{s(!0),R.startTransition(()=>{f(),s(!1)})},R.useEffect(()=>{const f=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return fa(e.latestLocation.href)!==fa(g.href)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),If(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),If(()=>{h&&!u&&e.emit({type:"onLoad",...ha(e.state)})},[h,e,u]),If(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ha(e.state)})},[d,p,e]),If(()=>{if(l&&!a){const f=ha(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&m3(e)}},[a,l,e]),null}function aO(e){const t=Jn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return v.jsx(Y_,{getResetKey:()=>t,onCatch:(n,s)=>{if(is(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(is(n))return e.fallback?.(n);throw n},children:e.children})}function lO(){return v.jsx("p",{children:"Not Found"})}function El(e){return v.jsx(v.Fragment,{children:e.children})}function k2(e,t,n){return t.options.notFoundComponent?v.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?v.jsx(e.options.defaultNotFoundComponent,{...n}):v.jsx(lO,{})}function cO({children:e}){const t=Vr();return t.isServer?v.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function uO(){const e=Vr();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||Kv)(e.latestLocation),s=n!==Kv(e.latestLocation)?n:void 0,o={storageKey:Rh,shouldScrollRestoration:!0};return s&&(o.key=s),v.jsx(cO,{children:`(${f2.toString()})(${JSON.stringify(o)})`})}const T2=R.memo(function({matchId:t}){const n=Vr(),s=Jn({select:x=>{const _=x.matches.find(y=>y.id===t);return xi(_),{routeId:_.routeId,ssr:_.ssr,_displayPending:_._displayPending}},structuralSharing:!0}),o=n.routesById[s.routeId],u=o.options.pendingComponent??n.options.defaultPendingComponent,h=u?v.jsx(u,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,l=o.options.onCatch??n.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,p=s.ssr===!1||s.ssr==="data-only",f=(!o.isRoot||o.options.wrapInSuspense||p)&&(o.options.wrapInSuspense??u??(o.options.errorComponent?.preload||p))?R.Suspense:El,g=a?Y_:El,S=d?aO:El,C=Jn({select:x=>x.loadedAt}),w=Jn({select:x=>{const _=x.matches.findIndex(y=>y.id===t);return x.matches[_-1]?.routeId}}),b=o.isRoot?o.options.shellComponent??El:El;return v.jsxs(b,{children:[v.jsx(cp.Provider,{value:t,children:v.jsx(f,{fallback:h,children:v.jsx(g,{getResetKey:()=>C,errorComponent:a||lp,onCatch:(x,_)=>{if(is(x))throw x;l?.(x,_)},children:v.jsx(S,{fallback:x=>{if(!d||x.routeId&&x.routeId!==s.routeId||!x.routeId&&!o.isRoot)throw x;return R.createElement(d,x)},children:p||s._displayPending?v.jsx(N3,{fallback:h,children:v.jsx(DS,{matchId:t})}):v.jsx(DS,{matchId:t})})})})}),w===Ir&&n.options.scrollRestoration?v.jsxs(v.Fragment,{children:[v.jsx(dO,{}),v.jsx(uO,{})]}):null]})});function dO(){const e=Vr(),t=R.useRef(void 0);return v.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ha(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const DS=R.memo(function({matchId:t}){const n=Vr(),{match:s,key:o,routeId:u}=Jn({select:l=>{const d=l.matches.find(C=>C.id===t),p=d.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),h=n.routesById[u],a=R.useMemo(()=>{const l=h.options.component??n.options.defaultComponent;return l?v.jsx(l,{},o):v.jsx(L2,{})},[o,h.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const l=h.options.pendingMinMs??n.options.defaultPendingMinMs;if(l){const d=n.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise&&!n.isServer){const p=Fl();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},l)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return xi(is(s.error)),k2(n,h,s.error);if(s.status==="redirected")throw xi(bs(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const l=(h.options.errorComponent??n.options.defaultErrorComponent)||lp;return v.jsx(l,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),L2=R.memo(function(){const t=Vr(),n=R.useContext(cp),s=Jn({select:d=>d.matches.find(p=>p.id===n)?.routeId}),o=t.routesById[s],u=Jn({select:d=>{const f=d.matches.find(g=>g.id===n);return xi(f),f.globalNotFound}}),h=Jn({select:d=>{const p=d.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),a=t.options.defaultPendingComponent?v.jsx(t.options.defaultPendingComponent,{}):null;if(u)return k2(t,o,void 0);if(!h)return null;const l=v.jsx(T2,{matchId:h});return s===Ir?v.jsx(R.Suspense,{fallback:a,children:l}):l});function fO(){const e=Vr(),n=e.routesById[Ir].options.pendingComponent??e.options.defaultPendingComponent,s=n?v.jsx(n,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?El:R.Suspense,u=v.jsxs(o,{fallback:s,children:[!e.isServer&&v.jsx(oO,{}),v.jsx(hO,{})]});return e.options.InnerWrap?v.jsx(e.options.InnerWrap,{children:u}):u}function hO(){const e=Vr(),t=Jn({select:o=>o.matches[0]?.id}),n=Jn({select:o=>o.loadedAt}),s=t?v.jsx(T2,{matchId:t}):null;return v.jsx(cp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:v.jsx(Y_,{getResetKey:()=>n,errorComponent:lp,onCatch:o=>{o.message||o.toString()},children:s})})}const pO=e=>new mO(e);class mO extends L3{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=ws,globalThis.createLazyFileRoute=MS):typeof window<"u"&&(window.createFileRoute=ws,window.createLazyFileRoute=MS);function gO({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=R2(),o=v.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?v.jsx(e.options.Wrap,{children:o}):o}function vO({router:e,...t}){return v.jsx(gO,{router:e,...t,children:v.jsx(fO,{})})}function _O(e){return Jn({select:t=>t.location})}var Jl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yO={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bO=class{#e=yO;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},ra=new bO;function xO(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function sr(){}function SO(e,t){return typeof e=="function"?e(t):e}function Xv(e){return typeof e=="number"&&e>=0&&e!==1/0}function A2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fo(e,t){return typeof e=="function"?e(t):e}function ns(e,t){return typeof e=="function"?e(t):e}function PS(e,t){const{type:n="all",exact:s,fetchStatus:o,predicate:u,queryKey:h,stale:a}=e;if(h){if(s){if(t.queryHash!==e0(h,t.options))return!1}else if(!Bu(t.queryKey,h))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||u&&!u(t))}function jS(e,t){const{exact:n,status:s,predicate:o,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(n){if(Ea(t.options.mutationKey)!==Ea(u))return!1}else if(!Bu(t.options.mutationKey,u))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function e0(e,t){return(t?.queryKeyHashFn||Ea)(e)}function Ea(e){return JSON.stringify(e,(t,n)=>Qv(n)?Object.keys(n).sort().reduce((s,o)=>(s[o]=n[o],s),{}):n)}function Bu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Bu(e[n],t[n])):!1}var CO=Object.prototype.hasOwnProperty;function O2(e,t){if(e===t)return e;const n=IS(e)&&IS(t);if(!n&&!(Qv(e)&&Qv(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),h=u.length,a=n?new Array(h):{};let l=0;for(let d=0;d<h;d++){const p=n?d:u[d],f=e[p],g=t[p];if(f===g){a[p]=f,(n?d<o:CO.call(e,p))&&l++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const S=O2(f,g);a[p]=S,S===f&&l++}return o===h&&l===o?e:a}function Lh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qv(e){if(!NS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!NS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function NS(e){return Object.prototype.toString.call(e)==="[object Object]"}function wO(e){return new Promise(t=>{ra.setTimeout(t,e)})}function Zv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?O2(e,t):t}function EO(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function RO(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var t0=Symbol();function M2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===t0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D2(e,t){return typeof e=="function"?e(...t):!!e}var kO=class extends Jl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},n0=new kO;function Jv(){let e,t;const n=new Promise((o,u)=>{e=o,t=u});n.status="pending",n.catch(()=>{});function s(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},n.reject=o=>{s({status:"rejected",reason:o}),t(o)},n}var TO=xO;function LO(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=TO;const u=a=>{t?e.push(a):o(()=>{n(a)})},h=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||h()}return l},batchCalls:a=>(...l)=>{u(()=>{a(...l)})},schedule:u,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var Dn=LO(),AO=class extends Jl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ah=new AO;function OO(e){return Math.min(1e3*2**e,3e4)}function P2(e){return(e??"online")==="online"?Ah.isOnline():!0}var e_=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function j2(e){let t=!1,n=0,s;const o=Jv(),u=()=>o.status!=="pending",h=w=>{if(!u()){const b=new e_(w);g(b),e.onCancel?.(b)}},a=()=>{t=!0},l=()=>{t=!1},d=()=>n0.isFocused()&&(e.networkMode==="always"||Ah.isOnline())&&e.canRun(),p=()=>P2(e.networkMode)&&e.canRun(),f=w=>{u()||(s?.(),o.resolve(w))},g=w=>{u()||(s?.(),o.reject(w))},S=()=>new Promise(w=>{s=b=>{(u()||d())&&w(b)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),C=()=>{if(u())return;let w;const b=n===0?e.initialPromise:void 0;try{w=b??e.fn()}catch(x){w=Promise.reject(x)}Promise.resolve(w).then(f).catch(x=>{if(u())return;const _=e.retry??(wa?0:3),y=e.retryDelay??OO,E=typeof y=="function"?y(n,x):y,T=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,x);if(t||!T){g(x);return}n++,e.onFail?.(n,x),wO(E).then(()=>d()?void 0:S()).then(()=>{t?g(x):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:l,canStart:p,start:()=>(p()?C():S().then(C),o)}}var I2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xv(this.gcTime)&&(this.#e=ra.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ra.clearTimeout(this.#e),this.#e=void 0)}},MO=class extends I2{#e;#t;#n;#s;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zS(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=zS(this.options);t.data!==void 0&&(this.setState(BS(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Zv(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(sr).catch(sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ns(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>fo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!A2(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const a=M2(this.options,t),d=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(p),p})();return this.#a=!1,this.options.persister?this.options.persister(a,d,this):a(d)},h=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return s(a),a})();this.options.behavior?.onFetch(h,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#i({type:"fetch",meta:h.fetchOptions?.meta}),this.#r=j2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof e_&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof e_){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#i({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...N2(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...BS(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function N2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BS(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function zS(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var DO=class extends Jl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Jv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#o;#a;#i;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),HS(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return t_(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return t_(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ns(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Lh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&FS(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||ns(this.options.enabled,this.#t)!==ns(t.enabled,this.#t)||fo(this.options.staleTime,this.#t)!==fo(t.staleTime,this.#t))&&this.#g();const o=this.#v();s&&(this.#t!==n||ns(this.options.enabled,this.#t)!==ns(t.enabled,this.#t)||o!==this.#l)&&this.#_(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return jO(this,n)&&(this.#s=n,this.#o=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(sr)),t}#g(){this.#b();const e=fo(this.options.staleTime,this.#t);if(wa||this.#s.isStale||!Xv(e))return;const n=A2(this.#s.dataUpdatedAt,e)+1;this.#c=ra.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#x(),this.#l=e,!(wa||ns(this.options.enabled,this.#t)===!1||!Xv(this.#l)||this.#l===0)&&(this.#u=ra.setInterval(()=>{(this.options.refetchIntervalInBackground||n0.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(ra.clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(ra.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,o=this.#s,u=this.#r,h=this.#o,l=e!==n?e.state:this.#n,{state:d}=e;let p={...d},f=!1,g;if(t._optimisticResults){const L=this.hasListeners(),D=!L&&HS(e,t),z=L&&FS(e,n,t,s);(D||z)&&(p={...p,...N2(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:C,status:w}=p;g=p.data;let b=!1;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let L;o?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(L=o.data,b=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(w="success",g=Zv(o?.data,L,t),f=!0)}if(t.select&&g!==void 0&&!b)if(o&&g===u?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=Zv(o?.data,g,t),this.#f=g,this.#i=null}catch(L){this.#i=L}this.#i&&(S=this.#i,g=this.#f,C=Date.now(),w="error");const x=p.fetchStatus==="fetching",_=w==="pending",y=w==="error",E=_&&x,T=g!==void 0,M={status:w,fetchStatus:p.fetchStatus,isPending:_,isSuccess:w==="success",isError:y,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:C,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>l.dataUpdateCount||p.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!_,isLoadingError:y&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&T,isStale:r0(e,t),refetch:this.refetch,promise:this.#a,isEnabled:ns(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=H=>{M.status==="error"?H.reject(M.error):M.data!==void 0&&H.resolve(M.data)},D=()=>{const H=this.#a=M.promise=Jv();L(H)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&L(z);break;case"fulfilled":(M.status==="error"||M.data!==z.value)&&D();break;case"rejected":(M.status!=="error"||M.error!==z.reason)&&D();break}}return M}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Lh(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#p.size)return!0;const u=new Set(o??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#s).some(h=>{const a=h;return this.#s[a]!==e[a]&&u.has(a)})};this.#C({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Dn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function PO(e,t){return ns(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function HS(e,t){return PO(e,t)||e.state.data!==void 0&&t_(e,t,t.refetchOnMount)}function t_(e,t,n){if(ns(t.enabled,e)!==!1&&fo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&r0(e,t)}return!1}function FS(e,t,n,s){return(e!==t||ns(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&r0(e,n)}function r0(e,t){return ns(t.enabled,e)!==!1&&e.isStaleByTime(fo(t.staleTime,e))}function jO(e,t){return!Lh(e.getCurrentResult(),t)}function VS(e){return{onFetch:(t,n)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],h=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const d=async()=>{let p=!1;const f=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=M2(t.options,t.fetchOptions),S=async(C,w,b)=>{if(p)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const _=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:b?"backward":"forward",meta:t.options.meta};return f(A),A})(),y=await g(_),{maxPages:E}=t.options,T=b?RO:EO;return{pages:T(C.pages,y,E),pageParams:T(C.pageParams,w,E)}};if(o&&u.length){const C=o==="backward",w=C?IO:US,b={pages:u,pageParams:h},x=w(s,b);a=await S(b,x,C)}else{const C=e??u.length;do{const w=l===0?h[0]??s.initialPageParam:US(s,a);if(l>0&&w==null)break;a=await S(a,w),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function US(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function IO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var NO=class extends I2{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||B2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=j2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(u,h)=>{this.#r({type:"failed",failureCount:u,error:h})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,n);const h=await this.options.onMutate?.(e,n);h!==this.state.context&&this.#r({type:"pending",context:h,variables:e,isPaused:o})}const u=await this.#s.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,n),await this.options.onSuccess?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(u,null,e,this.state.context,n),this.#r({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,n),await this.options.onError?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,u,e,this.state.context,n),u}finally{this.#r({type:"error",error:u})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Dn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function B2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var BO=class extends Jl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new NO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=Nf(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Nf(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Nf(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=Nf(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>jS(t,n))}findAll(e={}){return this.getAll().filter(t=>jS(e,t))}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Dn.batch(()=>Promise.all(e.map(t=>t.continue().catch(sr))))}};function Nf(e){return e.options.scope?.id}var zO=class extends Jl{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Lh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ea(n.mutationKey)!==Ea(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??B2();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Dn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#s.onSuccess?.(t.data,n,s,o),this.#s.onSettled?.(t.data,null,n,s,o)):t?.type==="error"&&(this.#s.onError?.(t.error,n,s,o),this.#s.onSettled?.(void 0,t.error,n,s,o))}this.listeners.forEach(n=>{n(this.#t)})})}},HO=class extends Jl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,o=t.queryHash??e0(s,t);let u=this.get(o);return u||(u=new MO({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>PS(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>PS(e,n)):t}notify(e){Dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},FO=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new HO,this.#t=e.mutationCache||new BO,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=n0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Ah.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(s.queryHash)?.state.data,h=SO(t,u);if(h!==void 0)return this.#e.build(this,s).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Dn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Dn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(s).then(sr).catch(sr)}invalidateQueries(e,t={}){return Dn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Dn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,n);return n.throwOnError||(u=u.catch(sr)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(fo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sr).catch(sr)}fetchInfiniteQuery(e){return e.behavior=VS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sr).catch(sr)}ensureInfiniteQueryData(e){return e.behavior=VS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ah.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Ea(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Bu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Ea(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Bu(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=e0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===t0&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},z2=R.createContext(void 0),$n=e=>{const t=R.useContext(z2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},VO=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(z2.Provider,{value:e,children:t})),H2=R.createContext(!1),UO=()=>R.useContext(H2);H2.Provider;function WO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qO=R.createContext(WO()),GO=()=>R.useContext(qO),$O=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},KO=e=>{R.useEffect(()=>{e.clearReset()},[e])},YO=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||D2(n,[e.error,s])),XO=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>n(s(...o)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QO=(e,t)=>e.isLoading&&e.isFetching&&!t,ZO=(e,t)=>e?.suspense&&t.isPending,WS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JO(e,t,n){const s=UO(),o=GO(),u=$n(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",XO(h),$O(h,o),KO(o);const a=!u.getQueryCache().get(h.queryHash),[l]=R.useState(()=>new t(u,h)),d=l.getOptimisticResult(h),p=!s&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(f=>{const g=p?l.subscribe(Dn.batchCalls(f)):sr;return l.updateResult(),g},[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),R.useEffect(()=>{l.setOptions(h)},[h,l]),ZO(h,d))throw WS(h,l,o);if(YO({result:d,errorResetBoundary:o,throwOnError:h.throwOnError,query:u.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw d.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,d),h.experimental_prefetchInRender&&!wa&&QO(d,s)&&(a?WS(h,l,o):u.getQueryCache().get(h.queryHash)?.promise)?.catch(sr).finally(()=>{l.updateResult()}),h.notifyOnChangeProps?d:l.trackResult(d)}function Kn(e,t){return JO(e,DO)}function jn(e,t){const n=$n(),[s]=R.useState(()=>new zO(n,e));R.useEffect(()=>{s.setOptions(e)},[s,e]);const o=R.useSyncExternalStore(R.useCallback(h=>s.subscribe(Dn.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=R.useCallback((h,a)=>{s.mutate(h,a).catch(sr)},[s]);if(o.error&&D2(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function up(){return typeof window<"u"}function bo(e){return s0(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qs(e){var t;return(t=(s0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s0(e){return up()?e instanceof Node||e instanceof Rn(e).Node:!1}function Nt(e){return up()?e instanceof Element||e instanceof Rn(e).Element:!1}function en(e){return up()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function n_(e){return!up()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}const eM=new Set(["inline","contents"]);function Aa(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Fr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!eM.has(o)}const tM=new Set(["table","td","th"]);function nM(e){return tM.has(bo(e))}const rM=[":popover-open",":modal"];function dp(e){return rM.some(t=>{try{return e.matches(t)}catch{return!1}})}const sM=["transform","translate","scale","rotate","perspective"],iM=["transform","translate","scale","rotate","perspective","filter"],oM=["paint","layout","strict","content"];function i0(e){const t=fp(),n=Nt(e)?Fr(e):e;return sM.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||iM.some(s=>(n.willChange||"").includes(s))||oM.some(s=>(n.contain||"").includes(s))}function aM(e){let t=Us(e);for(;en(t)&&!Hs(t);){if(i0(t))return t;if(dp(t))return null;t=Us(t)}return null}function fp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lM=new Set(["html","body","#document"]);function Hs(e){return lM.has(bo(e))}function Fr(e){return Rn(e).getComputedStyle(e)}function hp(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Us(e){if(bo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n_(e)&&e.host||qs(e);return n_(t)?t.host:t}function F2(e){const t=Us(e);return Hs(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&Aa(t)?t:F2(t)}function ho(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=F2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=Rn(o);if(u){const a=r_(h);return t.concat(h,h.visualViewport||[],Aa(o)?o:[],a&&n?ho(a):[])}return t.concat(o,ho(o,[],n))}function r_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const qS={};function Gn(e,t){const n=R.useRef(qS);return n.current===qS&&(n.current=e(t)),n}const pv=ip[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],cM=pv&&pv!==R.useLayoutEffect?pv:e=>e();function Pe(e){const t=Gn(uM).current;return t.next=e,cM(t.effect),t.trampoline}function uM(){const e={next:void 0,callback:dM,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dM(){}const fM=()=>{},Fe=typeof document<"u"?R.useLayoutEffect:fM;function s_(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Mu={};function Ws(e,t,n,s,o){let u={...i_(e,Mu)};return t&&(u=Ru(u,t)),n&&(u=Ru(u,n)),s&&(u=Ru(u,s)),o&&(u=Ru(u,o)),u}function hM(e){if(e.length===0)return Mu;if(e.length===1)return i_(e[0],Mu);let t={...i_(e[0],Mu)};for(let n=1;n<e.length;n+=1)t=Ru(t,e[n]);return t}function Ru(e,t){return V2(t)?t(e):pM(e,t)}function pM(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=s_(e.style,s);break}case"className":{e[n]=U2(e.className,s);break}default:mM(n,s)?e[n]=gM(e[n],s):e[n]=s}}return e}function mM(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function V2(e){return typeof e=="function"}function i_(e,t){return V2(e)?e(t):e??Mu}function gM(e,t){return t?e?n=>{if(vM(n)){const o=n;o_(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function o_(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function U2(e,t){return t?e?t+" "+e:t:e}function vM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Pt(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const W2=R.createContext(void 0);function o0(e=!1){const t=R.useContext(W2);if(t===void 0&&!e)throw new Error(Pt(16));return t}function _M(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:o=0,isNativeButton:u}=e,h=s&&t!==!1,a=s&&t===!1;return{props:R.useMemo(()=>{const d={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return s||(d.tabIndex=o,!u&&n&&(d.tabIndex=t?o:-1)),(u&&(t||h)||!u&&n)&&(d["aria-disabled"]=n),u&&(!t||a)&&(d.disabled=n),d},[s,n,t,h,a,u,o])}}function Sr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=R.useRef(null),h=o0(!0)!==void 0,a=Pe(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:l}=_M({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=R.useCallback(()=>{const g=u.current;yM(g)&&h&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,h]);Fe(d,[d]);const p=R.useCallback((g={})=>{const{onClick:S,onMouseDown:C,onKeyUp:w,onKeyDown:b,onPointerDown:x,..._}=g;return Ws({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}S?.(E)},onMouseDown(E){t||C?.(E)},onKeyDown(E){if(t||(o_(E),b?.(E)),E.baseUIHandlerPrevented)return;const T=E.target===E.currentTarget&&!o&&!a()&&!t,A=E.key==="Enter",M=E.key===" ";T&&((M||A)&&E.preventDefault(),A&&S?.(E))},onKeyUp(E){t||(o_(E),w?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&S?.(E)},onPointerDown(E){if(t){E.preventDefault();return}x?.(E)}},o?void 0:{role:"button"},l,_)},[t,l,o,a]),f=Pe(g=>{u.current=g,d()});return{getButtonProps:p,buttonRef:f}}function yM(e){return en(e)&&e.tagName==="BUTTON"}function cs(e,t,n,s){const o=Gn(q2).current;return xM(o,e,t,n,s)&&G2(o,[e,t,n,s]),o.callback}function bM(e){const t=Gn(q2).current;return SM(t,e)&&G2(t,e),t.callback}function q2(){return{callback:null,cleanup:null,refs:[]}}function xM(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function SM(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function G2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=u(n);typeof h=="function"&&(s[o]=h);break}case"object":{u.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=s[o];typeof h=="function"?h():u(null);break}case"object":{u.current=null;break}}}}}}}const CM=parseInt(R.version,10);function a0(e){return CM>=e}function GS(e){if(!R.isValidElement(e))return null;const t=e,n=t.props;return(a0(19)?n?.ref:t.ref)??null}function wM(e,t){const n={};for(const s in e){const o=e[s];if(t?.hasOwnProperty(s)){const u=t[s](o);u!=null&&Object.assign(n,u);continue}o===!0?n[`data-${s.toLowerCase()}`]="":o&&(n[`data-${s.toLowerCase()}`]=o.toString())}return n}function EM(e,t){return typeof e=="function"?e(t):e}function RM(e,t){return typeof e=="function"?e(t):e}function on(){}const br=Object.freeze([]),tn=Object.freeze({}),kM=500,TM=500,LM={style:{transition:"none"}},$2="data-base-ui-click-trigger",l0={fallbackAxisSide:"none"},AM={fallbackAxisSide:"end"},OM={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function at(e,t,n={}){const s=t.render,o=MM(t,n);if(n.enabled===!1)return null;const u=n.state??tn;return DM(e,s,o,u)}function MM(e,t={}){const{className:n,style:s,render:o}=e,{state:u=tn,ref:h,props:a,stateAttributesMapping:l,enabled:d=!0}=t,p=d?EM(n,u):void 0,f=d?RM(s,u):void 0,g=d?wM(u,l):tn,S=d?s_(g,Array.isArray(a)?hM(a):a)??tn:tn;return typeof document<"u"&&(d?Array.isArray(h)?S.ref=bM([S.ref,GS(o),...h]):S.ref=cs(S.ref,GS(o),h):cs(null,null)),d?(p!==void 0&&(S.className=U2(S.className,p)),f!==void 0&&(S.style=s_(S.style,f)),S):tn}function DM(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const o=Ws(n,t.props);return o.ref=n.ref,R.cloneElement(t,o)}if(e&&typeof e=="string")return PM(e,n);throw new Error(Pt(8))}function PM(e,t){return e==="button"?R.createElement("button",{type:"button",...t,key:t.key}):e==="img"?R.createElement("img",{alt:"",...t,key:t.key}):R.createElement(e,t)}const jM=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,focusableWhenDisabled:h=!1,nativeButton:a=!0,...l}=t,d=!!u,{getButtonProps:p,buttonRef:f}=Sr({disabled:d,focusableWhenDisabled:h,native:a}),g=R.useMemo(()=>({disabled:d}),[d]);return at("button",t,{state:g,ref:[n,f],props:[l,p]})});function K2(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=K2(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Y2(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=K2(e))&&(s&&(s+=" "),s+=t);return s}const $S=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,KS=Y2,Oa=(e,t)=>n=>{var s;if(t?.variants==null)return KS(e,n?.class,n?.className);const{variants:o,defaultVariants:u}=t,h=Object.keys(o).map(d=>{const p=n?.[d],f=u?.[d];if(p===null)return null;const g=$S(p)||$S(f);return o[d][g]}),a=n&&Object.entries(n).reduce((d,p)=>{let[f,g]=p;return g===void 0||(d[f]=g),d},{}),l=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,p)=>{let{class:f,className:g,...S}=p;return Object.entries(S).every(C=>{let[w,b]=C;return Array.isArray(b)?b.includes({...u,...a}[w]):{...u,...a}[w]===b})?[...d,f,g]:d},[]);return KS(e,h,l,n?.class,n?.className)},IM=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},NM=(e,t)=>({classGroupId:e,validator:t}),X2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Oh="-",YS=[],BM="arbitrary..",zM=e=>{const t=FM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return HM(h);const a=h.split(Oh),l=a[0]===""&&a.length>1?1:0;return Q2(a,l,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const l=s[h],d=n[h];return l?d?IM(d,l):l:d||YS}return n[h]||YS}}},Q2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=Q2(e,t+1,u);if(d)return d}const h=n.validators;if(h===null)return;const a=t===0?e.join(Oh):e.slice(t).join(Oh),l=h.length;for(let d=0;d<l;d++){const p=h[d];if(p.validator(a))return p.classGroupId}},HM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?BM+s:void 0})(),FM=e=>{const{theme:t,classGroups:n}=e;return VM(n,t)},VM=(e,t)=>{const n=X2();for(const s in e){const o=e[s];c0(o,n,s,t)}return n},c0=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];UM(h,t,n,s)}},UM=(e,t,n,s)=>{if(typeof e=="string"){WM(e,t,n);return}if(typeof e=="function"){qM(e,t,n,s);return}GM(e,t,n,s)},WM=(e,t,n)=>{const s=e===""?t:Z2(t,e);s.classGroupId=n},qM=(e,t,n,s)=>{if($M(e)){c0(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(NM(n,e))},GM=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,l]=o[h];c0(l,Z2(t,a),n,s)}},Z2=(e,t)=>{let n=e;const s=t.split(Oh),o=s.length;for(let u=0;u<o;u++){const h=s[u];let a=n.nextPart.get(h);a||(a=X2(),n.nextPart.set(h,a)),n=a}return n},$M=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,KM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(u,h)=>{n[u]=h,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(u){let h=n[u];if(h!==void 0)return h;if((h=s[u])!==void 0)return o(u,h),h},set(u,h){u in n?n[u]=h:o(u,h)}}},a_="!",XS=":",YM=[],QS=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),XM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const u=[];let h=0,a=0,l=0,d;const p=o.length;for(let w=0;w<p;w++){const b=o[w];if(h===0&&a===0){if(b===XS){u.push(o.slice(l,w)),l=w+1;continue}if(b==="/"){d=w;continue}}b==="["?h++:b==="]"?h--:b==="("?a++:b===")"&&a--}const f=u.length===0?o:o.slice(l);let g=f,S=!1;f.endsWith(a_)?(g=f.slice(0,-1),S=!0):f.startsWith(a_)&&(g=f.slice(1),S=!0);const C=d&&d>l?d-l:void 0;return QS(u,S,g,C)};if(t){const o=t+XS,u=s;s=h=>h.startsWith(o)?u(h.slice(o.length)):QS(YM,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},QM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let u=0;u<n.length;u++){const h=n[u],a=h[0]==="[",l=t.has(h);a||l?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(h)):o.push(h)}return o.length>0&&(o.sort(),s.push(...o)),s}},ZM=e=>({cache:KM(e.cacheSize),parseClassName:XM(e),sortModifiers:QM(e),...zM(e)}),JM=/\s+/,e4=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(JM);let l="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:f,modifiers:g,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(f){l=p+(l.length>0?" "+l:l);continue}let b=!!w,x=s(b?C.substring(0,w):C);if(!x){if(!b){l=p+(l.length>0?" "+l:l);continue}if(x=s(C),!x){l=p+(l.length>0?" "+l:l);continue}b=!1}const _=g.length===0?"":g.length===1?g[0]:u(g).join(":"),y=S?_+a_:_,E=y+x;if(h.indexOf(E)>-1)continue;h.push(E);const T=o(x,b);for(let A=0;A<T.length;++A){const M=T[A];h.push(y+M)}l=p+(l.length>0?" "+l:l)}return l},t4=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=J2(n))&&(o&&(o+=" "),o+=s);return o},J2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=J2(e[s]))&&(n&&(n+=" "),n+=t);return n},n4=(e,...t)=>{let n,s,o,u;const h=l=>{const d=t.reduce((p,f)=>f(p),e());return n=ZM(d),s=n.cache.get,o=n.cache.set,u=a,a(l)},a=l=>{const d=s(l);if(d)return d;const p=e4(l,n);return o(l,p),p};return u=h,(...l)=>u(t4(...l))},r4=[],Ln=e=>{const t=n=>n[e]||r4;return t.isThemeGetter=!0,t},eE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s4=/^\d+\/\d+$/,i4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o4=/\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$/,a4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cl=e=>s4.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),to=e=>!!e&&Number.isInteger(Number(e)),mv=e=>e.endsWith("%")&&St(e.slice(0,-1)),_i=e=>i4.test(e),u4=()=>!0,d4=e=>o4.test(e)&&!a4.test(e),nE=()=>!1,f4=e=>l4.test(e),h4=e=>c4.test(e),p4=e=>!Ke(e)&&!Ye(e),m4=e=>ec(e,iE,nE),Ke=e=>eE.test(e),Go=e=>ec(e,oE,d4),gv=e=>ec(e,b4,St),ZS=e=>ec(e,rE,nE),g4=e=>ec(e,sE,h4),Bf=e=>ec(e,aE,f4),Ye=e=>tE.test(e),_u=e=>tc(e,oE),v4=e=>tc(e,x4),JS=e=>tc(e,rE),_4=e=>tc(e,iE),y4=e=>tc(e,sE),zf=e=>tc(e,aE,!0),ec=(e,t,n)=>{const s=eE.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},tc=(e,t,n=!1)=>{const s=tE.exec(e);return s?s[1]?t(s[1]):n:!1},rE=e=>e==="position"||e==="percentage",sE=e=>e==="image"||e==="url",iE=e=>e==="length"||e==="size"||e==="bg-size",oE=e=>e==="length",b4=e=>e==="number",x4=e=>e==="family-name",aE=e=>e==="shadow",S4=()=>{const e=Ln("color"),t=Ln("font"),n=Ln("text"),s=Ln("font-weight"),o=Ln("tracking"),u=Ln("leading"),h=Ln("breakpoint"),a=Ln("container"),l=Ln("spacing"),d=Ln("radius"),p=Ln("shadow"),f=Ln("inset-shadow"),g=Ln("text-shadow"),S=Ln("drop-shadow"),C=Ln("blur"),w=Ln("perspective"),b=Ln("aspect"),x=Ln("ease"),_=Ln("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Ye,Ke],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[Ye,Ke,l],D=()=>[Cl,"full","auto",...L()],z=()=>[to,"none","subgrid",Ye,Ke],H=()=>["auto",{span:["full",to,Ye,Ke]},to,Ye,Ke],$=()=>[to,"auto",Ye,Ke],N=()=>["auto","min","max","fr",Ye,Ke],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...L()],Y=()=>[Cl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],G=()=>[e,Ye,Ke],j=()=>[...E(),JS,ZS,{position:[Ye,Ke]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",_4,m4,{size:[Ye,Ke]}],I=()=>[mv,_u,Go],F=()=>["","none","full",d,Ye,Ke],X=()=>["",St,_u,Go],te=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[St,mv,JS,ZS],U=()=>["","none",C,Ye,Ke],se=()=>["none",St,Ye,Ke],ne=()=>["none",St,Ye,Ke],re=()=>[St,Ye,Ke],oe=()=>[Cl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_i],breakpoint:[_i],color:[u4],container:[_i],"drop-shadow":[_i],ease:["in","out","in-out"],font:[p4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_i],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_i],shadow:[_i],spacing:["px",St],text:[_i],"text-shadow":[_i],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cl,Ke,Ye,b]}],container:["container"],columns:[{columns:[St,Ke,Ye,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[to,"auto",Ye,Ke]}],basis:[{basis:[Cl,"full","auto",a,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Cl,"auto","initial","none",Ke]}],grow:[{grow:["",St,Ye,Ke]}],shrink:[{shrink:["",St,Ye,Ke]}],order:[{order:[to,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[a,"screen",...Y()]}],"min-w":[{"min-w":[a,"screen","none",...Y()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,_u,Go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ye,gv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",mv,Ke]}],"font-family":[{font:[v4,Ke,t]}],"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,Ye,Ke]}],"line-clamp":[{"line-clamp":[St,"none",Ye,gv]}],leading:[{leading:[u,...L()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ye,Go]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[St,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],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",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},to,Ye,Ke],radial:["",Ye,Ke],conic:[to,Ye,Ke]},y4,g4]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ye,Ke]}],"outline-w":[{outline:["",St,_u,Go]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",p,zf,Bf]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",f,zf,Bf]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[St,Go]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",g,zf,Bf]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[St,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:U()}],brightness:[{brightness:[St,Ye,Ke]}],contrast:[{contrast:[St,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",S,zf,Bf]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",St,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[St,Ye,Ke]}],invert:[{invert:["",St,Ye,Ke]}],saturate:[{saturate:[St,Ye,Ke]}],sepia:[{sepia:["",St,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",St,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",x,Ye,Ke]}],delay:[{delay:[St,Ye,Ke]}],animate:[{animate:["none",_,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ye,Ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"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:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",Ye,Ke]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ye,Ke]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[St,_u,Go,gv]}],stroke:[{stroke:["none",...G()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},C4=n4(S4);function Be(...e){return C4(Y2(e))}const w4=Oa("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:e,variant:t="default",size:n="default",...s}){return v.jsx(jM,{"data-slot":"button",className:Be(w4({variant:t,size:n,className:e})),...s})}const E4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},ve=R.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:o="",altIcon:u,showAlt:h=!1,icon:a,primaryColor:l,secondaryColor:d,disableSecondaryOpacity:p=!1,...f},g)=>{const S=n!==void 0?s?Number(n)*24/Number(t):n:void 0,C=S!==void 0?{strokeWidth:S,stroke:"currentColor"}:{},w={ref:g,...E4,width:t,height:t,color:l||e,className:o,...C,...f},x=[...h&&u?u:a].sort(([,_],[,y])=>{const E=_.opacity!==void 0;return y.opacity!==void 0?1:E?-1:0}).map(([_,y])=>{const E=y.opacity!==void 0,T=E&&!p?y.opacity:void 0,A=d?{...y.stroke!==void 0?{stroke:E?d:l||e}:{fill:E?d:l||e}}:{};return R.createElement(_,{...y,...C,...A,opacity:T,key:y.key})});return R.createElement("svg",w,x)});ve.displayName="HugeiconsIcon";const nc=[["path",{d:"M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9V13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 16.9922V17.0022",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],pp=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],l_=[["path",{d:"M6 20L18 20",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 12C16 12 13.054 16 12 16C10.9459 16 8 12 8 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],lE=[["path",{d:"M17.9997 12.5C17.9997 12.5 13.5807 18.5 11.9996 18.5C10.4185 18.5 5.99966 12.5 5.99966 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.9997 5.50005C17.9997 5.50005 13.5807 11.5 11.9996 11.5C10.4185 11.5 5.99966 5.5 5.99966 5.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],cE=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],eC=[["path",{d:"M5.5 12.002H19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],mp=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],u0=[["path",{d:"M17.9998 15C17.9998 15 13.5809 9.00001 11.9998 9C10.4187 8.99999 5.99985 15 5.99985 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],c_=[["path",{d:"M18 4L5.99997 4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9999 12C15.9999 12 13.054 8.00001 11.9999 8C10.9458 7.99999 7.99994 12 7.99994 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],u_=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],R4=[["path",{d:"M16 2V6M8 2V6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 10H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M11.9955 14H12.0045M11.9955 18H12.0045M15.991 14H16M8 14H8.00897M8 18H8.00897",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],Si=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],k4=[["path",{d:"M11 6L21 6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 12L21 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 18L21 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],T4=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],L4=[["path",{d:"M21 3L13 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.44573 11.0854C6.96539 12.0368 4.98269 11.8736 3 11.0885C3.50059 17.531 6.50414 20.0089 10.5089 21C10.5089 21 13.5261 18.8664 13.961 13.8074C14.0081 13.2595 14.0317 12.9856 13.9178 12.6769C13.8038 12.3682 13.5802 12.1468 13.1329 11.704C12.3973 10.9757 12.0295 10.6116 11.5929 10.5204C11.1564 10.4293 10.5862 10.648 9.44573 11.0854Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M4.5 16.4464C4.5 16.4464 7 16.9286 9.5 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M8.5 7.25C8.5 7.94036 7.94036 8.5 7.25 8.5C6.55964 8.5 6 7.94036 6 7.25C6 6.55964 6.55964 6 7.25 6C7.94036 6 8.5 6.55964 8.5 7.25Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 4V4.1",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"4"}]],tC=[["path",{d:"M7.99994 12H8.00891M11.9955 12H12.0044M15.991 12H15.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"0"}],["path",{d:"M18 21C19.2322 21 20.231 19.8487 20.231 18.4286C20.231 16.1808 20.1312 14.6864 21.6733 12.9091C22.1089 12.407 22.1089 11.5929 21.6733 11.0908C20.1312 9.31353 20.231 7.81914 20.231 5.57141C20.231 4.15125 19.2322 2.99998 18 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 21C4.76784 21 3.76897 19.8487 3.76897 18.4286C3.76897 16.1808 3.86877 14.6864 2.32673 12.9091C1.89109 12.407 1.89109 11.5929 2.32673 11.0908C3.83496 9.35249 3.76897 7.8399 3.76897 5.57141C3.76897 4.15125 4.76784 2.99998 6 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],d0=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}],["path",{d:"M16 13L17.2265 14.0572C17.7422 14.5016 18 14.7239 18 15C18 15.2761 17.7422 15.4984 17.2265 15.9428L16 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M8 13L6.77346 14.0572C6.25782 14.5016 6 14.7239 6 15C6 15.2761 6.25782 15.4984 6.77346 15.9428L8 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M13 12L11 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],A4=[["path",{d:"M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],uE=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12H21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 7L17 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["circle",{cx:"8.25",cy:"7",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["circle",{cx:"8.25",cy:"17",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M13 17L17 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],td=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],O4=[["path",{d:"M18 16L19.8398 17.5858C20.6133 18.2525 21 18.5858 21 19C21 19.4142 20.6133 19.7475 19.8398 20.4142L18 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 16L12.1602 17.5858C11.3867 18.2525 11 18.5858 11 19C11 19.4142 11.3867 19.7475 12.1602 20.4142L14 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 13.0032L20 7.8199C20 6.12616 20 5.27929 19.732 4.60291C19.3013 3.51555 18.3902 2.65784 17.2352 2.25228C16.5168 2 15.6173 2 13.8182 2C10.6698 2 9.09563 2 7.83836 2.44148C5.81714 3.15122 4.22281 4.6522 3.46894 6.55509C3 7.73875 3 9.22077 3 12.1848L3 14.731C3 17.8013 3 19.3364 3.8477 20.4025C4.09058 20.708 4.37862 20.9792 4.70307 21.2078C5.61506 21.8506 6.85019 21.9757 9 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 12C3 10.159 4.49238 8.66667 6.33333 8.66667C6.99912 8.66667 7.78404 8.78333 8.43137 8.60988C9.00652 8.45576 9.45576 8.00652 9.60988 7.43136C9.78333 6.78404 9.66667 5.99912 9.66667 5.33333C9.66667 3.49238 11.1591 2 13 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],M4=[["path",{d:"M8 7L16 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 11L12 11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],dE=[["path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],os=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]],d_=[["path",{d:"M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],fE=[["path",{d:"M12 21C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 15L14 17C14.2426 15.3039 15.7368 14 17.5 14C18.6894 14 19.7402 14.5933 20.3726 15.5M22 20L21 18C20.7574 19.6961 19.2632 21 17.5 21C16.3106 21 15.2598 20.4067 14.6273 19.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],f_=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],f0=[["path",{d:"M6 8L6 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 16V12C18 9.17156 18 7.75735 17.1213 6.87867C16.2426 5.99999 14.8284 5.99999 12 5.99999L11 5.99999M11 5.99999C11 5.29976 12.9943 3.99152 13.5 3.49999M11 5.99999C11 6.70022 12.9943 8.00846 13.5 8.49999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"6",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"18",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],Mh=[["path",{d:"M3.88884 9.66294C4.39329 10 5.09552 10 6.49998 10C7.90445 10 8.60668 10 9.11113 9.66294C9.32951 9.51702 9.51701 9.32952 9.66292 9.11114C9.99998 8.60669 9.99998 7.90446 9.99998 6.5C9.99998 5.09554 9.99998 4.39331 9.66292 3.88886C9.51701 3.67048 9.32951 3.48298 9.11113 3.33706C8.60668 3 7.90445 3 6.49998 3C5.09552 3 4.39329 3 3.88884 3.33706C3.67046 3.48298 3.48296 3.67048 3.33705 3.88886C2.99998 4.39331 2.99998 5.09554 2.99998 6.5C2.99998 7.90446 2.99998 8.60669 3.33705 9.11114C3.48296 9.32952 3.67046 9.51702 3.88884 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.8888 9.66294C15.3933 10 16.0955 10 17.5 10C18.9044 10 19.6067 10 20.1111 9.66294C20.3295 9.51702 20.517 9.32952 20.6629 9.11114C21 8.60669 21 7.90446 21 6.5C21 5.09554 21 4.39331 20.6629 3.88886C20.517 3.67048 20.3295 3.48298 20.1111 3.33706C19.6067 3 18.9044 3 17.5 3C16.0955 3 15.3933 3 14.8888 3.33706C14.6705 3.48298 14.483 3.67048 14.337 3.88886C14 4.39331 14 5.09554 14 6.5C14 7.90446 14 8.60669 14.337 9.11114C14.483 9.32952 14.6705 9.51702 14.8888 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3.88884 20.6629C4.39329 21 5.09552 21 6.49998 21C7.90445 21 8.60668 21 9.11113 20.6629C9.32951 20.517 9.51701 20.3295 9.66292 20.1111C9.99998 19.6067 9.99998 18.9045 9.99998 17.5C9.99998 16.0955 9.99998 15.3933 9.66292 14.8889C9.51701 14.6705 9.32951 14.483 9.11113 14.3371C8.60668 14 7.90445 14 6.49998 14C5.09552 14 4.39329 14 3.88884 14.3371C3.67046 14.483 3.48296 14.6705 3.33705 14.8889C2.99998 15.3933 2.99998 16.0955 2.99998 17.5C2.99998 18.9045 2.99998 19.6067 3.33705 20.1111C3.48296 20.3295 3.67046 20.517 3.88884 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.8888 20.6629C15.3933 21 16.0955 21 17.5 21C18.9044 21 19.6067 21 20.1111 20.6629C20.3295 20.517 20.517 20.3295 20.6629 20.1111C21 19.6067 21 18.9045 21 17.5C21 16.0955 21 15.3933 20.6629 14.8889C20.517 14.6705 20.3295 14.483 20.1111 14.3371C19.6067 14 18.9044 14 17.5 14C16.0955 14 15.3933 14 14.8888 14.3371C14.6705 14.483 14.483 14.6705 14.337 14.8889C14 15.3933 14 16.0955 14 17.5C14 18.9045 14 19.6067 14.337 20.1111C14.483 20.3295 14.6705 20.517 14.8888 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],D4=[["path",{d:"M20.7104 8.70122L21.9186 12.7288C21.9578 12.8592 21.9773 12.9244 21.9879 12.9914L21.9908 13.0118C22 13.079 22 13.147 22 13.2831C22 16.7797 22 18.528 20.9812 19.6669C20.8824 19.7774 20.7774 19.8824 20.6669 19.9812C19.528 21 17.7797 21 14.2831 21H9.71685C6.22026 21 4.47197 21 3.33311 19.9812C3.22259 19.8824 3.11765 19.7774 3.01877 19.6669C2 18.528 2 16.7797 2 13.2831C2 13.147 2 13.079 2.00915 13.0118L2.01215 12.9914C2.02269 12.9244 2.04225 12.8592 2.08136 12.7288L3.28963 8.70122C4.11355 5.95484 4.5255 4.58166 5.5884 3.79083C6.6513 3 8.08495 3 10.9522 3H13.0478C15.9151 3 17.3487 3 18.4116 3.79083C19.4745 4.58166 19.8865 5.95484 20.7104 8.70122Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 13H22",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M17.9888 17H18M13 17H13.0112",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}]],P4=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.0001 17H12.009",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],j4=[["path",{d:"M3 11.9896V14.5C3 17.7998 3 19.4497 4.02513 20.4749C5.05025 21.5 6.70017 21.5 10 21.5H14C17.2998 21.5 18.9497 21.5 19.9749 20.4749C21 19.4497 21 17.7998 21 14.5V11.9896C21 10.3083 21 9.46773 20.6441 8.74005C20.2882 8.01237 19.6247 7.49628 18.2976 6.46411L16.2976 4.90855C14.2331 3.30285 13.2009 2.5 12 2.5C10.7991 2.5 9.76689 3.30285 7.70242 4.90855L5.70241 6.46411C4.37533 7.49628 3.71179 8.01237 3.3559 8.74005C3 9.46773 3 10.3083 3 11.9896Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.0002 17C14.2007 17.6224 13.1504 18 12.0002 18C10.8499 18 9.79971 17.6224 9.00018 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],I4=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],N4=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 8.01172V8.00172",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],B4=[["path",{d:"M15.5 14.5C18.8137 14.5 21.5 11.8137 21.5 8.5C21.5 5.18629 18.8137 2.5 15.5 2.5C12.1863 2.5 9.5 5.18629 9.5 8.5C9.5 9.38041 9.68962 10.2165 10.0303 10.9697L2.5 18.5V21.5H5.5V19.5H7.5V17.5H9.5L13.0303 13.9697C13.7835 14.3104 14.6196 14.5 15.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5 6.5L16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],z4=[["path",{d:"M11.0991 3.00012C7.45013 3.00669 5.53932 3.09629 4.31817 4.31764C3.00034 5.63568 3.00034 7.75704 3.00034 11.9997C3.00034 16.2424 3.00034 18.3638 4.31817 19.6818C5.63599 20.9999 7.75701 20.9999 11.9991 20.9999C16.241 20.9999 18.3621 20.9999 19.6799 19.6818C20.901 18.4605 20.9906 16.5493 20.9972 12.8998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M20.556 3.49612L11.0487 13.0586M20.556 3.49612C20.062 3.00151 16.7343 3.04761 16.0308 3.05762M20.556 3.49612C21.05 3.99074 21.0039 7.32273 20.9939 8.02714",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],zr=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],H4=[["path",{d:"M4 5L20 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 12L20 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M4 19L20 19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],hE=[["path",{d:"M3 6H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 18H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M21 8L19.8462 8.87652C17.9487 10.318 17 11.0388 17 12C17 12.9612 17.9487 13.682 19.8462 15.1235L21 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],F4=[["path",{d:"M15.5 8.5L12 12M12 12L8.5 15.5M12 12L15.5 15.5M12 12L8.5 8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],h_=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18.6461 4.52795C18.2489 4.89346 18 5.41766 18 6C18 7.10457 18.8954 8 20 8C20.3793 8 20.7339 7.89441 21.0361 7.71103C21.6139 7.36038 22 6.72527 22 6C22 4.89543 21.1046 4 20 4C19.4778 4 19.0023 4.20016 18.6461 4.52795ZM18.6461 4.52795C16.8794 2.95541 14.5513 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.6625 21.9833 11.3289 21.9506 11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],rc=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],V4=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],$o=[["path",{d:"M20.0071 14.5662L19.3587 14.1731C18.7986 13.8508 18.3579 13.3564 18.102 12.7634L15.68 7.15102C15.5927 6.94865 15.4729 6.77988 15.328 6.64097C14.6876 6.02689 13.5808 6.28697 13.0432 6.99226C12.0506 8.29448 13.3839 9.52751 13.1022 10.6133L5.35908 6.26089C3.55799 5.28913 2.0024 7.87074 3.79277 9.06333L8.37607 11.6124C7.4934 12.765 5.25512 18.3551 8.12341 20.0599C8.28646 20.1568 8.4672 20.2213 8.64852 20.2773C8.76516 20.3134 8.88186 20.3496 8.99761 20.3857C9.8979 20.6667 11.6003 21.02 12.7668 20.9182C13.9811 20.8123 14.7421 21.4597 15.68 21.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.36184 4.96447C9.75873 5.36011 11.4854 5.24597 12.1223 5.16653M9.36184 4.96447C8.96494 4.56883 8.95358 2.63679 9.03328 2.0019M9.36184 4.96447C10.3829 3.19624 14.4425 0.375691 18.4708 3.19624C20.4175 4.55924 20.6922 5.4182 21 5.99362",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],U4=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],pE=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],mE=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.5 10C7.67157 10 7 9.32843 7 8.5C7 7.67157 7.67157 7 8.5 7C9.32843 7 10 7.67157 10 8.5C10 9.32843 9.32843 10 8.5 10Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.5 17C16.3284 17 17 16.3284 17 15.5C17 14.6716 16.3284 14 15.5 14C14.6716 14 14 14.6716 14 15.5C14 16.3284 14.6716 17 15.5 17Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M10 8.5L17 8.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 15.5L7 15.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],h0=[["path",{d:"M14.4961 2.00027H9.49609C8.66767 2.00027 7.99609 2.67185 7.99609 3.50027C7.99609 4.3287 8.66767 5.00027 9.49609 5.00027H14.4961C15.3245 5.00027 15.9961 4.3287 15.9961 3.50027C15.9961 2.67185 15.3245 2.00027 14.4961 2.00027Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.99609 15.0003H11.4247M7.99609 11.0003H15.9961",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9961 3.50027C17.5496 3.54709 18.4761 3.72035 19.1174 4.36164C19.9961 5.24032 19.9961 6.65451 19.9961 9.4829L19.9961 15.9997C19.9961 18.8282 19.9961 20.2424 19.1174 21.1211C18.2387 21.9997 16.8245 21.9997 13.9961 21.9997L9.99609 21.9997C7.16767 21.9997 5.75346 21.9997 4.87478 21.1211C3.9961 20.2424 3.9961 18.8282 3.99609 15.9998L3.99611 9.48296C3.9961 6.65453 3.9961 5.24031 4.87478 4.36163C5.51606 3.72034 6.44261 3.54708 7.99599 3.50027",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Hf=[["path",{d:"M14.5405 2V4.48622C14.5405 6.23417 14.5405 7.10814 14.7545 7.94715C14.9685 8.78616 15.3879 9.55654 16.2267 11.0973L17.3633 13.1852C19.5008 17.1115 20.5696 19.0747 19.6928 20.53L19.6792 20.5522C18.7896 22 16.5264 22 12 22C7.47357 22 5.21036 22 4.3208 20.5522L4.30725 20.53C3.43045 19.0747 4.49918 17.1115 6.63666 13.1852L7.7733 11.0973C8.61209 9.55654 9.03149 8.78616 9.24548 7.94715C9.45947 7.10814 9.45947 6.23417 9.45947 4.48622V2",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 16.002L9.00868 15.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"1"}],["path",{d:"M15 18.002L15.0087 17.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M8 2L16 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M7.5 11.5563C8.5 10.4029 10.0994 11.2343 12 12.3182C14.5 13.7439 16 12.65 16.5 11.6152",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],W4=[["path",{d:"M5 14.5C5 14.5 6.5 14.5 8.5 18C8.5 18 14.0588 8.83333 19 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ma=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],gE=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],p0=[["path",{d:"M17.0158 16.5V21.282C17.0158 21.6025 16.8064 21.874 16.5174 21.9663M17.0158 16.5L10.8772 12M17.0158 16.5V7.5M7.74691 9.7053L4.25118 7.03035C3.85429 6.72665 3.29466 6.76425 2.94169 7.11833L2.2921 7.76997C1.89399 8.16933 1.90433 8.81995 2.31494 9.20638L5.28343 12M7.74691 9.7053L10.8772 12M7.74691 9.7053L15.8129 2.19186C15.9453 2.06854 16.1193 2 16.3 2C16.3758 2 16.4488 2.01181 16.5174 2.0337M10.8772 12L17.0158 7.5M17.0158 7.5V2.71803C17.0158 2.39749 16.8064 2.126 16.5174 2.0337M7.74691 14.2947L4.25118 16.9696C3.85429 17.2733 3.29466 17.2357 2.94169 16.8817L2.2921 16.23C1.89399 15.8307 1.90433 15.18 2.31494 14.7936L5.28343 12M7.74691 14.2947L15.8129 21.8081C15.9453 21.9315 16.1193 22 16.3 22C16.3758 22 16.4488 21.9882 16.5174 21.9663M7.74691 14.2947L5.28343 12M16.5174 2.0337L21.4111 4.23506C21.7695 4.39626 22.0001 4.75353 22.0001 5.14752V18.8525C22.0001 19.2465 21.7695 19.6037 21.4111 19.7649L16.5174 21.9663",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],m0=R.createContext(void 0);function Ei(e){const t=R.useContext(m0);if(e===!1&&t===void 0)throw new Error(Pt(27));return t}let Dh=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const q4={[Dh.startingStyle]:""},G4={[Dh.endingStyle]:""},Gs={transitionStatus(e){return e==="starting"?q4:e==="ending"?G4:null}};let sa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dh.startingStyle]="startingStyle",e[e.endingStyle=Dh.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),p_=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const $4={[p_.popupOpen]:""},K4={[p_.popupOpen]:"",[p_.pressed]:""},Y4={[sa.open]:""},X4={[sa.closed]:""},Q4={[sa.anchorHidden]:""},g0={open(e){return e?$4:null}},zu={open(e){return e?K4:null}},xo={open(e){return e?Y4:X4},anchorHidden(e){return e?Q4:null}},Z4={...xo,...Gs},vE=R.forwardRef(function(t,n){const{render:s,className:o,forceRender:u=!1,...h}=t,{store:a}=Ei(),l=a.useState("open"),d=a.useState("nested"),p=a.useState("mounted"),f=a.useState("transitionStatus"),g=R.useMemo(()=>({open:l,transitionStatus:f}),[l,f]);return at("div",t,{state:g,ref:[a.context.backdropRef,n],stateAttributesMapping:Z4,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},h],enabled:u||!d})}),Mn="none",pa="trigger-press",Br="trigger-hover",Ph="trigger-focus",v0="outside-press",ma="item-press",J4="close-press",nC="clear-press",ia="input-change",ro="input-clear",Ra="focus-out",gp="escape-key",Du="list-navigation",_E="cancel-open",ku="sibling-open",yE="imperative-action",eD="window-resize";function Ue(e,t,n,s){let o=!1,u=!1;const h=s??tn;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){u=!0},get isCanceled(){return o},get isPropagationAllowed(){return u},trigger:n,...h}}function yu(e,t,n){const s=n??tn;return{reason:e,event:t??new Event("base-ui"),...s}}const vp=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{store:l}=Ei(),d=l.useState("open");function p(C){d&&l.setOpen(!1,Ue(J4,C.nativeEvent))}const{getButtonProps:f,buttonRef:g}=Sr({disabled:u,native:h}),S=R.useMemo(()=>({disabled:u}),[u]);return at("button",t,{state:S,ref:[n,g],props:[{onClick:p},a,f]})}),tD={...ip};let rC=0;function nD(e,t="mui"){const[n,s]=R.useState(e),o=e||n;return R.useEffect(()=>{n==null&&(rC+=1,s(`${t}-${rC}`))},[n,t]),o}const sC=tD.useId;function Da(e,t){if(sC!==void 0){const n=sC();return e??(t?`${t}-${n}`:n)}return nD(e,t)}function ar(e){return Da(e,"base-ui")}const bE=R.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=Ei(),l=ar(u);return a.useSyncedValueWithCleanup("descriptionElementId",l),at("p",t,{ref:n,props:[{id:l},h]})}),rD=[];function xE(e){R.useEffect(e,rD)}const bu=0;class ka{static create(){return new ka}currentId=bu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=bu,n()},t)}isStarted(){return this.currentId!==bu}clear=()=>{this.currentId!==bu&&(clearTimeout(this.currentId),this.currentId=bu)};disposeEffect=()=>this.clear}function Qt(){const e=Gn(ka.create).current;return xE(e.disposeEffect),e}function hn(e){const t=Gn(sD,e).current;return t.next=e,Fe(t.effect),t}function sD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Pa=typeof navigator<"u",vv=aD(),SE=cD(),_0=lD(),y0=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),iD=vv.platform==="MacIntel"&&vv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(vv.platform),iC=Pa&&/firefox/i.test(_0),CE=Pa&&/apple/i.test(navigator.vendor),jh=Pa&&/android/i.test(SE)||/android/i.test(_0),oD=Pa&&SE.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,wE=_0.includes("jsdom/");function aD(){if(!Pa)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function lD(){if(!Pa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function cD(){if(!Pa)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const m_="data-base-ui-focusable",EE="active",RE="selected",kE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",po="ArrowLeft",mo="ArrowRight",b0="ArrowUp",nd="ArrowDown";function _s(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&n_(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Pn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vs(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function uD(e){return e.matches("html,body")}function dn(e){return e?.ownerDocument||document}function x0(e){return en(e)&&e.matches(kE)}function g_(e){return e?e.getAttribute("role")==="combobox"&&x0(e):!1}function dD(e){if(!e||wE)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Hu(e){return e?e.hasAttribute(m_)?e:e.querySelector(`[${m_}]`)||e:null}function ga(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...ga(e,o.id,n)])}function oC(e,t){let n=[],s=e.find(o=>o.id===t)?.parentId;for(;s;){const o=e.find(u=>u.id===s);s=o?.parentId,o&&(n=n.concat(o))}return n}function fn(e){e.preventDefault(),e.stopPropagation()}function fD(e){return"nativeEvent"in e}function TE(e){return e.mozInputSource===0&&e.isTrusted?!0:jh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function LE(e){return wE?!1:!jh&&e.width===0&&e.height===0||jh&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ul(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function AE(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const hD=["top","right","bottom","left"],Wl=Math.min,Nr=Math.max,Ih=Math.round,Rl=Math.floor,Fs=e=>({x:e,y:e}),pD={left:"right",right:"left",bottom:"top",top:"bottom"},mD={start:"end",end:"start"};function v_(e,t,n){return Nr(e,Wl(t,n))}function Ci(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function So(e){return e.split("-")[1]}function S0(e){return e==="x"?"y":"x"}function C0(e){return e==="y"?"height":"width"}const gD=new Set(["top","bottom"]);function rs(e){return gD.has(Hr(e))?"y":"x"}function w0(e){return S0(rs(e))}function vD(e,t,n){n===void 0&&(n=!1);const s=So(e),o=w0(e),u=C0(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=Nh(h)),[h,Nh(h)]}function _D(e){const t=Nh(e);return[__(e),t,__(t)]}function __(e){return e.replace(/start|end/g,t=>mD[t])}const aC=["left","right"],lC=["right","left"],yD=["top","bottom"],bD=["bottom","top"];function xD(e,t,n){switch(e){case"top":case"bottom":return n?t?lC:aC:t?aC:lC;case"left":case"right":return t?yD:bD;default:return[]}}function SD(e,t,n,s){const o=So(e);let u=xD(Hr(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(__)))),u}function Nh(e){return e.replace(/left|right|bottom|top/g,t=>pD[t])}function CD(e){return{top:0,right:0,bottom:0,left:0,...e}}function OE(e){return typeof e!="number"?CD(e):{top:e,right:e,bottom:e,left:e}}function Bh(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function Ff(e,t,n){return Math.floor(e/t)!==n}function Ll(e,t){return t<0||t>=e.current.length}function ph(e,t){return Wn(e,{disabledIndices:t})}function y_(e,t){return Wn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Wn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:o=1}={}){let u=t;do u+=n?-o:o;while(u>=0&&u<=e.current.length-1&&go(e,u,s));return u}function ME(e,{event:t,orientation:n,loopFocus:s,rtl:o,cols:u,disabledIndices:h,minIndex:a,maxIndex:l,prevIndex:d,stopEvent:p=!1}){let f=d;const g=[],S={};let C=!1;{let x=null,_=-1;e.current.forEach((y,E)=>{if(y==null)return;const T=y.closest('[role="row"]');T&&(C=!0),(T!==x||_===-1)&&(x=T,_+=1,g[_]=[]),g[_].push(E),S[E]=_})}const w=C&&g.length>0&&g.some(x=>x.length!==u);function b(x){if(!w||d===-1)return;const _=S[d];if(_==null)return;const y=g[_].indexOf(d);let E=x==="up"?_-1:_+1;s&&(E<0?E=g.length-1:E>=g.length&&(E=0));const T=new Set;for(;E>=0&&E<g.length&&!T.has(E);){T.add(E);const A=g[E];if(A.length===0){E=x==="up"?E-1:E+1;continue}const M=Math.min(y,A.length-1);for(let L=M;L>=0;L-=1){const D=A[L];if(!go(e,D,h))return D}E=x==="up"?E-1:E+1,s&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===b0){const x=b("up");if(x!==void 0)p&&fn(t),f=x;else{if(p&&fn(t),d===-1)f=l;else if(f=Wn(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:h}),s&&(d-u<a||f<0)){const _=d%u,y=l%u,E=l-(y-_);y===_?f=l:f=y>_?E:E-u}Ll(e,f)&&(f=d)}}if(t.key===nd){const x=b("down");x!==void 0?(p&&fn(t),f=x):(p&&fn(t),d===-1?f=a:(f=Wn(e,{startingIndex:d,amount:u,disabledIndices:h}),s&&d+u>l&&(f=Wn(e,{startingIndex:d%u-u,amount:u,disabledIndices:h}))),Ll(e,f)&&(f=d))}if(n==="both"){const x=Rl(d/u);t.key===(o?po:mo)&&(p&&fn(t),d%u!==u-1?(f=Wn(e,{startingIndex:d,disabledIndices:h}),s&&Ff(f,u,x)&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h})),Ff(f,u,x)&&(f=d)),t.key===(o?mo:po)&&(p&&fn(t),d%u!==0?(f=Wn(e,{startingIndex:d,decrement:!0,disabledIndices:h}),s&&Ff(f,u,x)&&(f=Wn(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h})),Ff(f,u,x)&&(f=d));const _=Rl(l/u)===x;Ll(e,f)&&(s&&_?f=t.key===(o?mo:po)?l:Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}):f=d)}return f}function DE(e,t,n){const s=[];let o=0;return e.forEach(({width:u,height:h},a)=>{let l=!1;for(n&&(o=0);!l;){const d=[];for(let p=0;p<u;p+=1)for(let f=0;f<h;f+=1)d.push(o+p+f*t);o%t+u<=t&&d.every(p=>s[p]==null)?(d.forEach(p=>{s[p]=a}),l=!0):o+=1}}),[...s]}function PE(e,t,n,s,o){if(e===-1)return-1;const u=n.indexOf(e),h=t[e];switch(o){case"tl":return u;case"tr":return h?u+h.width-1:u;case"bl":return h?u+(h.height-1)*s:u;case"br":return n.lastIndexOf(e);default:return-1}}function jE(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function go(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var wD=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zh=wD.join(","),IE=typeof Element>"u",ql=IE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hh=!IE&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Fu=function(t,n){var s;n===void 0&&(n=!0);var o=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),u=o===""||o==="true",h=u||n&&t&&Fu(t.parentNode);return h},ED=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},NE=function(t,n,s){if(Fu(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(zh));return n&&ql.call(t,zh)&&o.unshift(t),o=o.filter(s),o},Fh=function(t,n,s){for(var o=[],u=Array.from(t);u.length;){var h=u.shift();if(!Fu(h,!1))if(h.tagName==="SLOT"){var a=h.assignedElements(),l=a.length?a:h.children,d=Fh(l,!0,s);s.flatten?o.push.apply(o,d):o.push({scopeParent:h,candidates:d})}else{var p=ql.call(h,zh);p&&s.filter(h)&&(n||!t.includes(h))&&o.push(h);var f=h.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(h),g=!Fu(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(h));if(f&&g){var S=Fh(f===!0?h.children:f.children,!0,s);s.flatten?o.push.apply(o,S):o.push({scopeParent:h,candidates:S})}else u.unshift.apply(u,h.children)}}return o},BE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},zE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ED(t))&&!BE(t)?0:t.tabIndex},RD=function(t,n){var s=zE(t);return s<0&&n&&!BE(t)?0:s},kD=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},HE=function(t){return t.tagName==="INPUT"},TD=function(t){return HE(t)&&t.type==="hidden"},LD=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},AD=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},OD=function(t){if(!t.name)return!0;var n=t.form||Hh(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=s(window.CSS.escape(t.name));else try{o=s(t.name)}catch(h){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",h.message),!1}var u=AD(o,t.form);return!u||u===t},MD=function(t){return HE(t)&&t.type==="radio"},DD=function(t){return MD(t)&&!OD(t)},PD=function(t){var n,s=t&&Hh(t),o=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var h,a,l;for(u=!!((h=o)!==null&&h!==void 0&&(a=h.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!u&&o;){var d,p,f;s=Hh(o),o=(d=s)===null||d===void 0?void 0:d.host,u=!!((p=o)!==null&&p!==void 0&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return u},cC=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},jD=function(t,n){var s=n.displayCheck,o=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var u=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!u}if(getComputedStyle(t).visibility==="hidden")return!0;var h=ql.call(t,"details>summary:first-of-type"),a=h?t.parentElement:t;if(ql.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var d=t.parentElement,p=Hh(t);if(d&&!d.shadowRoot&&o(d)===!0)return cC(t);t.assignedSlot?t=t.assignedSlot:!d&&p!==t.ownerDocument?t=p.host:t=d}t=l}if(PD(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return cC(t);return!1},ID=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var o=n.children.item(s);if(o.tagName==="LEGEND")return ql.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},b_=function(t,n){return!(n.disabled||Fu(n)||TD(n)||jD(n,t)||LD(n)||ID(n))},x_=function(t,n){return!(DD(n)||zE(n)<0||!b_(t,n))},ND=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},FE=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,l=RD(a,h),d=h?FE(o.candidates):a;l===0?h?n.push.apply(n,d):n.push(a):s.push({documentOrder:u,tabIndex:l,item:o,isScope:h,content:d})}),s.sort(kD).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},rd=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Fh([t],n.includeContainer,{filter:x_.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ND}):s=NE(t,n.includeContainer,x_.bind(null,n)),FE(s)},BD=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Fh([t],n.includeContainer,{filter:b_.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=NE(t,n.includeContainer,b_.bind(null,n)),s},VE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ql.call(t,zh)===!1?!1:x_(n,t)};const sc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function UE(e,t){const n=rd(e,sc()),s=n.length;if(s===0)return;const o=_s(dn(e)),u=n.indexOf(o),h=u===-1?t===1?0:s-1:u+t;return n[h]}function E0(e){return UE(dn(e).body,1)||e}function WE(e){return UE(dn(e).body,-1)||e}function qE(e,t){if(!e)return null;const n=rd(dn(e).body,sc()),s=n.length;if(s===0)return null;const o=n.indexOf(e);if(o===-1)return null;const u=(o+t+s)%s;return n[u]}function zD(e){return qE(e,1)}function HD(e){return qE(e,-1)}function Al(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!ft(n,s)}function FD(e){rd(e,sc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function uC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function GE(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class R0{nodesRef={current:[]};events=GE();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(s=>s===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const $E=R.createContext(null),KE=R.createContext(null),Ri=()=>R.useContext($E)?.id||null,Co=e=>{const t=R.useContext(KE);return e??t};function YE(e){const t=Da(),n=Co(e),s=Ri();return Fe(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function VD(e){const{children:t,id:n}=e,s=Ri();return v.jsx($E.Provider,{value:R.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function UD(e){const{children:t,externalTree:n}=e,s=Gn(()=>n??new R0).current;return v.jsx(KE.Provider,{value:s,children:t})}function Gl(e){return`data-base-ui-${e}`}function _v(e,t,n){if(n&&!Ul(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const s=e();return typeof s=="number"?s:s?.[t]}return e?.[t]}const ic={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Vf=null;class WD{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Uf=new WD;class Ns{static create(){return new Ns}static request(t){return Uf.request(t)}static cancel(t){return Uf.cancel(t)}currentId=Vf;request(t){this.cancel(),this.currentId=Uf.request(()=>{this.currentId=Vf,t()})}cancel=()=>{this.currentId!==Vf&&(Uf.cancel(this.currentId),this.currentId=Vf)};disposeEffect=()=>this.cancel}function sd(){const e=Gn(Ns.create).current;return xE(e.disposeEffect),e}function xr(e){return e?.ownerDocument||document}const $l=R.forwardRef(function(t,n){const[s,o]=R.useState();Fe(()=>{CE&&o("button")},[]);const u={tabIndex:0,role:s};return v.jsx("span",{...t,ref:n,style:ic,"aria-hidden":s?void 0:!0,...u,"data-base-ui-focus-guard":""})});let dC=0;function mh(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(dC);const u=()=>e?.focus({preventScroll:n});o?u():dC=requestAnimationFrame(u)}const Ol={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function fC(e){return e==="inert"?Ol.inert:e==="aria-hidden"?Ol["aria-hidden"]:Ol.none}let Wf=new WeakSet,qf={},yv=0;const XE=e=>e&&(e.host||XE(e.parentNode)),qD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=XE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function GD(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=qD(t,e),a=new Set,l=new Set(h),d=[];qf[o]||(qf[o]=new WeakMap);const p=qf[o];h.forEach(f),g(t),a.clear();function f(S){!S||a.has(S)||(a.add(S),S.parentNode&&f(S.parentNode))}function g(S){!S||l.has(S)||[].forEach.call(S.children,C=>{if(bo(C)!=="script")if(a.has(C))g(C);else{const w=u?C.getAttribute(u):null,b=w!==null&&w!=="false",x=fC(u),_=(x.get(C)||0)+1,y=(p.get(C)||0)+1;x.set(C,_),p.set(C,y),d.push(C),_===1&&b&&Wf.add(C),y===1&&C.setAttribute(o,""),!b&&u&&C.setAttribute(u,u==="inert"?"":"true")}})}return yv+=1,()=>{d.forEach(S=>{const C=fC(u),b=(C.get(S)||0)-1,x=(p.get(S)||0)-1;C.set(S,b),p.set(S,x),b||(!Wf.has(S)&&u&&S.removeAttribute(u),Wf.delete(S)),x||S.removeAttribute(o)}),yv-=1,yv||(Ol.inert=new WeakMap,Ol["aria-hidden"]=new WeakMap,Ol.none=new WeakMap,Wf=new WeakSet,qf={})}}function $D(e,t=!1,n=!1){const s=dn(e[0]).body;return GD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const QE=R.createContext(null),ZE=()=>R.useContext(QE),KD=Gl("portal");function YD(e={}){const{ref:t,container:n,componentProps:s=tn,elementProps:o,elementState:u}=e,h=Da(),l=ZE()?.portalNode,[d,p]=R.useState(null),[f,g]=R.useState(null),S=R.useRef(null);Fe(()=>{if(n===null){S.current&&(S.current=null,g(null),p(null));return}if(h==null)return;const b=(n&&(s0(n)?n:n.current))??l??document.body;if(b==null){S.current&&(S.current=null,g(null),p(null));return}S.current!==b&&(S.current=b,g(null),p(b))},[n,l,h]);const C=at("div",s,{ref:[t,g],state:u,props:[{id:h,[KD]:""},o]});return{portalNode:f,portalSubtree:d&&C?er.createPortal(C,d):null}}const _p=R.forwardRef(function(t,n){const{children:s,container:o,className:u,render:h,renderGuards:a,...l}=t,{portalNode:d,portalSubtree:p}=YD({container:o,ref:n,componentProps:t,elementProps:l}),f=R.useRef(null),g=R.useRef(null),S=R.useRef(null),C=R.useRef(null),[w,b]=R.useState(null),x=w?.modal,_=w?.open,y=typeof a=="boolean"?a:!!w&&!w.modal&&w.open&&!!d;R.useEffect(()=>{if(!d||x)return;function T(A){d&&Al(A)&&(A.type==="focusin"?uC:FD)(d)}return d.addEventListener("focusin",T,!0),d.addEventListener("focusout",T,!0),()=>{d.removeEventListener("focusin",T,!0),d.removeEventListener("focusout",T,!0)}},[d,x]),R.useEffect(()=>{!d||_||uC(d)},[_,d]);const E=R.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:S,afterInsideRef:C,portalNode:d,setFocusManagerState:b}),[d]);return v.jsxs(R.Fragment,{children:[p,v.jsxs(QE.Provider,{value:E,children:[y&&d&&v.jsx($l,{"data-type":"outside",ref:f,onFocus:T=>{if(Al(T,d))S.current?.focus();else{const A=w?w.domReference:null;WE(A)?.focus()}}}),y&&d&&v.jsx("span",{"aria-owns":d.id,style:OM}),d&&er.createPortal(s,d),y&&d&&v.jsx($l,{"data-type":"outside",ref:g,onFocus:T=>{if(Al(T,d))C.current?.focus();else{const A=w?w.domReference:null;E0(A)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Ue(Ra,T.nativeEvent))}}})]})]})});function Qo(e){return e==null?e:"current"in e?e.current:e}function XD(e,t){const n=Rn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const hC=20;let oo=[];function k0(){oo=oo.filter(e=>e.isConnected)}function QD(e){k0(),e&&bo(e)!=="body"&&(oo.push(e),oo.length>hC&&(oo=oo.slice(-hC)))}function bv(){return k0(),oo[oo.length-1]}function ZD(e){if(!e)return null;const t=sc();return VE(e,t)?e:rd(e,t)[0]||e}function JD(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Fr(e).display!=="none"}function pC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=sc(),o=BD(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return VE(h,n)||h.hasAttribute("data-tabindex")&&!a.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?u!=="0"&&e.setAttribute("tabindex","0"):(u!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function yp(e){const{context:t,children:n,disabled:s=!1,order:o=["content"],initialFocus:u=!0,returnFocus:h=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:d=!0,openInteractionType:p="",getInsideElements:f=()=>[],nextFocusableElement:g,previousFocusableElement:S,beforeContentFocusGuardRef:C,externalTree:w}=e,b="rootStore"in t?t.rootStore:t,x=b.useState("open"),_=b.useState("domReferenceElement"),y=b.useState("floatingElement"),{events:E,dataRef:T}=b.context,A=Pe(()=>T.current.floatingContext?.nodeId),M=Pe(f),L=u===!1,D=g_(_)&&L,z=hn(o),H=hn(u),$=hn(h),N=hn(p),q=Co(w),K=ZE(),V=R.useRef(null),Y=R.useRef(null),G=R.useRef(!1),j=R.useRef(!1),W=R.useRef(!1),P=R.useRef(-1),I=R.useRef(""),F=R.useRef(""),X=Qt(),te=Qt(),ee=sd(),Q=K!=null,U=Hu(y),se=Pe((ue=U)=>ue?rd(ue,sc()):[]),ne=Pe(ue=>{const de=se(ue);return z.current.map(()=>de).filter(Boolean).flat()});R.useEffect(()=>{if(s||!l)return;function ue(Ie){Ie.key==="Tab"&&ft(U,_s(dn(U)))&&se().length===0&&!D&&fn(Ie)}const de=dn(U);return de.addEventListener("keydown",ue),()=>{de.removeEventListener("keydown",ue)}},[s,_,U,l,z,D,se,ne]),R.useEffect(()=>{if(s||!y)return;function ue(de){const Ie=Pn(de),Oe=se().indexOf(Ie);Oe!==-1&&(P.current=Oe)}return y.addEventListener("focusin",ue),()=>{y.removeEventListener("focusin",ue)}},[s,y,se]),R.useEffect(()=>{if(s||!x)return;const ue=dn(U);function de(){W.current=!1}function Ie(Oe){const be=Pn(Oe),Me=ft(y,be)||ft(_,be)||ft(K?.portalNode,be);W.current=!Me,F.current=Oe.pointerType||"keyboard"}function De(){F.current="keyboard"}return ue.addEventListener("pointerdown",Ie,!0),ue.addEventListener("pointerup",de,!0),ue.addEventListener("pointercancel",de,!0),ue.addEventListener("keydown",De,!0),()=>{ue.removeEventListener("pointerdown",Ie,!0),ue.removeEventListener("pointerup",de,!0),ue.removeEventListener("pointercancel",de,!0),ue.removeEventListener("keydown",De,!0)}},[s,y,_,U,x,K]),R.useEffect(()=>{if(s||!d)return;function ue(){j.current=!0,te.start(0,()=>{j.current=!1})}function de(be){const Me=be.relatedTarget,pe=be.currentTarget,ke=Pn(be);queueMicrotask(()=>{const we=A(),We=b.context.triggerElements,et=!(ft(_,Me)||ft(y,Me)||ft(Me,y)||ft(K?.portalNode,Me)||Me!=null&&We.hasElement(Me)||We.hasMatchingElement(xe=>ft(xe,Me))||Me?.hasAttribute(Gl("focus-guard"))||q&&(ga(q.nodesRef.current,we).find(xe=>ft(xe.context?.elements.floating,Me)||ft(xe.context?.elements.domReference,Me))||oC(q.nodesRef.current,we).find(xe=>[xe.context?.elements.floating,Hu(xe.context?.elements.floating)].includes(Me)||xe.context?.elements.domReference===Me)));if(pe===_&&U&&pC(U,z),a&&pe!==_&&!JD(ke)&&_s(dn(U))===dn(U).body){if(en(U)&&(U.focus(),a==="popup")){ee.request(()=>{U.focus()});return}const xe=P.current,Ge=se(),tt=Ge[xe]||Ge[Ge.length-1]||U;en(tt)&&tt.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(D||!l)&&Me&&et&&!j.current&&(D||Me!==bv())&&(G.current=!0,b.setOpen(!1,Ue(Ra,be)))})}function Ie(){W.current||(T.current.insideReactTree=!0,X.start(0,()=>{T.current.insideReactTree=!1}))}const De=en(_)?_:null,Oe=[];if(!(!y&&!De))return De&&(De.addEventListener("focusout",de),De.addEventListener("pointerdown",ue),Oe.push(()=>{De.removeEventListener("focusout",de),De.removeEventListener("pointerdown",ue)})),y&&(y.addEventListener("focusout",de),K&&(y.addEventListener("focusout",Ie,!0),Oe.push(()=>{y.removeEventListener("focusout",Ie,!0)})),Oe.push(()=>{y.removeEventListener("focusout",de)})),()=>{Oe.forEach(be=>{be()})}},[s,_,y,U,l,q,K,b,d,a,se,D,A,z,T,X,te,ee]);const re=R.useRef(null),oe=R.useRef(null),le=cs(re,C,K?.beforeInsideRef),_e=cs(oe,K?.afterInsideRef);R.useEffect(()=>{if(s||!y||!x)return;const ue=Array.from(K?.portalNode?.querySelectorAll(`[${Gl("portal")}]`)||[]),Ie=(q?oC(q.nodesRef.current,A()):[]).find(be=>g_(be.context?.elements.domReference||null))?.context?.elements.domReference,De=[y,Ie,...ue,...M(),V.current,Y.current,re.current,oe.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,Qo(S),Qo(g),D?_:null].filter(be=>be!=null),Oe=$D(De,l||D);return()=>{Oe()}},[x,s,_,y,l,z,K,D,q,A,M,g,S]),Fe(()=>{if(!x||s||!en(U))return;const ue=dn(U),de=_s(ue);queueMicrotask(()=>{const Ie=ne(U),De=H.current,Oe=typeof De=="function"?De(N.current||""):De;if(Oe===void 0||Oe===!1)return;let be;Oe===!0||Oe===null?be=Ie[0]||U:be=Qo(Oe),be=be||Ie[0]||U,!ft(U,de)&&mh(be,{preventScroll:be===U})})},[s,x,U,L,ne,H,N]),Fe(()=>{if(s||!U)return;const ue=dn(U),de=_s(ue);QD(de);function Ie(be){if(be.open||(I.current=XD(be.nativeEvent,F.current)),be.reason===Br&&be.nativeEvent.type==="mouseleave"&&(G.current=!0),be.reason===v0)if(be.nested)G.current=!1;else if(TE(be.nativeEvent)||LE(be.nativeEvent))G.current=!1;else{let Me=!1;document.createElement("div").focus({get preventScroll(){return Me=!0,!1}}),Me?G.current=!1:G.current=!0}}E.on("openchange",Ie);const De=ue.createElement("span");De.setAttribute("tabindex","-1"),De.setAttribute("aria-hidden","true"),Object.assign(De.style,ic),Q&&_&&_.insertAdjacentElement("afterend",De);function Oe(){const be=$.current;let Me=typeof be=="function"?be(I.current):be;if(Me===void 0||Me===!1)return null;if(Me===null&&(Me=!0),typeof Me=="boolean"){const ke=_||bv();return ke&&ke.isConnected?ke:De}const pe=_||bv()||De;return Qo(Me)||pe}return()=>{E.off("openchange",Ie);const be=_s(ue),Me=ft(y,be)||q&&ga(q.nodesRef.current,A(),!1).some(ke=>ft(ke.context?.elements.floating,be)),pe=Oe();queueMicrotask(()=>{const ke=ZD(pe),we=typeof $.current!="boolean";$.current&&!G.current&&en(ke)&&(!(!we&&ke!==be&&be!==ue.body)||Me)&&ke.focus({preventScroll:!0}),De.remove()})}},[s,y,U,$,T,E,q,Q,_,A]),R.useEffect(()=>{queueMicrotask(()=>{G.current=!1})},[s]),R.useEffect(()=>{if(s||!x)return;function ue(Ie){Pn(Ie)?.closest(`[${$2}]`)&&(j.current=!0)}const de=dn(U);return de.addEventListener("pointerdown",ue,!0),()=>{de.removeEventListener("pointerdown",ue,!0)}},[s,x,U]),Fe(()=>{if(!s&&K)return K.setFocusManagerState({modal:l,closeOnFocusOut:d,open:x,onOpenChange:b.setOpen,domReference:_}),()=>{K.setFocusManagerState(null)}},[s,K,l,x,b,d,_]),Fe(()=>{if(!(s||!U))return pC(U,z),()=>{queueMicrotask(k0)}},[s,U,z]);const ge=!s&&(l?!D:!0)&&(Q||l);return v.jsxs(R.Fragment,{children:[ge&&v.jsx($l,{"data-type":"inside",ref:le,onFocus:ue=>{if(l){const de=ne();mh(de[de.length-1])}else K?.portalNode&&(G.current=!1,Al(ue,K.portalNode)?E0(_)?.focus():Qo(S??K.beforeOutsideRef)?.focus())}}),n,ge&&v.jsx($l,{"data-type":"inside",ref:_e,onFocus:ue=>{l?mh(ne()[0]):K?.portalNode&&(d&&(G.current=!0),Al(ue,K.portalNode)?WE(_)?.focus():Qo(g??K.afterOutsideRef)?.focus())}})]})}function id(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.context.dataRef,{enabled:o=!0,event:u="click",toggle:h=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:d=0}=t,p=R.useRef(void 0),f=sd(),g=Qt(),S=R.useMemo(()=>({onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const w=p.current,b=C.nativeEvent,x=n.select("open");if(C.button!==0||u==="click"||Ul(w,!0)&&a)return;const _=s.current.openEvent,y=_?.type,E=n.select("domReferenceElement")!==C.currentTarget,T=x&&E||!(x&&h&&(!(_&&l)||y==="click"||y==="mousedown"));if(x0(b.target)){const M=Ue(pa,b,b.target);T&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M);return}const A=C.currentTarget;f.request(()=>{const M=Ue(pa,b,A);T&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M)})},onClick(C){if(u==="mousedown-only")return;const w=p.current;if(u==="mousedown"&&w){p.current=void 0;return}if(Ul(w,!0)&&a)return;const b=n.select("open"),x=s.current.openEvent,_=n.select("domReferenceElement")!==C.currentTarget,y=b&&_||!(b&&h&&(!(x&&l)||AE(x))),E=Ue(pa,C.nativeEvent,C.currentTarget);y&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(y,E)},onKeyDown(){p.current=void 0}}),[s,u,a,n,l,h,f,g,d]);return R.useMemo(()=>o?{reference:S}:tn,[o,S])}function mC(e,t,n){let{reference:s,floating:o}=e;const u=rs(t),h=w0(t),a=C0(h),l=Hr(t),d=u==="y",p=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,g=s[a]/2-o[a]/2;let S;switch(l){case"top":S={x:p,y:s.y-o.height};break;case"bottom":S={x:p,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:f};break;case"left":S={x:s.x-o.width,y:f};break;default:S={x:s.x,y:s.y}}switch(So(t)){case"start":S[h]-=g*(n&&d?-1:1);break;case"end":S[h]+=g*(n&&d?-1:1);break}return S}const e6=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:h}=n,a=u.filter(Boolean),l=await(h.isRTL==null?void 0:h.isRTL(t));let d=await h.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=mC(d,s,l),g=s,S={},C=0;for(let w=0;w<a.length;w++){const{name:b,fn:x}=a[w],{x:_,y,data:E,reset:T}=await x({x:p,y:f,initialPlacement:s,placement:g,strategy:o,middlewareData:S,rects:d,platform:h,elements:{reference:e,floating:t}});p=_??p,f=y??f,S={...S,[b]:{...S[b],...E}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(d=T.rects===!0?await h.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:p,y:f}=mC(d,g,l)),w=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:S}};async function Vu(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:h,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:S=0}=Ci(t,e),C=OE(S),b=a[g?f==="floating"?"reference":"floating":f],x=Bh(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(b)))==null||n?b:b.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:l})),_=f==="floating"?{x:s,y:o,width:h.floating.width,height:h.floating.height}:h.reference,y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(y))?await(u.getScale==null?void 0:u.getScale(y))||{x:1,y:1}:{x:1,y:1},T=Bh(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:y,strategy:l}):_);return{top:(x.top-T.top+C.top)/E.y,bottom:(T.bottom-x.bottom+C.bottom)/E.y,left:(x.left-T.left+C.left)/E.x,right:(T.right-x.right+C.right)/E.x}}const t6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:u,rects:h,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...b}=Ci(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const x=Hr(o),_=rs(a),y=Hr(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(d.floating)),T=g||(y||!w?[Nh(a)]:_D(a)),A=C!=="none";!g&&A&&T.push(...SD(a,w,C,E));const M=[a,...T],L=await Vu(t,b),D=[];let z=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&D.push(L[x]),f){const q=vD(o,h,E);D.push(L[q[0]],L[q[1]])}if(z=[...z,{placement:o,overflows:D}],!D.every(q=>q<=0)){var H,$;const q=(((H=u.flip)==null?void 0:H.index)||0)+1,K=M[q];if(K&&(!(f==="alignment"?_!==rs(K):!1)||z.every(G=>rs(G.placement)===_?G.overflows[0]>0:!0)))return{data:{index:q,overflows:z},reset:{placement:K}};let V=($=z.filter(Y=>Y.overflows[0]<=0).sort((Y,G)=>Y.overflows[1]-G.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(S){case"bestFit":{var N;const Y=(N=z.filter(G=>{if(A){const j=rs(G.placement);return j===_||j==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(j=>j>0).reduce((j,W)=>j+W,0)]).sort((G,j)=>G[1]-j[1])[0])==null?void 0:N[0];Y&&(V=Y);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function gC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vC(e){return hD.some(t=>e[t]>=0)}const n6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...o}=Ci(e,t);switch(s){case"referenceHidden":{const u=await Vu(t,{...o,elementContext:"reference"}),h=gC(u,n.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:vC(h)}}}case"escaped":{const u=await Vu(t,{...o,altBoundary:!0}),h=gC(u,n.floating);return{data:{escapedOffsets:h,escaped:vC(h)}}}default:return{}}}}},JE=new Set(["left","top"]);async function r6(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),h=Hr(n),a=So(n),l=rs(n)==="y",d=JE.has(h)?-1:1,p=u&&l?-1:1,f=Ci(t,e);let{mainAxis:g,crossAxis:S,alignmentAxis:C}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof C=="number"&&(S=a==="end"?C*-1:C),l?{x:S*p,y:g*d}:{x:g*d,y:S*p}}const s6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:u,placement:h,middlewareData:a}=t,l=await r6(t,e);return h===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:o+l.x,y:u+l.y,data:{...l,placement:h}}}}},i6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:a={fn:b=>{let{x,y:_}=b;return{x,y:_}}},...l}=Ci(e,t),d={x:n,y:s},p=await Vu(t,l),f=rs(Hr(o)),g=S0(f);let S=d[g],C=d[f];if(u){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",_=S+p[b],y=S-p[x];S=v_(_,S,y)}if(h){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",_=C+p[b],y=C-p[x];C=v_(_,C,y)}const w=a.fn({...t,[g]:S,[f]:C});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[g]:u,[f]:h}}}}}},o6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:o,rects:u,middlewareData:h}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=Ci(e,t),p={x:n,y:s},f=rs(o),g=S0(f);let S=p[g],C=p[f];const w=Ci(a,t),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const y=g==="y"?"height":"width",E=u.reference[g]-u.floating[y]+b.mainAxis,T=u.reference[g]+u.reference[y]-b.mainAxis;S<E?S=E:S>T&&(S=T)}if(d){var x,_;const y=g==="y"?"width":"height",E=JE.has(Hr(o)),T=u.reference[f]-u.floating[y]+(E&&((x=h.offset)==null?void 0:x[f])||0)+(E?0:b.crossAxis),A=u.reference[f]+u.reference[y]+(E?0:((_=h.offset)==null?void 0:_[f])||0)-(E?b.crossAxis:0);C<T?C=T:C>A&&(C=A)}return{[g]:S,[f]:C}}}},a6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:o,rects:u,platform:h,elements:a}=t,{apply:l=()=>{},...d}=Ci(e,t),p=await Vu(t,d),f=Hr(o),g=So(o),S=rs(o)==="y",{width:C,height:w}=u.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=g===(await(h.isRTL==null?void 0:h.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,b=g==="end"?"top":"bottom");const _=w-p.top-p.bottom,y=C-p.left-p.right,E=Wl(w-p[b],_),T=Wl(C-p[x],y),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=y),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=_),A&&!g){const z=Nr(p.left,0),H=Nr(p.right,0),$=Nr(p.top,0),N=Nr(p.bottom,0);S?L=C-2*(z!==0||H!==0?z+H:Nr(p.left,p.right)):M=w-2*($!==0||N!==0?$+N:Nr(p.top,p.bottom))}await l({...t,availableWidth:L,availableHeight:M});const D=await h.getDimensions(a.floating);return C!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function eR(e){const t=Fr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=en(e),u=o?e.offsetWidth:n,h=o?e.offsetHeight:s,a=Ih(n)!==u||Ih(s)!==h;return a&&(n=u,s=h),{width:n,height:s,$:a}}function T0(e){return Nt(e)?e:e.contextElement}function Ml(e){const t=T0(e);if(!en(t))return Fs(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=eR(t);let h=(u?Ih(n.width):n.width)/s,a=(u?Ih(n.height):n.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!a||!Number.isFinite(a))&&(a=1),{x:h,y:a}}const l6=Fs(0);function tR(e){const t=Rn(e);return!fp()||!t.visualViewport?l6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function c6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rn(e)?!1:t}function Ta(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=T0(e);let h=Fs(1);t&&(s?Nt(s)&&(h=Ml(s)):h=Ml(e));const a=c6(u,n,s)?tR(u):Fs(0);let l=(o.left+a.x)/h.x,d=(o.top+a.y)/h.y,p=o.width/h.x,f=o.height/h.y;if(u){const g=Rn(u),S=s&&Nt(s)?Rn(s):s;let C=g,w=r_(C);for(;w&&s&&S!==C;){const b=Ml(w),x=w.getBoundingClientRect(),_=Fr(w),y=x.left+(w.clientLeft+parseFloat(_.paddingLeft))*b.x,E=x.top+(w.clientTop+parseFloat(_.paddingTop))*b.y;l*=b.x,d*=b.y,p*=b.x,f*=b.y,l+=y,d+=E,C=Rn(w),w=r_(C)}}return Bh({width:p,height:f,x:l,y:d})}function bp(e,t){const n=hp(e).scrollLeft;return t?t.left+n:Ta(qs(e)).left+n}function nR(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-bp(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function u6(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",h=qs(s),a=t?dp(t.floating):!1;if(s===h||a&&u)return n;let l={scrollLeft:0,scrollTop:0},d=Fs(1);const p=Fs(0),f=en(s);if((f||!f&&!u)&&((bo(s)!=="body"||Aa(h))&&(l=hp(s)),en(s))){const S=Ta(s);d=Ml(s),p.x=S.x+s.clientLeft,p.y=S.y+s.clientTop}const g=h&&!f&&!u?nR(h,l):Fs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-l.scrollTop*d.y+p.y+g.y}}function d6(e){return Array.from(e.getClientRects())}function f6(e){const t=qs(e),n=hp(e),s=e.ownerDocument.body,o=Nr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=Nr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+bp(e);const a=-n.scrollTop;return Fr(s).direction==="rtl"&&(h+=Nr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const _C=25;function h6(e,t){const n=Rn(e),s=qs(e),o=n.visualViewport;let u=s.clientWidth,h=s.clientHeight,a=0,l=0;if(o){u=o.width,h=o.height;const p=fp();(!p||p&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=bp(s);if(d<=0){const p=s.ownerDocument,f=p.body,g=getComputedStyle(f),S=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(s.clientWidth-f.clientWidth-S);C<=_C&&(u-=C)}else d<=_C&&(u+=d);return{width:u,height:h,x:a,y:l}}const p6=new Set(["absolute","fixed"]);function m6(e,t){const n=Ta(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=en(e)?Ml(e):Fs(1),h=e.clientWidth*u.x,a=e.clientHeight*u.y,l=o*u.x,d=s*u.y;return{width:h,height:a,x:l,y:d}}function yC(e,t,n){let s;if(t==="viewport")s=h6(e,n);else if(t==="document")s=f6(qs(e));else if(Nt(t))s=m6(t,n);else{const o=tR(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Bh(s)}function rR(e,t){const n=Us(e);return n===t||!Nt(n)||Hs(n)?!1:Fr(n).position==="fixed"||rR(n,t)}function g6(e,t){const n=t.get(e);if(n)return n;let s=ho(e,[],!1).filter(a=>Nt(a)&&bo(a)!=="body"),o=null;const u=Fr(e).position==="fixed";let h=u?Us(e):e;for(;Nt(h)&&!Hs(h);){const a=Fr(h),l=i0(h);!l&&a.position==="fixed"&&(o=null),(u?!l&&!o:!l&&a.position==="static"&&!!o&&p6.has(o.position)||Aa(h)&&!l&&rR(e,h))?s=s.filter(p=>p!==h):o=a,h=Us(h)}return t.set(e,s),s}function v6(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?dp(t)?[]:g6(t,this._c):[].concat(n),s],a=h[0],l=h.reduce((d,p)=>{const f=yC(t,p,o);return d.top=Nr(f.top,d.top),d.right=Wl(f.right,d.right),d.bottom=Wl(f.bottom,d.bottom),d.left=Nr(f.left,d.left),d},yC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function _6(e){const{width:t,height:n}=eR(e);return{width:t,height:n}}function y6(e,t,n){const s=en(t),o=qs(t),u=n==="fixed",h=Ta(e,!0,u,t);let a={scrollLeft:0,scrollTop:0};const l=Fs(0);function d(){l.x=bp(o)}if(s||!s&&!u)if((bo(t)!=="body"||Aa(o))&&(a=hp(t)),s){const S=Ta(t,!0,u,t);l.x=S.x+t.clientLeft,l.y=S.y+t.clientTop}else o&&d();u&&!s&&o&&d();const p=o&&!s&&!u?nR(o,a):Fs(0),f=h.left+a.scrollLeft-l.x-p.x,g=h.top+a.scrollTop-l.y-p.y;return{x:f,y:g,width:h.width,height:h.height}}function xv(e){return Fr(e).position==="static"}function bC(e,t){if(!en(e)||Fr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qs(e)===n&&(n=n.ownerDocument.body),n}function sR(e,t){const n=Rn(e);if(dp(e))return n;if(!en(e)){let o=Us(e);for(;o&&!Hs(o);){if(Nt(o)&&!xv(o))return o;o=Us(o)}return n}let s=bC(e,t);for(;s&&nM(s)&&xv(s);)s=bC(s,t);return s&&Hs(s)&&xv(s)&&!i0(s)?n:s||aM(e)||n}const b6=async function(e){const t=this.getOffsetParent||sR,n=this.getDimensions,s=await n(e.floating);return{reference:y6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function x6(e){return Fr(e).direction==="rtl"}const S6={convertOffsetParentRelativeRectToViewportRelativeRect:u6,getDocumentElement:qs,getClippingRect:v6,getOffsetParent:sR,getElementRects:b6,getClientRects:d6,getDimensions:_6,getScale:Ml,isElement:Nt,isRTL:x6};function iR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function C6(e,t){let n=null,s;const o=qs(e);function u(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function h(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),u();const d=e.getBoundingClientRect(),{left:p,top:f,width:g,height:S}=d;if(a||t(),!g||!S)return;const C=Rl(f),w=Rl(o.clientWidth-(p+g)),b=Rl(o.clientHeight-(f+S)),x=Rl(p),y={rootMargin:-C+"px "+-w+"px "+-b+"px "+-x+"px",threshold:Nr(0,Wl(1,l))||1};let E=!0;function T(A){const M=A[0].intersectionRatio;if(M!==l){if(!E)return h();M?h(!1,M):s=setTimeout(()=>{h(!1,1e-7)},1e3)}M===1&&!iR(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,y)}n.observe(e)}return h(!0),u}function xC(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=T0(e),p=o||u?[...d?ho(d):[],...ho(t)]:[];p.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),u&&x.addEventListener("resize",n)});const f=d&&a?C6(d,n):null;let g=-1,S=null;h&&(S=new ResizeObserver(x=>{let[_]=x;_&&_.target===d&&S&&(S.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=S)==null||y.observe(t)})),n()}),d&&!l&&S.observe(d),S.observe(t));let C,w=l?Ta(e):null;l&&b();function b(){const x=Ta(e);w&&!iR(w,x)&&n(),w=x,C=requestAnimationFrame(b)}return n(),()=>{var x;p.forEach(_=>{o&&_.removeEventListener("scroll",n),u&&_.removeEventListener("resize",n)}),f?.(),(x=S)==null||x.disconnect(),S=null,l&&cancelAnimationFrame(C)}}const w6=s6,E6=i6,R6=t6,k6=a6,T6=n6,L6=o6,A6=(e,t,n)=>{const s=new Map,o={platform:S6,...n},u={...o.platform,_c:s};return e6(e,t,{...o,platform:u})};var O6=typeof document<"u",M6=function(){},gh=O6?R.useLayoutEffect:M6;function Vh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Vh(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Vh(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function oR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function SC(e,t){const n=oR(e);return Math.round(t*n)/n}function Sv(e){const t=R.useRef(e);return gh(()=>{t.current=e}),t}function D6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:h}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[p,f]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,S]=R.useState(s);Vh(g,s)||S(s);const[C,w]=R.useState(null),[b,x]=R.useState(null),_=R.useCallback(G=>{G!==A.current&&(A.current=G,w(G))},[]),y=R.useCallback(G=>{G!==M.current&&(M.current=G,x(G))},[]),E=u||C,T=h||b,A=R.useRef(null),M=R.useRef(null),L=R.useRef(p),D=l!=null,z=Sv(l),H=Sv(o),$=Sv(d),N=R.useCallback(()=>{if(!A.current||!M.current)return;const G={placement:t,strategy:n,middleware:g};H.current&&(G.platform=H.current),A6(A.current,M.current,G).then(j=>{const W={...j,isPositioned:$.current!==!1};q.current&&!Vh(L.current,W)&&(L.current=W,er.flushSync(()=>{f(W)}))})},[g,t,n,H,$]);gh(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[d]);const q=R.useRef(!1);gh(()=>(q.current=!0,()=>{q.current=!1}),[]),gh(()=>{if(E&&(A.current=E),T&&(M.current=T),E&&T){if(z.current)return z.current(E,T,N);N()}},[E,T,N,z,D]);const K=R.useMemo(()=>({reference:A,floating:M,setReference:_,setFloating:y}),[_,y]),V=R.useMemo(()=>({reference:E,floating:T}),[E,T]),Y=R.useMemo(()=>{const G={position:n,left:0,top:0};if(!V.floating)return G;const j=SC(V.floating,p.x),W=SC(V.floating,p.y);return a?{...G,transform:"translate("+j+"px, "+W+"px)",...oR(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:W}},[n,a,V.floating,p.x,p.y]);return R.useMemo(()=>({...p,update:N,refs:K,elements:V,floatingStyles:Y}),[p,N,K,V,Y])}const P6=(e,t)=>({...w6(e),options:[e,t]}),j6=(e,t)=>({...E6(e),options:[e,t]}),I6=(e,t)=>({...L6(e),options:[e,t]}),N6=(e,t)=>({...R6(e),options:[e,t]}),B6=(e,t)=>({...k6(e),options:[e,t]}),z6=(e,t)=>({...T6(e),options:[e,t]}),H6={intentional:"onClick",sloppy:"onPointerDown"};function F6(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function xp(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("referenceElement"),h=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:S=!1,referencePressEvent:C="sloppy",ancestorScroll:w=!1,bubbles:b,externalTree:x}=t,_=Co(x),y=Pe(typeof f=="function"?f:()=>!1),E=typeof f=="function"?y:f,T=R.useRef(!1),{escapeKey:A,outsidePress:M}=F6(b),L=R.useRef(null),D=Qt(),z=Qt(),H=Pe(()=>{z.clear(),l.current.insideReactTree=!1}),$=R.useRef(!1),N=R.useRef(""),q=Pe(re=>{N.current=re.pointerType}),K=Pe(()=>{const re=N.current,oe=re==="pen"||!re?"mouse":re,le=typeof g=="function"?g():g;return typeof le=="string"?le:le[oe]}),V=Pe(re=>{if(!s||!d||!p||re.key!=="Escape"||$.current)return;const oe=l.current.floatingContext?.nodeId,le=_?ga(_.nodesRef.current,oe):[];if(!A&&le.length>0){let ue=!0;if(le.forEach(de=>{de.context?.open&&!de.context.dataRef.current.__escapeKeyBubbles&&(ue=!1)}),!ue)return}const _e=fD(re)?re.nativeEvent:re,ge=Ue(gp,_e);n.setOpen(!1,ge),!A&&!ge.isPropagationAllowed&&re.stopPropagation()}),Y=Pe(re=>{const oe=K();return oe==="intentional"&&re.type!=="click"||oe==="sloppy"&&re.type==="click"}),G=Pe(()=>{l.current.insideReactTree=!0,z.start(0,H)}),j=Pe((re,oe=!1)=>{if(Y(re)){H();return}if(l.current.insideReactTree){H();return}if(K()==="intentional"&&oe||typeof E=="function"&&!E(re))return;const le=Pn(re),_e=`[${Gl("inert")}]`,ge=dn(n.select("floatingElement")).querySelectorAll(_e),ue=n.context.triggerElements;if(le&&(ue.hasElement(le)||ue.hasMatchingElement(be=>ft(be,le))))return;let de=Nt(le)?le:null;for(;de&&!Hs(de);){const be=Us(de);if(Hs(be)||!Nt(be))break;de=be}if(ge.length&&Nt(le)&&!uD(le)&&!ft(le,n.select("floatingElement"))&&Array.from(ge).every(be=>!ft(de,be)))return;if(en(le)&&!("touches"in re)){const be=Hs(le),Me=Fr(le),pe=/auto|scroll/,ke=be||pe.test(Me.overflowX),we=be||pe.test(Me.overflowY),We=ke&&le.clientWidth>0&&le.scrollWidth>le.clientWidth,et=we&&le.clientHeight>0&&le.scrollHeight>le.clientHeight,xe=Me.direction==="rtl",Ge=et&&(xe?re.offsetX<=le.offsetWidth-le.clientWidth:re.offsetX>le.clientWidth),tt=We&&re.offsetY>le.clientHeight;if(Ge||tt)return}const Ie=l.current.floatingContext?.nodeId,De=_&&ga(_.nodesRef.current,Ie).some(be=>vs(re,be.context?.elements.floating));if(vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||De)return;const Oe=_?ga(_.nodesRef.current,Ie):[];if(Oe.length>0){let be=!0;if(Oe.forEach(Me=>{Me.context?.open&&!Me.context.dataRef.current.__outsidePressBubbles&&(be=!1)}),!be)return}n.setOpen(!1,Ue(v0,re)),H()}),W=Pe(re=>{K()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!d||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||j(re)}),P=Pe(re=>{if(K()!=="sloppy"||!n.select("open")||!d||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement")))return;const oe=re.touches[0];oe&&(L.current={startTime:Date.now(),startX:oe.clientX,startY:oe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),I=Pe(re=>{const oe=Pn(re);function le(){P(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),F=Pe(re=>{const oe=T.current;if(T.current=!1,D.clear(),re.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const le=Pn(re);function _e(){re.type==="pointerdown"?W(re):j(re,oe),le?.removeEventListener(re.type,_e)}le?.addEventListener(re.type,_e)}),X=Pe(re=>{if(K()!=="sloppy"||!L.current||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement")))return;const oe=re.touches[0];if(!oe)return;const le=Math.abs(oe.clientX-L.current.startX),_e=Math.abs(oe.clientY-L.current.startY),ge=Math.sqrt(le*le+_e*_e);ge>5&&(L.current.dismissOnTouchEnd=!0),ge>10&&(j(re),D.clear(),L.current=null)}),te=Pe(re=>{const oe=Pn(re);function le(){X(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),ee=Pe(re=>{K()!=="sloppy"||!L.current||vs(re,n.select("floatingElement"))||vs(re,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&j(re),D.clear(),L.current=null)}),Q=Pe(re=>{const oe=Pn(re);function le(){ee(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)});R.useEffect(()=>{if(!s||!d)return;l.current.__escapeKeyBubbles=A,l.current.__outsidePressBubbles=M;const re=new ka;function oe(de){n.setOpen(!1,Ue(Mn,de))}function le(){re.clear(),$.current=!0}function _e(){re.start(fp()?5:0,()=>{$.current=!1})}const ge=dn(o);ge.addEventListener("pointerdown",q,!0),p&&(ge.addEventListener("keydown",V),ge.addEventListener("compositionstart",le),ge.addEventListener("compositionend",_e)),E&&(ge.addEventListener("click",F,!0),ge.addEventListener("pointerdown",F,!0),ge.addEventListener("touchstart",I,!0),ge.addEventListener("touchmove",te,!0),ge.addEventListener("touchend",Q,!0),ge.addEventListener("mousedown",F,!0));let ue=[];return w&&(Nt(h)&&(ue=ho(h)),Nt(o)&&(ue=ue.concat(ho(o))),!Nt(u)&&u&&u.contextElement&&(ue=ue.concat(ho(u.contextElement)))),ue=ue.filter(de=>de!==ge.defaultView?.visualViewport),ue.forEach(de=>{de.addEventListener("scroll",oe,{passive:!0})}),()=>{ge.removeEventListener("pointerdown",q,!0),p&&(ge.removeEventListener("keydown",V),ge.removeEventListener("compositionstart",le),ge.removeEventListener("compositionend",_e)),E&&(ge.removeEventListener("click",F,!0),ge.removeEventListener("pointerdown",F,!0),ge.removeEventListener("touchstart",I,!0),ge.removeEventListener("touchmove",te,!0),ge.removeEventListener("touchend",Q,!0),ge.removeEventListener("mousedown",F,!0)),ue.forEach(de=>{de.removeEventListener("scroll",oe)}),re.clear()}},[l,o,u,h,p,E,s,a,w,d,A,M,V,j,F,W,I,te,Q,q,n]),R.useEffect(H,[E,H]);const U=R.useMemo(()=>({onKeyDown:V,...S&&{[H6[C]]:re=>{n.setOpen(!1,Ue(pa,re.nativeEvent))},...C!=="intentional"&&{onClick(re){n.setOpen(!1,Ue(pa,re.nativeEvent))}}}}),[V,n,S,C]),se=Pe(re=>{const oe=Pn(re.nativeEvent);!ft(n.select("floatingElement"),oe)||re.button!==0||(T.current=!0)}),ne=R.useMemo(()=>({onKeyDown:V,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:G,onMouseDownCapture:G,onPointerDownCapture:G,onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[V,se,G]);return R.useMemo(()=>d?{reference:U,floating:ne,trigger:U}:{},[d,U,ne])}var Uh=Symbol("NOT_FOUND");function V6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function U6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function W6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var CC=e=>Array.isArray(e)?e:[e];function q6(e){const t=Array.isArray(e[0])?e[0]:e;return W6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function G6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function $6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Uh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function K6(e,t){let n=[];function s(a){const l=n.findIndex(d=>t(a,d.key));if(l>-1){const d=n[l];return l>0&&(n.splice(l,1),n.unshift(d)),d.value}return Uh}function o(a,l){s(a)===Uh&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function u(){return n}function h(){n=[]}return{get:s,put:o,getEntries:u,clear:h}}var Y6=(e,t)=>e===t;function X6(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:o}=n;for(let u=0;u<o;u++)if(!e(n[u],s[u]))return!1;return!0}}function Q6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=Y6,maxSize:o=1,resultEqualityCheck:u}=n,h=X6(s);let a=0;const l=o<=1?$6(h):K6(o,h);function d(){let p=l.get(arguments);if(p===Uh){if(p=e.apply(null,arguments),a++,u){const g=l.getEntries().find(S=>u(S.value,p));g&&(p=g.value,a!==0&&a--)}l.put(arguments,p)}return p}return d.clearCache=()=>{l.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var Z6=class{constructor(e){this.value=e}deref(){return this.value}},J6=typeof WeakRef<"u"?WeakRef:Z6,eP=0,wC=1;function Gf(){return{s:eP,v:void 0,o:null,p:null}}function aR(e,t={}){let n=Gf();const{resultEqualityCheck:s}=t;let o,u=0;function h(){let a=n;const{length:l}=arguments;for(let f=0,g=l;f<g;f++){const S=arguments[f];if(typeof S=="function"||typeof S=="object"&&S!==null){let C=a.o;C===null&&(a.o=C=new WeakMap);const w=C.get(S);w===void 0?(a=Gf(),C.set(S,a)):a=w}else{let C=a.p;C===null&&(a.p=C=new Map);const w=C.get(S);w===void 0?(a=Gf(),C.set(S,a)):a=w}}const d=a;let p;if(a.s===wC)p=a.v;else if(p=e.apply(null,arguments),u++,s){const f=o?.deref?.()??o;f!=null&&s(f,p)&&(p=f,u!==0&&u--),o=typeof p=="object"&&p!==null||typeof p=="function"?new J6(p):p}return d.s=wC,d.v=p,p}return h.clearCache=()=>{n=Gf(),h.resetResultsCount()},h.resultsCount=()=>u,h.resetResultsCount=()=>{u=0},h}function lR(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...o)=>{let u=0,h=0,a,l={},d=o.pop();typeof d=="object"&&(l=d,d=o.pop()),V6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...l},{memoize:f,memoizeOptions:g=[],argsMemoize:S=aR,argsMemoizeOptions:C=[]}=p,w=CC(g),b=CC(C),x=q6(o),_=f(function(){return u++,d.apply(null,arguments)},...w),y=S(function(){h++;const T=G6(x,arguments);return a=_.apply(null,T),a},...b);return Object.assign(y,{resultFunc:d,memoizedResultFunc:_,dependencies:x,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:S})};return Object.assign(s,{withTypes:()=>s}),s}var tP=lR(aR),nP=Object.assign((e,t=tP)=>{U6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(u=>e[u]);return t(s,(...u)=>u.reduce((h,a,l)=>(h[n[l]]=a,h),{}))},{withTypes:()=>nP});lR({memoize:Q6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ee=(e,t,n,s,o,u,...h)=>{if(h.length>0)throw new Error(Pt(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var rP=w2();const sP=a0(19),iP=sP?oP:aP;function Ae(e,t,n,s,o){return iP(e,t,n,s,o)}function oP(e,t,n,s,o){const u=R.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return rP.useSyncExternalStore(e.subscribe,u,u)}function aP(e,t,n,s,o){return E2.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>t(u,n,s,o))}class va{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){va.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||va.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};va.prototype.setState.call(this,t)}}class L0 extends va{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){R.useDebugValue(t),Fe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){Fe(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);Fe(()=>{this.update(t)},n)}useControlledProp(t,n,s){R.useDebugValue(t);const o=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],s)&&super.setState({...this.state,[t]:s})),Fe(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(t,n,s,o)=>{const u=this.selectors[t];return u(this.state,n,s,o)};useState=(t,n,s,o)=>{R.useDebugValue(t);const u=this.selectors[t];return Ae(this,u,n,s,o)};useContextCallback(t,n){R.useDebugValue(t);const s=Pe(n??on);this.context[t]=s}useStateSetter(t){const n=R.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let o=s(this.state);return n(o,o,this),this.subscribe(u=>{const h=s(u);if(!Object.is(o,h)){const a=o;o=h,n(h,a,this)}})}}const lP={open:Ee(e=>e.open),domReferenceElement:Ee(e=>e.domReferenceElement),referenceElement:Ee(e=>e.positionReference??e.referenceElement),floatingElement:Ee(e=>e.floatingElement),floatingId:Ee(e=>e.floatingId)};class A0 extends L0{constructor(t){const{nested:n,noEmit:s,onOpenChange:o,triggerElements:u,...h}=t;super({...h,positionReference:h.referenceElement,domReferenceElement:h.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:GE(),nested:n,noEmit:s,triggerElements:u},lP)}setOpen=(t,n)=>{if((!t||!this.state.open||AE(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function ki(e,t=!1,n=!1){const[s,o]=R.useState(e&&t?"idle":void 0),[u,h]=R.useState(e);return e&&!u&&(h(!0),o("starting")),!e&&u&&s!=="ending"&&!n&&o("ending"),!e&&!u&&s==="ending"&&o(void 0),Fe(()=>{if(!e&&u&&s!=="ending"&&n){const a=Ns.request(()=>{o("ending")});return()=>{Ns.cancel(a)}}},[e,u,s,n]),Fe(()=>{if(!e||t)return;const a=Ns.request(()=>{o(void 0)});return()=>{Ns.cancel(a)}},[t,e]),Fe(()=>{if(!e||!t)return;e&&u&&s!=="idle"&&o("starting");const a=Ns.request(()=>{o("idle")});return()=>{Ns.cancel(a)}},[t,e,u,o,s]),R.useMemo(()=>({mounted:u,setMounted:h,transitionStatus:s}),[u,s])}function cP(e,t=!1,n=!0){const s=sd();return Pe((o,u=null)=>{s.cancel();const h=Qo(e);h!=null&&(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():s.request(()=>{function a(){h&&Promise.all(h.getAnimations().map(l=>l.finished)).then(()=>{u!=null&&u.aborted||er.flushSync(o)}).catch(()=>{if(n){if(u!=null&&u.aborted)return;er.flushSync(o)}else h.getAnimations().length>0&&h.getAnimations().some(l=>l.pending||l.playState!=="finished")&&a()})}t?s.request(a):a()}))})}function Ur(e){const{enabled:t=!0,open:n,ref:s,onComplete:o}=e,u=hn(n),h=Pe(o),a=cP(s,n);R.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function uP(e,t){const n=R.useRef(null);return R.useCallback(s=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),s!==null&&(n.current=e,t.context.triggerElements.add(e,s)))},[t,e])}function cR(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=uP(e,n),h=Pe(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return Fe(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function uR(e){const t=e.useState("open");Fe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,o]=n.value;e.update({activeTriggerId:s,activeTriggerElement:o})}}},[t,e])}function dR(e,t,n){const{mounted:s,setMounted:o,transitionStatus:u}=ki(e);t.useSyncedValues({mounted:s,transitionStatus:u});const h=Pe(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Ur({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:u}}class Sp{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function dP(){return new A0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Sp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function fR(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:dP(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tn,inactiveTriggerProps:tn,popupProps:tn}}const hR={open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),transitionStatus:Ee(e=>e.transitionStatus),floatingRootContext:Ee(e=>e.floatingRootContext),preventUnmountingOnClose:Ee(e=>e.preventUnmountingOnClose),payload:Ee(e=>e.payload),activeTriggerId:Ee(e=>e.activeTriggerId),activeTriggerElement:Ee(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:Ee((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:Ee((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ee(e=>e.popupProps),popupElement:Ee(e=>e.popupElement),positionerElement:Ee(e=>e.positionerElement)};function O0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Da(),u=Ri()!=null,h=Gn(()=>new A0({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new Sp,floatingId:o,nested:u,noEmit:e.noEmit||!1})).current;return Fe(()=>{const a={open:t,floatingId:o};s.reference!==void 0&&(a.referenceElement=s.reference,a.domReferenceElement=Nt(s.reference)?s.reference:null),s.floating!==void 0&&(a.floatingElement=s.floating),h.update(a)},[t,o,s.reference,s.floating,h]),h.context.onOpenChange=n,h.context.nested=u,h.context.noEmit=e.noEmit||!1,h}function fP(e={}){const{nodeId:t,externalTree:n}=e,s=O0(e),o=e.rootContext||s,u={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[h,a]=R.useState(null),l=R.useRef(null),d=Co(n);Fe(()=>{u.domReference&&(l.current=u.domReference)},[u.domReference]);const p=D6({...e,elements:{...u,...h&&{reference:h}}}),f=R.useCallback(M=>{const L=Nt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;a(L),p.refs.setReference(L)},[p.refs]),[g,S]=R.useState(null),[C,w]=R.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Nt(g)?g:null),o.useSyncedValue("floatingElement",C);const b=R.useCallback(M=>{(Nt(M)||M===null)&&(l.current=M,S(M)),(Nt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!Nt(M))&&p.refs.setReference(M)},[p.refs,S]),x=R.useCallback(M=>{w(M),p.refs.setFloating(M)},[p.refs]),_=R.useMemo(()=>({...p.refs,setReference:b,setFloating:x,setPositionReference:f,domReference:l}),[p.refs,b,x,f]),y=R.useMemo(()=>({...p.elements,domReference:u.domReference}),[p.elements,u.domReference]),E=o.useState("open"),T=o.useState("floatingId"),A=R.useMemo(()=>({...p,dataRef:o.context.dataRef,open:E,onOpenChange:o.setOpen,events:o.context.events,floatingId:T,refs:_,elements:y,nodeId:t,rootStore:o}),[p,_,y,t,o,E,T]);return Fe(()=>{o.context.dataRef.current.floatingContext=A;const M=d?.nodesRef.current.find(L=>L.id===t);M&&(M.context=A)}),R.useMemo(()=>({...p,context:A,refs:_,elements:y,rootStore:o}),[p,_,y,A,o])}function pR(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:o}=e,u=Da(),h=Ri()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),d=t.useState(s?"popupElement":"positionerElement"),p=t.context.triggerElements,f=Gn(()=>new A0({open:a,referenceElement:l,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return Fe(()=>{const g={open:a,floatingId:u,referenceElement:l,floatingElement:d};Nt(l)&&(g.domReferenceElement=l),f.update(g)},[a,u,l,d,f]),f.context.onOpenChange=o,f.context.nested=h,f.context.noEmit=n,f}const Cv=oD&&CE;function hP(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:s,dataRef:o}=n.context,{enabled:u=!0,visibleOnly:h=!0}=t,a=R.useRef(!1),l=Qt(),d=R.useRef(!0);R.useEffect(()=>{const f=n.select("domReferenceElement");if(!u)return;const g=Rn(f);function S(){!n.select("open")&&en(f)&&f===_s(dn(f))&&(a.current=!0)}function C(){d.current=!0}function w(){d.current=!1}return g.addEventListener("blur",S),Cv&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",w,!0)),()=>{g.removeEventListener("blur",S),Cv&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",w,!0))}},[n,u]),R.useEffect(()=>{if(!u)return;function f(g){(g.reason===pa||g.reason===gp)&&(a.current=!0)}return s.on("openchange",f),()=>{s.off("openchange",f)}},[s,u]);const p=R.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Pn(f.nativeEvent);if(h&&Nt(g)){if(Cv&&!f.relatedTarget){if(!d.current&&!x0(g))return}else if(!dD(g))return}n.setOpen(!0,Ue(Ph,f.nativeEvent,f.currentTarget))},onBlur(f){a.current=!1;const g=f.relatedTarget,S=f.nativeEvent,C=Nt(g)&&g.hasAttribute(Gl("focus-guard"))&&g.getAttribute("data-type")==="outside";l.start(0,()=>{const w=n.select("domReferenceElement"),b=_s(w?w.ownerDocument:document);!g&&b===w||ft(o.current.floatingContext?.refs.floating.current,b)||ft(w,b)||C||n.context.triggerElements.hasElement(f.relatedTarget)||n.setOpen(!1,Ue(Ph,S))})}}),[o,n,h,l]);return R.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const S_=Gl("safe-polygon"),pP=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${kE}`;function mP(e){return e?!!e.closest(pP):!1}function mR(e){const t=R.useRef(void 0),n=R.useRef(!1),s=R.useRef(void 0),o=R.useRef(!0),u=R.useRef(!1),h=R.useRef(()=>{}),a=R.useRef(!1),l=Qt(),d=Qt(),p=R.useRef(void 0);return R.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:s,blockMouseMoveRef:o,performedPointerEventsMutationRef:u,unbindMouseMoveRef:h,restTimeoutPendingRef:a,openChangeTimeout:l,restTimeout:d,handleCloseOptionsRef:p}),f.hoverInteractionState},[e,t,n,s,o,u,h,a,l,d,p])}const gP=new Set(["click","mousedown"]);function vP(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),{dataRef:h}=n.context,{enabled:a=!0,closeDelay:l=0,externalTree:d}=t,{pointerTypeRef:p,interactedInsideRef:f,handlerRef:g,performedPointerEventsMutationRef:S,unbindMouseMoveRef:C,restTimeoutPendingRef:w,openChangeTimeout:b,handleCloseOptionsRef:x}=mR(n),_=Co(d),y=Ri(),E=Pe(()=>f.current?!0:h.current.openEvent?gP.has(h.current.openEvent.type):!1),T=Pe(()=>{const z=h.current.openEvent?.type;return z?.includes("mouse")&&z!=="mousedown"}),A=R.useCallback((z,H=!0)=>{const $=_P(l,p.current);$&&!g.current?b.start($,()=>n.setOpen(!1,Ue(Br,z))):H&&(b.clear(),n.setOpen(!1,Ue(Br,z)))},[l,g,n,p,b]),M=Pe(()=>{C.current(),g.current=void 0}),L=Pe(()=>{if(S.current){const z=dn(o).body;z.style.pointerEvents="",z.removeAttribute(S_),S.current=!1}}),D=Pe(z=>{const H=Pn(z);if(!mP(H)){f.current=!1;return}f.current=!0});Fe(()=>{s||(p.current=void 0,w.current=!1,f.current=!1,M(),L())},[s,p,w,f,M,L]),R.useEffect(()=>()=>{M()},[M]),R.useEffect(()=>L,[L]),Fe(()=>{if(a&&s&&x.current?.blockPointerEvents&&T()&&Nt(u)&&o){S.current=!0;const z=dn(o).body;z.setAttribute(S_,"");const H=u,$=o,N=_?.nodesRef.current.find(q=>q.id===y)?.context?.elements.floating;return N&&(N.style.pointerEvents=""),z.style.pointerEvents="none",H.style.pointerEvents="auto",$.style.pointerEvents="auto",()=>{z.style.pointerEvents="",H.style.pointerEvents="",$.style.pointerEvents=""}}},[a,s,u,o,x,T,_,y,S]),R.useEffect(()=>{if(!a)return;function z(q){if(E()||!h.current.floatingContext||!n.select("open"))return;const K=n.context.triggerElements;q.relatedTarget&&K.hasElement(q.relatedTarget)||(L(),M(),E()||A(q))}function H(q){b.clear(),L(),g.current?.(q),M()}function $(q){E()||A(q,!1)}const N=o;return N&&(N.addEventListener("mouseleave",z),N.addEventListener("mouseenter",H),N.addEventListener("mouseleave",$),N.addEventListener("pointerdown",D,!0)),()=>{N&&(N.removeEventListener("mouseleave",z),N.removeEventListener("mouseenter",H),N.removeEventListener("mouseleave",$),N.removeEventListener("pointerdown",D,!0))}})}function _P(e,t){return t&&!Ul(t)?0:typeof e=="function"?e():e}function wv(e){return typeof e=="function"?e():e}const yP={current:null};function bP(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:s,events:o}=n.context,{enabled:u=!0,delay:h=0,handleClose:a=null,mouseOnly:l=!1,restMs:d=0,move:p=!0,triggerElementRef:f=yP,externalTree:g,isActiveTrigger:S=!0}=t,C=Co(g),{pointerTypeRef:w,interactedInsideRef:b,handlerRef:x,blockMouseMoveRef:_,performedPointerEventsMutationRef:y,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=mR(n),D=hn(a),z=hn(h),H=hn(d);S&&(L.current=D.current?.__options);const $=Pe(()=>b.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),N=R.useCallback((Y,G=!0)=>{const j=_v(z.current,"close",w.current);j&&!x.current?A.start(j,()=>n.setOpen(!1,Ue(Br,Y))):G&&(A.clear(),n.setOpen(!1,Ue(Br,Y)))},[z,x,n,w,A]),q=Pe(()=>{E.current(),x.current=void 0}),K=Pe(()=>{if(y.current){const Y=dn(n.select("domReferenceElement")).body;Y.style.pointerEvents="",Y.removeAttribute(S_),y.current=!1}});R.useEffect(()=>{if(!u)return;function Y(G){G.open||(A.clear(),M.clear(),_.current=!0,T.current=!1)}return o.on("openchange",Y),()=>{o.off("openchange",Y)}},[u,o,A,M,_,T]);const V=Pe(Y=>{if($()||!s.current.floatingContext)return;const G=n.context.triggerElements;if(Y.relatedTarget&&G.hasElement(Y.relatedTarget))return;const j=f.current;D.current?.({...s.current.floatingContext,tree:C,x:Y.clientX,y:Y.clientY,onClose(){K(),q(),!$()&&j===n.select("domReferenceElement")&&N(Y)}})(Y)});return R.useEffect(()=>{if(!u)return;const Y=f.current??(S?n.select("domReferenceElement"):null);if(!Nt(Y))return;function G(P){if(A.clear(),_.current=!1,l&&!Ul(w.current)||wv(H.current)>0&&!_v(z.current,"open"))return;const I=_v(z.current,"open",w.current),F=n.select("domReferenceElement"),X=n.context.triggerElements,te=(X.hasElement(P.target)||X.hasMatchingElement(U=>ft(U,P.target)))&&(!F||!ft(F,P.target)),ee=P.currentTarget??null,Q=!n.select("open")||te;I?A.start(I,()=>{Q&&n.setOpen(!0,Ue(Br,P,ee))}):Q&&n.setOpen(!0,Ue(Br,P,ee))}function j(P){if($()){K();return}E.current();const I=n.select("domReferenceElement"),F=dn(I);M.clear(),T.current=!1;const X=n.context.triggerElements;if(P.relatedTarget&&X.hasElement(P.relatedTarget))return;if(D.current&&s.current.floatingContext){n.select("open")||A.clear();const ee=f.current;x.current=D.current({...s.current.floatingContext,tree:C,x:P.clientX,y:P.clientY,onClose(){K(),q(),!$()&&ee===n.select("domReferenceElement")&&N(P,!0)}});const Q=x.current;Q(P),F.addEventListener("mousemove",Q),E.current=()=>{F.removeEventListener("mousemove",Q)};return}(w.current!=="touch"||!ft(n.select("floatingElement"),P.relatedTarget))&&N(P)}function W(P){V(P)}return n.select("open")&&Y.addEventListener("mouseleave",W),p&&Y.addEventListener("mousemove",G,{once:!0}),Y.addEventListener("mouseenter",G),Y.addEventListener("mouseleave",j),()=>{Y.removeEventListener("mouseleave",W),p&&Y.removeEventListener("mousemove",G),Y.removeEventListener("mouseenter",G),Y.removeEventListener("mouseleave",j)}},[q,K,_,s,z,N,n,u,D,V,S,$,l,p,w,H,M,T,A,f,C,E,x]),R.useMemo(()=>{function Y(G){w.current=G.pointerType}return{onPointerDown:Y,onPointerEnter:Y,onMouseMove(G){const{nativeEvent:j}=G,W=G.currentTarget,P=n.select("domReferenceElement"),I=n.context.triggerElements,F=n.select("open"),X=(I.hasElement(G.target)||I.hasMatchingElement(ee=>ft(ee,G.target)))&&(!P||!ft(P,G.target));if(l&&!Ul(w.current)||F&&!X||wv(H.current)===0||!X&&T.current&&G.movementX**2+G.movementY**2<2)return;M.clear();function te(){!_.current&&(!F||X)&&n.setOpen(!0,Ue(Br,j,W))}w.current==="touch"?er.flushSync(()=>{te()}):X&&F?te():(T.current=!0,M.start(wv(H.current),te))}}},[_,l,n,w,H,M,T])}function oc(e=[]){const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),s=e.map(d=>d?.item),o=e.map(d=>d?.trigger),u=R.useCallback(d=>$f(d,e,"reference"),t),h=R.useCallback(d=>$f(d,e,"floating"),n),a=R.useCallback(d=>$f(d,e,"item"),s),l=R.useCallback(d=>$f(d,e,"trigger"),o);return R.useMemo(()=>({getReferenceProps:u,getFloatingProps:h,getItemProps:a,getTriggerProps:l}),[u,h,a,l])}function $f(e,t,n){const s=new Map,o=n==="item",u={};n==="floating"&&(u.tabIndex=-1,u[m_]="");for(const h in e)o&&e&&(h===EE||h===RE)||(u[h]=e[h]);for(let h=0;h<t.length;h+=1){let a;const l=t[h]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&EC(u,a,o,s)}return EC(u,e,o,s),u}function EC(e,t,n,s){for(const o in t){const u=t[o];n&&(o===EE||o===RE)||(o.startsWith("on")?(s.has(o)||s.set(o,[]),typeof u=="function"&&(s.get(o)?.push(u),e[o]=(...h)=>s.get(o)?.map(a=>a(...h)).find(a=>a!==void 0))):e[o]=u)}}const xP="Escape";function Cp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Kf(e,t){return Cp(t,e===b0||e===nd,e===po||e===mo)}function Ev(e,t,n){return Cp(t,e===nd,n?e===po:e===mo)||e==="Enter"||e===" "||e===""}function SP(e,t,n){return Cp(t,n?e===po:e===mo,e===nd)}function CP(e,t,n,s){const o=n?e===mo:e===po,u=e===b0;return t==="both"||t==="horizontal"&&s&&s>1?e===xP:Cp(t,o,u)}function M0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),h=n.context.dataRef,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:p=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:S=!1,nested:C=!1,rtl:w=!1,virtual:b=!1,focusItemOnOpen:x="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:y=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:D,dense:z=!1,id:H,resetOnPointerLeave:$=!0,externalTree:N}=t,q=Hu(o),K=hn(q),V=Ri(),Y=Co(N);Fe(()=>{h.current.orientation=T},[h,T]);const G=g_(u),j=R.useRef(x),W=R.useRef(f??-1),P=R.useRef(null),I=R.useRef(!0),F=Pe(pe=>{d(W.current===-1?null:W.current,pe)}),X=R.useRef(F),te=R.useRef(!!o),ee=R.useRef(s),Q=R.useRef(!1),U=R.useRef(!1),se=hn(E),ne=hn(s),re=hn(L),oe=hn(f),le=hn($),_e=Pe(()=>{function pe(et){b?Y?.events.emit("virtualfocus",et):mh(et,{sync:Q.current,preventScroll:!0})}const ke=a.current[W.current],we=U.current;ke&&pe(ke),(Q.current?et=>et():requestAnimationFrame)(()=>{const et=a.current[W.current]||ke;if(!et)return;ke||pe(et);const xe=re.current;xe&&ue&&(we||!I.current)&&et.scrollIntoView?.(typeof xe=="boolean"?{block:"nearest",inline:"nearest"}:xe)})});Fe(()=>{p&&(s&&o?(W.current=f??-1,j.current&&f!=null&&(U.current=!0,F())):te.current&&(W.current=-1,X.current()))},[p,s,o,f,F]),Fe(()=>{if(p){if(!s){Q.current=!1;return}if(o)if(l==null){if(Q.current=!1,oe.current!=null)return;if(te.current&&(W.current=-1,_e()),(!ee.current||!te.current)&&j.current&&(P.current!=null||j.current===!0&&P.current==null)){let pe=0;const ke=()=>{a.current[0]==null?(pe<2&&(pe?requestAnimationFrame:queueMicrotask)(ke),pe+=1):(W.current=P.current==null||Ev(P.current,T,w)||C?ph(a):y_(a),P.current=null,F())};ke()}}else Ll(a,l)||(W.current=l,_e(),U.current=!1)}},[p,s,o,l,oe,C,a,T,w,F,_e,se]),Fe(()=>{if(!p||o||!Y||b||!te.current)return;const pe=Y.nodesRef.current,ke=pe.find(et=>et.id===V)?.context?.elements.floating,we=_s(dn(o)),We=pe.some(et=>et.context&&ft(et.context.elements.floating,we));ke&&!We&&I.current&&ke.focus({preventScroll:!0})},[p,o,Y,V,b]),Fe(()=>{X.current=F,ee.current=s,te.current=!!o}),Fe(()=>{s||(P.current=null,j.current=x)},[s,x]);const ge=l!=null,ue=R.useMemo(()=>{function pe(we){if(!ne.current)return;const We=a.current.indexOf(we.currentTarget);We!==-1&&W.current!==We&&(W.current=We,F(we))}return{onFocus(we){Q.current=!0,pe(we)},onClick:({currentTarget:we})=>we.focus({preventScroll:!0}),onMouseMove(we){Q.current=!0,U.current=!1,_&&pe(we)},onPointerLeave(we){if(!ne.current||!I.current||we.pointerType==="touch")return;Q.current=!0;const We=we.relatedTarget;!_||a.current.includes(We)||le.current&&(W.current=-1,F(we),b||K.current?.focus({preventScroll:!0}))}}},[ne,K,_,a,F,le,b]),de=R.useCallback(()=>A??Y?.nodesRef.current.find(pe=>pe.id===V)?.context?.dataRef?.current.orientation,[V,Y,A]),Ie=Pe(pe=>{if(I.current=!1,Q.current=!0,pe.which===229||!ne.current&&pe.currentTarget===K.current)return;if(C&&CP(pe.key,T,w,M)){Kf(pe.key,de())||fn(pe),n.setOpen(!1,Ue(Du,pe.nativeEvent)),en(u)&&(b?Y?.events.emit("virtualfocus",u):u.focus());return}const ke=W.current,we=ph(a,E),We=y_(a,E);if(G||(pe.key==="Home"&&(fn(pe),W.current=we,F(pe)),pe.key==="End"&&(fn(pe),W.current=We,F(pe))),M>1){const et=D||Array.from({length:a.current.length},()=>({width:1,height:1})),xe=DE(et,M,z),Ge=xe.findIndex(Se=>Se!=null&&!go(a,Se,E)),tt=xe.reduce((Se,He,Re)=>He!=null&&!go(a,He,E)?Re:Se,-1),dt=xe[ME({current:xe.map(Se=>Se!=null?a.current[Se]:null)},{event:pe,orientation:T,loopFocus:S,rtl:w,cols:M,disabledIndices:jE([...(typeof E!="function"?E:null)||a.current.map((Se,He)=>go(a,He,E)?He:void 0),void 0],xe),minIndex:Ge,maxIndex:tt,prevIndex:PE(W.current>We?we:W.current,et,xe,M,pe.key===nd?"bl":pe.key===(w?po:mo)?"tr":"tl"),stopEvent:!0})];if(dt!=null&&(W.current=dt,F(pe)),T==="both")return}if(Kf(pe.key,T)){if(fn(pe),s&&!b&&_s(pe.currentTarget.ownerDocument)===pe.currentTarget){W.current=Ev(pe.key,T,w)?we:We,F(pe);return}Ev(pe.key,T,w)?S?ke>=We?g&&ke!==a.current.length?W.current=-1:(Q.current=!1,W.current=we):W.current=Wn(a,{startingIndex:ke,disabledIndices:E}):W.current=Math.min(We,Wn(a,{startingIndex:ke,disabledIndices:E})):S?ke<=we?g&&ke!==-1?W.current=a.current.length:(Q.current=!1,W.current=We):W.current=Wn(a,{startingIndex:ke,decrement:!0,disabledIndices:E}):W.current=Math.max(we,Wn(a,{startingIndex:ke,decrement:!0,disabledIndices:E})),Ll(a,W.current)&&(W.current=-1),F(pe)}}),De=R.useMemo(()=>b&&s&&ge&&{"aria-activedescendant":`${H}-${l}`},[b,s,ge,H,l]),Oe=R.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...G?{}:De,onKeyDown(pe){if(pe.key==="Tab"&&pe.shiftKey&&s&&!b){const ke=Pn(pe.nativeEvent);if(ke&&!ft(K.current,ke))return;fn(pe),n.setOpen(!1,Ue(Ra,pe.nativeEvent)),en(u)&&u.focus();return}Ie(pe)},onPointerMove(){I.current=!0}}),[De,Ie,K,T,G,n,s,b,u]),be=R.useMemo(()=>{function pe(we){x==="auto"&&TE(we.nativeEvent)&&(j.current=!b)}function ke(we){j.current=x,x==="auto"&&LE(we.nativeEvent)&&(j.current=!0)}return{onKeyDown(we){const We=n.select("open");I.current=!1;const et=we.key.startsWith("Arrow"),xe=SP(we.key,de(),w),Ge=Kf(we.key,T),tt=(C?xe:Ge)||we.key==="Enter"||we.key.trim()==="";if(b&&We)return Ie(we);if(!(!We&&!y&&et)){if(tt){const dt=Kf(we.key,de());P.current=C&&dt?null:we.key}if(C){xe&&(fn(we),We?(W.current=ph(a,se.current),F(we)):n.setOpen(!0,Ue(Du,we.nativeEvent,we.currentTarget)));return}Ge&&(oe.current!=null&&(W.current=oe.current),fn(we),!We&&y?n.setOpen(!0,Ue(Du,we.nativeEvent,we.currentTarget)):Ie(we),We&&F(we))}},onFocus(we){n.select("open")&&!b&&(W.current=-1,F(we))},onPointerDown:ke,onPointerEnter:ke,onMouseDown:pe,onClick:pe}},[Ie,se,x,a,C,F,n,y,T,de,w,oe,b]),Me=R.useMemo(()=>({...De,...be}),[De,be]);return R.useMemo(()=>p?{reference:Me,floating:Oe,item:ue,trigger:be}:{},[p,Me,Oe,be,ue])}const wP=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function gR(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingId"),u=n.useState("domReferenceElement"),h=n.useState("floatingElement"),{enabled:a=!0,role:l="dialog"}=t,d=Da(),p=u?.id||d,f=R.useMemo(()=>Hu(h)?.id||o,[h,o]),g=wP.get(l)??l,C=Ri()!=null,w=R.useMemo(()=>g==="tooltip"||l==="label"?tn:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&C&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[g,C,l]),b=R.useMemo(()=>g==="tooltip"||l==="label"?{[`aria-${l==="label"?"labelledby":"describedby"}`]:s?f:void 0}:{...w,"aria-expanded":s?"true":"false","aria-controls":s?f:void 0,...g==="menu"&&{id:p}},[g,f,s,p,l,w]),x=R.useMemo(()=>{const y={id:f,...g&&{role:g}};return g==="tooltip"||l==="label"?y:{...y,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,l]),_=R.useCallback(({active:y,selected:E})=>{const T={role:"option",...y&&{id:`${f}-fui-option`}};switch(l){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[f,l]);return R.useMemo(()=>a?{reference:b,floating:x,item:_,trigger:w}:{},[a,b,x,w,_])}function D0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.context.dataRef,{listRef:u,activeIndex:h,onMatch:a,onTypingChange:l,enabled:d=!0,findMatch:p=null,resetMs:f=750,ignoreKeys:g=br,selectedIndex:S=null}=t,C=Qt(),w=R.useRef(""),b=R.useRef(S??h??-1),x=R.useRef(null);Fe(()=>{s&&(C.clear(),x.current=null,w.current="")},[s,C]),Fe(()=>{s&&w.current===""&&(b.current=S??h??-1)},[s,S,h]);const _=Pe(A=>{A?o.current.typing||(o.current.typing=A,l?.(A)):o.current.typing&&(o.current.typing=A,l?.(A))}),y=Pe(A=>{function M($,N,q){const K=p?p(N,q):N.find(V=>V?.toLocaleLowerCase().indexOf(q.toLocaleLowerCase())===0);return K?$.indexOf(K):-1}const L=u.current;if(w.current.length>0&&w.current[0]!==" "&&(M(L,L,w.current)===-1?_(!1):A.key===" "&&fn(A)),L==null||g.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(fn(A),_(!0)),L.every($=>$?$[0]?.toLocaleLowerCase()!==$[1]?.toLocaleLowerCase():!0)&&w.current===A.key&&(w.current="",b.current=x.current),w.current+=A.key,C.start(f,()=>{w.current="",b.current=x.current,_(!1)});const z=b.current,H=M(L,[...L.slice((z||0)+1),...L.slice(0,(z||0)+1)],w.current);H!==-1?(a?.(H),x.current=H):A.key!==" "&&(w.current="",_(!1))}),E=R.useMemo(()=>({onKeyDown:y}),[y]),T=R.useMemo(()=>({onKeyDown:y,onKeyUp(A){A.key===" "&&_(!1)}}),[y,_]);return R.useMemo(()=>d?{reference:E,floating:T}:{},[d,E,T])}function RC(e,t){const[n,s]=e;let o=!1;const u=t.length;for(let h=0,a=u-1;h<u;a=h++){const[l,d]=t[h]||[0,0],[p,f]=t[a]||[0,0];d>=s!=f>=s&&n<=(p-l)*(s-d)/(f-d)+l&&(o=!o)}return o}function EP(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function RP(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,o=new ka;let u=!1,h=null,a=null,l=typeof performance<"u"?performance.now():0;function d(f,g){const S=performance.now(),C=S-l;if(h===null||a===null||C===0)return h=f,a=g,l=S,null;const w=f-h,b=g-a,_=Math.sqrt(w*w+b*b)/C;return h=f,a=g,l=S,_}const p=({x:f,y:g,placement:S,elements:C,onClose:w,nodeId:b,tree:x})=>function(y){function E(){o.clear(),w()}if(o.clear(),!C.domReference||!C.floating||S==null||f==null||g==null)return;const{clientX:T,clientY:A}=y,M=[T,A],L=Pn(y),D=y.type==="mouseleave",z=ft(C.floating,L),H=ft(C.domReference,L),$=C.domReference.getBoundingClientRect(),N=C.floating.getBoundingClientRect(),q=S.split("-")[0],K=f>N.right-N.width/2,V=g>N.bottom-N.height/2,Y=EP(M,$),G=N.width>$.width,j=N.height>$.height,W=(G?$:N).left,P=(G?$:N).right,I=(j?$:N).top,F=(j?$:N).bottom;if(z&&(u=!0,!D))return;if(H&&(u=!1),H&&!D){u=!0;return}if(D&&Nt(y.relatedTarget)&&ft(C.floating,y.relatedTarget)||x&&ga(x.nodesRef.current,b).some(({context:ee})=>ee?.open))return;if(q==="top"&&g>=$.bottom-1||q==="bottom"&&g<=$.top+1||q==="left"&&f>=$.right-1||q==="right"&&f<=$.left+1)return E();let X=[];switch(q){case"top":X=[[W,$.top+1],[W,N.bottom-1],[P,N.bottom-1],[P,$.top+1]];break;case"bottom":X=[[W,N.top+1],[W,$.bottom-1],[P,$.bottom-1],[P,N.top+1]];break;case"left":X=[[N.right-1,F],[N.right-1,I],[$.left+1,I],[$.left+1,F]];break;case"right":X=[[$.right-1,F],[$.right-1,I],[N.left+1,I],[N.left+1,F]];break}function te([ee,Q]){switch(q){case"top":{const U=[G?ee+t/2:K?ee+t*4:ee-t*4,Q+t+1],se=[G?ee-t/2:K?ee+t*4:ee-t*4,Q+t+1],ne=[[N.left,K||G?N.bottom-t:N.top],[N.right,K?G?N.bottom-t:N.top:N.bottom-t]];return[U,se,...ne]}case"bottom":{const U=[G?ee+t/2:K?ee+t*4:ee-t*4,Q-t],se=[G?ee-t/2:K?ee+t*4:ee-t*4,Q-t],ne=[[N.left,K||G?N.top+t:N.bottom],[N.right,K?G?N.top+t:N.bottom:N.top+t]];return[U,se,...ne]}case"left":{const U=[ee+t+1,j?Q+t/2:V?Q+t*4:Q-t*4],se=[ee+t+1,j?Q-t/2:V?Q+t*4:Q-t*4];return[...[[V||j?N.right-t:N.left,N.top],[V?j?N.right-t:N.left:N.right-t,N.bottom]],U,se]}case"right":{const U=[ee-t,j?Q+t/2:V?Q+t*4:Q-t*4],se=[ee-t,j?Q-t/2:V?Q+t*4:Q-t*4],ne=[[V||j?N.left+t:N.right,N.top],[V?j?N.left+t:N.right:N.left+t,N.bottom]];return[U,se,...ne]}default:return[]}}if(!RC([T,A],X)){if(u&&!Y)return E();if(!D&&s){const ee=d(y.clientX,y.clientY);if(ee!==null&&ee<.1)return E()}RC([T,A],te([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let kP=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),TP=(function(e){return e[e.open=sa.open]="open",e[e.closed=sa.closed]="closed",e[e.startingStyle=sa.startingStyle]="startingStyle",e[e.endingStyle=sa.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const vR=R.createContext(void 0);function LP(){const e=R.useContext(vR);if(e===void 0)throw new Error(Pt(26));return e}const Dl="ArrowUp",oa="ArrowDown",Uu="ArrowLeft",Pl="ArrowRight",od="Home",ad="End",_R=new Set([Uu,Pl]),AP=new Set([Uu,Pl,od,ad]),yR=new Set([Dl,oa]),OP=new Set([Dl,oa,od,ad]),bR=new Set([..._R,...yR]),MP=new Set([...bR,od,ad]),P0=new Set([Dl,oa,Uu,Pl,od,ad]),DP="Shift",PP="Control",jP="Alt",IP="Meta",NP=new Set([DP,PP,jP,IP]);function BP(e){return en(e)&&e.tagName==="INPUT"}function kC(e){return!!(BP(e)&&e.selectionStart!=null||en(e)&&e.tagName==="TEXTAREA")}function TC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,u=e.scrollTop;const h=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(h&&s!=="vertical"){const l=LC(e,t,"left"),d=Yf(e),p=Yf(t);n==="ltr"&&(l+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?o=l+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:l-p.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(o=l-p.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(l-p.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?o=l-p.scrollMarginLeft-d.scrollPaddingLeft:l+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(o=l+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(a&&s!=="horizontal"){const l=LC(e,t,"top"),d=Yf(e),p=Yf(t);l-p.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?u=l-p.scrollMarginTop-d.scrollPaddingTop:l+t.offsetHeight+p.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(u=l+t.offsetHeight+p.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:o,top:u,behavior:"auto"})}function LC(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[s],t.offsetParent!==e);)t=t.offsetParent;return o}function Yf(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const zP={...xo,...Gs,nestedDialogOpen(e){return e?{[TP.nestedDialogOpen]:""}:null}},xR=R.forwardRef(function(t,n){const{className:s,finalFocus:o,initialFocus:u,render:h,...a}=t,{store:l}=Ei(),d=l.useState("descriptionElementId"),p=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),g=l.useState("popupProps"),S=l.useState("modal"),C=l.useState("mounted"),w=l.useState("nested"),b=l.useState("nestedOpenDialogCount"),x=l.useState("open"),_=l.useState("openMethod"),y=l.useState("titleElementId"),E=l.useState("transitionStatus"),T=l.useState("role");LP(),Ur({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});function A(H){return H==="touch"?l.context.popupRef.current:!0}const M=u===void 0?A:u,L=b>0,D=R.useMemo(()=>({open:x,nested:w,transitionStatus:E,nestedDialogOpen:L}),[x,w,E,L]),z=at("div",t,{state:D,props:[g,{"aria-labelledby":y??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!C,onKeyDown(H){P0.has(H.key)&&H.stopPropagation()},style:{[kP.nestedDialogs]:b}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:zP});return v.jsx(yp,{context:f,openInteractionType:_,disabled:!C,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:S!==!1,restoreFocus:"popup",children:z})});function wp(e){return a0(19)?e:e?"true":void 0}const Ep=R.forwardRef(function(t,n){const{cutout:s,...o}=t;let u;if(s){const h=s?.getBoundingClientRect();u=`polygon(
11
+ 0% 0%,
12
+ 100% 0%,
13
+ 100% 100%,
14
+ 0% 100%,
15
+ 0% 0%,
16
+ ${h.left}px ${h.top}px,
17
+ ${h.left}px ${h.bottom}px,
18
+ ${h.right}px ${h.bottom}px,
19
+ ${h.right}px ${h.top}px,
20
+ ${h.left}px ${h.top}px
21
+ )`}return v.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),SR=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Ei(),h=u.useState("mounted"),a=u.useState("modal");return h||s?v.jsx(vR.Provider,{value:s,children:v.jsxs(_p,{ref:n,...o,children:[h&&a===!0&&v.jsx(Ep,{ref:u.context.internalBackdropRef,inert:wp(!open)}),t.children]})}):null});let AC={},OC={},MC="";function HP(e){if(typeof document>"u")return!1;const t=xr(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function FP(e){const t=xr(e),n=t.documentElement,s=t.body,o=Aa(n)?n:s,u=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=u}}function VP(e){const t=xr(e),n=t.documentElement,s=t.body,o=Rn(n);let u=0,h=0;const a=Ns.create(),l=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(y0&&(o.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),S=o.getComputedStyle(s),b=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,h=n.scrollLeft,AC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},MC=n.style.scrollBehavior,OC={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,_=n.scrollWidth>n.clientWidth,y=g.overflowY==="scroll"||S.overflowY==="scroll",E=g.overflowX==="scroll"||S.overflowX==="scroll",T=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),M=parseFloat(S.marginTop)+parseFloat(S.marginBottom),L=parseFloat(S.marginLeft)+parseFloat(S.marginRight),D=Aa(n)?n:s;if(l){n.style.scrollbarGutter=b,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(x||y)&&(n.style.overflowY="scroll"),(_||E)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:M||A?`calc(100dvh - ${M+A}px)`:"100dvh",width:L||T?`calc(100vw - ${L+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=u,s.scrollLeft=h,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,AC),Object.assign(s.style,OC),l||(n.scrollTop=u,n.scrollLeft=h,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=MC)}function f(){p(),a.request(d)}return d(),o.addEventListener("resize",f),()=>{a.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class UP{lockCount=0;restore=null;timeoutLock=ka.create();timeoutUnlock=ka.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=xr(t).documentElement,o=Rn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=on;return}const u=iD||!HP(t);this.restore=u?FP(t):VP(t)}}const WP=new UP;function Rp(e=!0,t=null){Fe(()=>{if(e)return WP.acquire(t)},[e,t])}function qP(e){const t=R.useRef(""),n=R.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:R.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function kp(e){const[t,n]=R.useState(null),s=Pe((a,l)=>{e||n(l)}),o=R.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:h}=qP(s);return R.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function CR(e){const{store:t,parentContext:n,actionsRef:s}=e,o=t.useState("open"),u=t.useState("disablePointerDismissal"),h=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:d,reset:p}=kp(o);uR(t);const{forceUnmount:f}=dR(o,t,()=>{p()}),g=Pe(z=>{const H=Ue(z);return H.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},H}),S=R.useCallback(()=>{t.setOpen(!1,g(yE))},[t,g]);R.useImperativeHandle(s,()=>({unmount:f,close:S}),[f,S]);const C=pR({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,b]=R.useState(0),x=w===0,_=gR(C),y=xp(C,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(z){if("button"in z&&z.button!==0||"touches"in z&&z.touches.length!==1)return!1;const H=Pn(z);if(x&&!u){const $=H;return h&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===$||t.context.backdropRef.current===$||ft($,a)&&!$?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:x});Rp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=oc([_,y]);t.useContextCallback("onNestedDialogOpen",z=>{b(z+1)}),t.useContextCallback("onNestedDialogClose",()=>{b(0)}),R.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,w]);const M=R.useMemo(()=>E(d),[E,d]),L=R.useMemo(()=>A(d),[A,d]),D=R.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:l,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:D,floatingRootContext:C,nestedOpenDialogCount:w})}const GP={...hR,modal:Ee(e=>e.modal),nested:Ee(e=>e.nested),nestedOpenDialogCount:Ee(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ee(e=>e.disablePointerDismissal),openMethod:Ee(e=>e.openMethod),descriptionElementId:Ee(e=>e.descriptionElementId),titleElementId:Ee(e=>e.titleElementId),viewportElement:Ee(e=>e.viewportElement),role:Ee(e=>e.role)};class wR extends L0{constructor(t){super($P(t),{popupRef:R.createRef(),backdropRef:R.createRef(),internalBackdropRef:R.createRef(),triggerElements:new Sp,onOpenChange:void 0,onOpenChangeComplete:void 0},GP)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const o={open:t},u=n.trigger?.id??null;(u||t)&&(o.activeTriggerId=u,o.activeTriggerElement=n.trigger??null),this.update(o)}}function $P(e={}){return{...fR(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function KP(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,disablePointerDismissal:h=!1,modal:a=!0,actionsRef:l,handle:d,triggerId:p,defaultTriggerId:f=null}=e,g=Ei(!0),S=!!g,C=Gn(()=>d?.store??new wR({open:n??s,activeTriggerId:p!==void 0?p:f,modal:a,disablePointerDismissal:h,nested:S})).current;C.useControlledProp("open",n,s),C.useControlledProp("activeTriggerId",p,f),C.useSyncedValues({disablePointerDismissal:h,nested:S,modal:a}),C.useContextCallback("onOpenChange",o),C.useContextCallback("onOpenChangeComplete",u);const w=C.useState("payload");CR({store:C,actionsRef:l,parentContext:g?.store.context});const b=R.useMemo(()=>({store:C}),[C]);return v.jsx(m0.Provider,{value:b,children:typeof t=="function"?t({payload:w}):t})}const ER=R.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=Ei(),l=ar(u);return a.useSyncedValueWithCleanup("titleElementId",l),at("h2",t,{ref:n,props:[{id:l},h]})}),RR=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,payload:l,handle:d,...p}=t,f=Ei(!0),g=d?.store??f?.store;if(!g)throw new Error(Pt(79));const S=ar(a),C=g.useState("floatingRootContext"),w=g.useState("isOpenedByTrigger",S),b=R.useRef(null),{registerTrigger:x,isMountedByThisTrigger:_}=cR(S,b,g,{payload:l}),{getButtonProps:y,buttonRef:E}=Sr({disabled:u,native:h}),T=id(C,{enabled:C!=null}),A=oc([T]),M=R.useMemo(()=>({disabled:u,open:w}),[u,w]),L=g.useState("triggerProps",_);return at("button",t,{state:M,ref:[E,n,x,b],props:[A.getReferenceProps(),L,{[$2]:"",id:S},p,y],stateAttributesMapping:g0})});function xs({...e}){return v.jsx(KP,{"data-slot":"dialog",...e})}function kR({...e}){return v.jsx(RR,{"data-slot":"dialog-trigger",...e})}function YP({...e}){return v.jsx(SR,{"data-slot":"dialog-portal",...e})}function j0({...e}){return v.jsx(vp,{"data-slot":"dialog-close",...e})}function XP({className:e,...t}){return v.jsx(vE,{"data-slot":"dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ss({className:e,children:t,showCloseButton:n=!0,...s}){return v.jsxs(YP,{children:[v.jsx(XP,{}),v.jsxs(xR,{"data-slot":"dialog-content",className:Be("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...s,children:[t,n&&v.jsxs(vp,{"data-slot":"dialog-close",render:v.jsx(Ne,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[v.jsx(ve,{icon:Si,strokeWidth:2}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Bs({className:e,...t}){return v.jsx("div",{"data-slot":"dialog-header",className:Be("gap-1 flex flex-col",e),...t})}function vo({className:e,showCloseButton:t=!1,children:n,...s}){return v.jsxs("div",{"data-slot":"dialog-footer",className:Be("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&v.jsx(vp,{render:v.jsx(Ne,{variant:"outline"}),children:"Close"})]})}function zs({className:e,...t}){return v.jsx(ER,{"data-slot":"dialog-title",className:Be("text-sm font-medium",e),...t})}function aa({className:e,...t}){return v.jsx(bE,{"data-slot":"dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}let DC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const QP={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ja={valid(e){return e===null?null:e?{[DC.valid]:""}:{[DC.invalid]:""}}},ZP=R.createContext({invalid:void 0,name:void 0,validityData:{state:QP,errors:[],error:"",value:"",initialValue:null},setValidityData:on,disabled:void 0,touched:!1,setTouched:on,dirty:!1,setDirty:on,filled:!1,setFilled:on,focused:!1,setFocused:on,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=tn)=>e,getInputValidationProps:(e=tn)=>e,inputRef:{current:null},commit:async()=>{}}});function us(e=!0){const t=R.useContext(ZP);if(t.setValidityData===on&&!e)throw new Error(Pt(28));return t}const JP=R.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:on,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function ld(){return R.useContext(JP)}const e8=R.createContext({controlId:void 0,setControlId:on,labelId:void 0,setLabelId:on,messageIds:[],setMessageIds:on,getDescriptionProps:e=>e});function wo(){return R.useContext(e8)}function t8(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function as({controlled:e,default:t,name:n,state:s="value"}){const{current:o}=R.useRef(e!==void 0),[u,h]=R.useState(t),a=o?e:u,l=R.useCallback(d=>{o||h(d)},[]);return[a,l]}function Tp(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:o,setControlId:u}=wo(),h=ar(t);return Fe(()=>{if(!(!n&&!t||u===on)){if(n){const a=s?.current;Nt(a)&&a.closest("label")!=null?u(t??null):u(o??h)}else t&&u(t);return()=>{t&&u(void 0)}}},[t,s,o,u,n,h]),o??h}function cd(e){const{enabled:t=!0,value:n,id:s,name:o,controlRef:u,commit:h}=e,{formRef:a}=ld(),{invalid:l,markedDirtyRef:d,validityData:p,setValidityData:f}=us(),g=Pe(e.getValue);Fe(()=>{if(!t)return;let S=n;S===void 0&&(S=g()),p.initialValue===null&&S!==null&&f(C=>({...C,initialValue:S}))},[t,f,n,p.initialValue,g]),Fe(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:t8(p,l),validate(){let S=n;S===void 0&&(S=g()),d.current=!0,er.flushSync(()=>h(S))}})},[h,u,t,a,g,s,l,d,o,p,n]),Fe(()=>{const S=a.current.fields;return()=>{s&&S.delete(s)}},[a,s])}const n8=R.forwardRef(function(t,n){const{render:s,className:o,id:u,name:h,value:a,disabled:l=!1,onValueChange:d,defaultValue:p,...f}=t,{state:g,name:S,disabled:C}=us(),w=C||l,b=S??h,x=R.useMemo(()=>({...g,disabled:w}),[g,w]),{setTouched:_,setDirty:y,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=us(),{labelId:D}=wo(),z=Tp({id:u});Fe(()=>{const V=a!=null;L.inputRef.current?.value||V&&a!==""?A(!0):V&&a===""&&A(!1)},[L.inputRef,A,a]);const[H,$]=as({controlled:a,default:p,name:"FieldControl",state:"value"}),N=a!==void 0,q=Pe((V,Y)=>{d?.(V,Y),!Y.isCanceled&&$(V)});return cd({id:z,name:b,commit:L.commit,value:H,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),at("input",t,{ref:n,state:x,props:[{id:z,disabled:w,name:b,ref:L.inputRef,"aria-labelledby":D,...N?{value:H}:{defaultValue:p},onChange(V){const Y=V.currentTarget.value;q(Y,Ue(Mn,V.nativeEvent)),y(Y!==E.initialValue),A(Y!=="")},onFocus(){T(!0)},onBlur(V){_(!0),T(!1),M==="onBlur"&&L.commit(V.currentTarget.value)},onKeyDown(V){V.currentTarget.tagName==="INPUT"&&V.key==="Enter"&&(_(!0),L.commit(V.currentTarget.value))}},L.getInputValidationProps(),f],stateAttributesMapping:ja})}),r8=R.createContext({disabled:!1});function s8(){return R.useContext(r8)}const i8=R.createContext(void 0);function o8(e=!0){const t=R.useContext(i8);if(t===void 0&&!e)throw new Error(Pt(3));return t}const a8=R.forwardRef(function(t,n){return v.jsx(n8,{ref:n,...t})});function Wt({className:e,type:t,...n}){return v.jsx(a8,{type:t,"data-slot":"input",className:Be("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function I0({className:e,...t}){return v.jsx("textarea",{"data-slot":"textarea",className:Be("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}async function TR(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/uploads",{method:"POST",body:t});if(!n.ok)throw new Error("Failed to upload image");return(await n.json()).path}function l8(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const c8=e=>{switch(e){case"success":return f8;case"info":return p8;case"warning":return h8;case"error":return m8;default:return null}},u8=Array(12).fill(0),d8=({visible:e,className:t})=>ze.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ze.createElement("div",{className:"sonner-spinner"},u8.map((n,s)=>ze.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),f8=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),h8=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),p8=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),m8=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ze.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),g8=ze.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ze.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ze.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),v8=()=>{const[e,t]=ze.useState(document.hidden);return ze.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let C_=1;class _8{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...o}=t,u=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:C_++,h=this.toasts.find(l=>l.id===u),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),h?this.toasts=this.toasts.map(l=>l.id===u?(this.publish({...l,...t,id:u,title:s}),{...l,...t,id:u,dismissible:a,title:s}):l):this.addToast({title:s,...o,dismissible:a,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,h;const a=o.then(async d=>{if(h=["resolve",d],ze.isValidElement(d))u=!1,this.create({id:s,type:"default",message:d});else if(b8(d)&&!d.ok){u=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(d instanceof Error){u=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(n.success!==void 0){u=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!ze.isValidElement(f)?f:{message:f};this.create({id:s,type:"success",description:g,...C})}}).catch(async d=>{if(h=["reject",d],n.error!==void 0){u=!1;const p=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,S=typeof p=="object"&&!ze.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:f,...S})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((d,p)=>a.then(()=>h[0]==="reject"?p(h[1]):d(h[1])).catch(p));return typeof s!="string"&&typeof s!="number"?{unwrap:l}:Object.assign(s,{unwrap:l})},this.custom=(t,n)=>{const s=n?.id||C_++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gr=new _8,y8=(e,t)=>{const n=t?.id||C_++;return gr.addToast({title:e,...t,id:n}),n},b8=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",x8=y8,S8=()=>gr.toasts,C8=()=>gr.getActiveToasts(),yr=Object.assign(x8,{success:gr.success,info:gr.info,warning:gr.warning,error:gr.error,custom:gr.custom,message:gr.message,promise:gr.promise,dismiss:gr.dismiss,loading:gr.loading},{getHistory:S8,getToasts:C8});l8("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Xf(e){return e.label!==void 0}const w8=3,E8="24px",R8="16px",PC=4e3,k8=356,T8=14,L8=45,A8=200;function Ms(...e){return e.filter(Boolean).join(" ")}function O8(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const M8=e=>{var t,n,s,o,u,h,a,l,d;const{invert:p,toast:f,unstyled:g,interacting:S,setHeights:C,visibleToasts:w,heights:b,index:x,toasts:_,expanded:y,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:D,className:z="",descriptionClassName:H="",duration:$,position:N,gap:q,expandByDefault:K,classNames:V,icons:Y,closeButtonAriaLabel:G="Close toast"}=e,[j,W]=ze.useState(null),[P,I]=ze.useState(null),[F,X]=ze.useState(!1),[te,ee]=ze.useState(!1),[Q,U]=ze.useState(!1),[se,ne]=ze.useState(!1),[re,oe]=ze.useState(!1),[le,_e]=ze.useState(0),[ge,ue]=ze.useState(0),de=ze.useRef(f.duration||$||PC),Ie=ze.useRef(null),De=ze.useRef(null),Oe=x===0,be=x+1<=w,Me=f.type,pe=f.dismissible!==!1,ke=f.className||"",we=f.descriptionClassName||"",We=ze.useMemo(()=>b.findIndex(Je=>Je.toastId===f.id)||0,[b,f.id]),et=ze.useMemo(()=>{var Je;return(Je=f.closeButton)!=null?Je:A},[f.closeButton,A]),xe=ze.useMemo(()=>f.duration||$||PC,[f.duration,$]),Ge=ze.useRef(0),tt=ze.useRef(0),dt=ze.useRef(0),Se=ze.useRef(null),[He,Re]=N.split("-"),nt=ze.useMemo(()=>b.reduce((Je,Ot,It)=>It>=We?Je:Je+Ot.height,0),[b,We]),lt=v8(),Xe=f.invert||p,st=Me==="loading";tt.current=ze.useMemo(()=>We*q+nt,[We,nt]),ze.useEffect(()=>{de.current=xe},[xe]),ze.useEffect(()=>{X(!0)},[]),ze.useEffect(()=>{const Je=De.current;if(Je){const Ot=Je.getBoundingClientRect().height;return ue(Ot),C(It=>[{toastId:f.id,height:Ot,position:f.position},...It]),()=>C(It=>It.filter(ot=>ot.toastId!==f.id))}},[C,f.id]),ze.useLayoutEffect(()=>{if(!F)return;const Je=De.current,Ot=Je.style.height;Je.style.height="auto";const It=Je.getBoundingClientRect().height;Je.style.height=Ot,ue(It),C(ot=>ot.find(bt=>bt.toastId===f.id)?ot.map(bt=>bt.toastId===f.id?{...bt,height:It}:bt):[{toastId:f.id,height:It,position:f.position},...ot])},[F,f.title,f.description,C,f.id,f.jsx,f.action,f.cancel]);const Ct=ze.useCallback(()=>{ee(!0),_e(tt.current),C(Je=>Je.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},A8)},[f,E,C,tt]);ze.useEffect(()=>{if(f.promise&&Me==="loading"||f.duration===1/0||f.type==="loading")return;let Je;return y||S||lt?(()=>{if(dt.current<Ge.current){const ot=new Date().getTime()-Ge.current;de.current=de.current-ot}dt.current=new Date().getTime()})():de.current!==1/0&&(Ge.current=new Date().getTime(),Je=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},de.current)),()=>clearTimeout(Je)},[y,S,f,Me,lt,Ct]),ze.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function ct(){var Je;if(Y?.loading){var Ot;return ze.createElement("div",{className:Ms(V?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Me==="loading"},Y.loading)}return ze.createElement(d8,{className:Ms(V?.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader),visible:Me==="loading"})}const nn=f.icon||Y?.[Me]||c8(Me);var kt,vt;return ze.createElement("li",{tabIndex:0,ref:De,className:Ms(z,ke,V?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,V?.default,V?.[Me],f==null||(n=f.classNames)==null?void 0:n[Me]),"data-sonner-toast":"","data-rich-colors":(kt=f.richColors)!=null?kt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":F,"data-promise":!!f.promise,"data-swiped":re,"data-removed":te,"data-visible":be,"data-y-position":He,"data-x-position":Re,"data-index":x,"data-front":Oe,"data-swiping":Q,"data-dismissible":pe,"data-type":Me,"data-invert":Xe,"data-swipe-out":se,"data-swipe-direction":P,"data-expanded":!!(y||K&&F),"data-testid":f.testId,style:{"--index":x,"--toasts-before":x,"--z-index":_.length-x,"--offset":`${te?le:tt.current}px`,"--initial-height":K?"auto":`${ge}px`,...M,...f.style},onDragEnd:()=>{U(!1),W(null),Se.current=null},onPointerDown:Je=>{Je.button!==2&&(st||!pe||(Ie.current=new Date,_e(tt.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(U(!0),Se.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,Ot,It;if(se||!pe)return;Se.current=null;const ot=Number(((Je=De.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=De.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((It=Ie.current)==null?void 0:It.getTime()),xt=j==="x"?ot:wt,Qe=Math.abs(xt)/bt;if(Math.abs(xt)>=L8||Qe>.11){_e(tt.current),f.onDismiss==null||f.onDismiss.call(f,f),I(j==="x"?ot>0?"right":"left":wt>0?"down":"up"),Ct(),ne(!0);return}else{var Ht,kn;(Ht=De.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(kn=De.current)==null||kn.style.setProperty("--swipe-amount-y","0px")}oe(!1),U(!1),W(null)},onPointerMove:Je=>{var Ot,It,ot;if(!Se.current||!pe||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Je.clientY-Se.current.y,xt=Je.clientX-Se.current.x;var Qe;const Ht=(Qe=e.swipeDirections)!=null?Qe:O8(N);!j&&(Math.abs(xt)>1||Math.abs(bt)>1)&&W(Math.abs(xt)>Math.abs(bt)?"x":"y");let kn={x:0,y:0};const Yn=zn=>1/(1.5+Math.abs(zn)/20);if(j==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&bt<0||Ht.includes("bottom")&&bt>0)kn.y=bt;else{const zn=bt*Yn(bt);kn.y=Math.abs(zn)<Math.abs(bt)?zn:bt}}else if(j==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&xt<0||Ht.includes("right")&&xt>0)kn.x=xt;else{const zn=xt*Yn(xt);kn.x=Math.abs(zn)<Math.abs(xt)?zn:xt}(Math.abs(kn.x)>0||Math.abs(kn.y)>0)&&oe(!0),(It=De.current)==null||It.style.setProperty("--swipe-amount-x",`${kn.x}px`),(ot=De.current)==null||ot.style.setProperty("--swipe-amount-y",`${kn.y}px`)}},et&&!f.jsx&&Me!=="loading"?ze.createElement("button",{"aria-label":G,"data-disabled":st,"data-close-button":!0,onClick:st||!pe?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ms(V?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=Y?.close)!=null?vt:g8):null,(Me||f.icon||f.promise)&&f.icon!==null&&(Y?.[Me]!==null||f.icon)?ze.createElement("div",{"data-icon":"",className:Ms(V?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ct():null,f.type!=="loading"?nn:null):null,ze.createElement("div",{"data-content":"",className:Ms(V?.content,f==null||(u=f.classNames)==null?void 0:u.content)},ze.createElement("div",{"data-title":"",className:Ms(V?.title,f==null||(h=f.classNames)==null?void 0:h.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ze.createElement("div",{"data-description":"",className:Ms(H,we,V?.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),ze.isValidElement(f.cancel)?f.cancel:f.cancel&&Xf(f.cancel)?ze.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Je=>{Xf(f.cancel)&&pe&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Je),Ct())},className:Ms(V?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,ze.isValidElement(f.action)?f.action:f.action&&Xf(f.action)?ze.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:Je=>{Xf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Je),!Je.defaultPrevented&&Ct())},className:Ms(V?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function jC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function D8(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?R8:E8;function l(d){["top","right","bottom","left"].forEach(p=>{n[`${h}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?l(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${h}-${d}`]=a:n[`${h}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):l(a)}),n}const P8=ze.forwardRef(function(t,n){const{id:s,invert:o,position:u="bottom-right",hotkey:h=["altKey","KeyT"],expand:a,closeButton:l,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:S,duration:C,style:w,visibleToasts:b=w8,toastOptions:x,dir:_=jC(),gap:y=T8,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=ze.useState([]),L=ze.useMemo(()=>s?A.filter(F=>F.toasterId===s):A.filter(F=>!F.toasterId),[A,s]),D=ze.useMemo(()=>Array.from(new Set([u].concat(L.filter(F=>F.position).map(F=>F.position)))),[L,u]),[z,H]=ze.useState([]),[$,N]=ze.useState(!1),[q,K]=ze.useState(!1),[V,Y]=ze.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ze.useRef(null),j=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ze.useRef(null),P=ze.useRef(!1),I=ze.useCallback(F=>{M(X=>{var te;return(te=X.find(ee=>ee.id===F.id))!=null&&te.delete||gr.dismiss(F.id),X.filter(({id:ee})=>ee!==F.id)})},[]);return ze.useEffect(()=>gr.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{M(X=>X.map(te=>te.id===F.id?{...te,delete:!0}:te))});return}setTimeout(()=>{K3.flushSync(()=>{M(X=>{const te=X.findIndex(ee=>ee.id===F.id);return te!==-1?[...X.slice(0,te),{...X[te],...F},...X.slice(te+1)]:[F,...X]})})})}),[A]),ze.useEffect(()=>{if(g!=="system"){Y(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:X})=>{Y(X?"dark":"light")})}catch{F.addListener(({matches:te})=>{try{Y(te?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),ze.useEffect(()=>{A.length<=1&&N(!1)},[A]),ze.useEffect(()=>{const F=X=>{var te;if(h.every(U=>X[U]||X.code===U)){var Q;N(!0),(Q=G.current)==null||Q.focus()}X.code==="Escape"&&(document.activeElement===G.current||(te=G.current)!=null&&te.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[h]),ze.useEffect(()=>{if(G.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,P.current=!1)}},[G.current]),ze.createElement("section",{ref:n,"aria-label":`${T} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((F,X)=>{var te;const[ee,Q]=F.split("-");return L.length?ze.createElement("ol",{key:F,dir:_==="auto"?jC():_,tabIndex:-1,ref:G,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":ee,"data-x-position":Q,style:{"--front-toast-height":`${((te=z[0])==null?void 0:te.height)||0}px`,"--width":`${k8}px`,"--gap":`${y}px`,...w,...D8(p,f)},onBlur:U=>{P.current&&!U.currentTarget.contains(U.relatedTarget)&&(P.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||P.current||(P.current=!0,W.current=U.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{q||N(!1)},onDragEnd:()=>N(!1),onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},L.filter(U=>!U.position&&X===0||U.position===F).map((U,se)=>{var ne,re;return ze.createElement(M8,{key:U.id,icons:E,index:se,toast:U,defaultRichColors:S,duration:(ne=x?.duration)!=null?ne:C,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(re=x?.closeButton)!=null?re:l,interacting:q,position:F,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:I,toasts:L.filter(oe=>oe.position==U.position),heights:z.filter(oe=>oe.position==U.position),setHeights:H,expandByDefault:a,gap:y,expanded:$,swipeDirections:t.swipeDirections})})):null}))});function j8(e){const t=/\/[\w\-/.]+\.(png|jpg|jpeg|gif|webp|svg)/gi;return[...e.match(t)||[]]}function IC(e){return`/api/uploads/${e.split("/").pop()}`}function LR({value:e,onValueChange:t,className:n,disabled:s,...o}){const[u,h]=R.useState(!1),a=R.useRef(null),l=j8(e),d=async p=>{const f=p.clipboardData?.items;if(f){for(const g of f)if(g.type.startsWith("image/")){p.preventDefault();const S=g.getAsFile();if(!S)return;h(!0);try{const C=await TR(S),w=a.current;if(w){const b=w.selectionStart,x=w.selectionEnd,_=e.slice(0,b),y=e.slice(x),E=_&&!_.endsWith(`
22
+ `)?`
23
+ `:"",T=y&&!y.startsWith(`
24
+ `)?`
25
+ `:"",A=_+E+C+T+y;t(A)}else t(e+(e?`
26
+ `:"")+C)}catch(C){yr.error("Failed to upload image"),console.error("Upload error:",C)}finally{h(!1)}return}}};return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(I0,{ref:a,value:e,onChange:p=>t(p.target.value),onPaste:d,className:Be(u&&"opacity-50",n),disabled:u||s,...o}),u&&v.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:v.jsx("span",{className:"text-sm text-muted-foreground",children:"Uploading..."})})]}),l.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2",children:l.map((p,f)=>v.jsx("a",{href:IC(p),target:"_blank",rel:"noopener noreferrer",className:"block",children:v.jsx("img",{src:IC(p),alt:`Attachment ${f+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},f))})]})}function I8({className:e,...t}){return v.jsx("label",{"data-slot":"label",className:Be("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const N8=R.forwardRef(function(t,n){const{className:s,render:o,orientation:u="horizontal",...h}=t,a=R.useMemo(()=>({orientation:u}),[u]);return at("div",t,{state:a,ref:n,props:[{role:"separator","aria-orientation":u},h]})});function B8({className:e,orientation:t="horizontal",...n}){return v.jsx(N8,{"data-slot":"separator",orientation:t,className:Be("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function ud({className:e,...t}){return v.jsx("div",{"data-slot":"field-group",className:Be("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const z8=Oa("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function Cn({className:e,orientation:t="vertical",...n}){return v.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Be(z8({orientation:t}),e),...n})}function wn({className:e,...t}){return v.jsx(I8,{"data-slot":"field-label",className:Be("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function ao({className:e,...t}){return v.jsx("p",{"data-slot":"field-description",className:Be("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function AR(e){const t=R.useRef(!0);t.current&&(t.current=!1,e())}const OR=R.createContext(null),MR=R.createContext(null);function $s(){const e=R.useContext(OR);if(e===null)throw new Error(Pt(60));return e}function DR(){const e=R.useContext(MR);if(e===null)throw new Error(Pt(61));return e}const PR=(e,t)=>Object.is(e,t);function wi(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function la(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:wi(s,t,n))}function Kl(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:wi(s,t,n))}function jR(e,t,n){return e.filter(s=>!wi(s,t,n))}function w_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function IR(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function An(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return w_(e)}function ys(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?w_(e.value):w_(e)}function H8(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??An(e,n);if(Array.isArray(t)){const s=IR(t)?t.flatMap(o=>o.items):t;if(e==null){const o=s.find(u=>u.value==null);return o&&o.label!=null?o.label:An(e,n)}if(typeof e!="object"){const o=s.find(u=>u&&u.value===e);return o&&o.label!=null?o.label:An(e,n)}if("value"in e){const o=s.find(u=>u&&u.value===e.value);if(o&&o.label!=null)return o.label}}return An(e,n)}function F8(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>An(n,t)).join(", ")}const ht={id:Ee(e=>e.id),modal:Ee(e=>e.modal),multiple:Ee(e=>e.multiple),items:Ee(e=>e.items),itemToStringLabel:Ee(e=>e.itemToStringLabel),itemToStringValue:Ee(e=>e.itemToStringValue),isItemEqualToValue:Ee(e=>e.isItemEqualToValue),value:Ee(e=>e.value),open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),forceMount:Ee(e=>e.forceMount),transitionStatus:Ee(e=>e.transitionStatus),openMethod:Ee(e=>e.openMethod),activeIndex:Ee(e=>e.activeIndex),selectedIndex:Ee(e=>e.selectedIndex),isActive:Ee((e,t)=>e.activeIndex===t),isSelected:Ee((e,t,n)=>{const s=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(u=>wi(u,n,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:wi(o,n,s)}),isSelectedByFocus:Ee((e,t)=>e.selectedIndex===t),popupProps:Ee(e=>e.popupProps),triggerProps:Ee(e=>e.triggerProps),triggerElement:Ee(e=>e.triggerElement),positionerElement:Ee(e=>e.positionerElement),listElement:Ee(e=>e.listElement),scrollUpArrowVisible:Ee(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ee(e=>e.scrollDownArrowVisible),hasScrollArrows:Ee(e=>e.hasScrollArrows),serializedValue:Ee(e=>{const{multiple:t,value:n,itemToStringValue:s}=e;return t&&Array.isArray(n)&&n.length===0?"":ys(n,s)})};function ca(e,t){const n=R.useRef(e),s=Pe(t);Fe(()=>{n.current!==e&&s(n.current)},[e,s]),Fe(()=>{n.current=e},[e])}function V8(e){const{id:t,value:n,defaultValue:s=null,onValueChange:o,open:u,defaultOpen:h=!1,onOpenChange:a,name:l,disabled:d=!1,readOnly:p=!1,required:f=!1,modal:g=!0,actionsRef:S,inputRef:C,onOpenChangeComplete:w,items:b,multiple:x=!1,itemToStringLabel:_,itemToStringValue:y,isItemEqualToValue:E=PR,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=ld(),{setDirty:L,shouldValidateOnChange:D,validityData:z,setFilled:H,name:$,disabled:N,validation:q}=us(),{controlId:K}=wo(),V=Tp({id:t}),Y=N||d,G=$??l,[j,W]=as({controlled:n,default:x?s??br:s,name:"Select",state:"value"}),[P,I]=as({controlled:u,default:h,name:"Select",state:"open"}),F=R.useRef([]),X=R.useRef([]),te=R.useRef(null),ee=R.useRef(null),Q=R.useRef(0),U=R.useRef(null),se=R.useRef([]),ne=R.useRef(!1),re=R.useRef(!1),oe=R.useRef(null),le=R.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),_e=R.useRef(!1),{mounted:ge,setMounted:ue,transitionStatus:de}=ki(P),{openMethod:Ie,triggerProps:De,reset:Oe}=kp(P),be=Gn(()=>new va({id:V,modal:g,multiple:x,itemToStringLabel:_,itemToStringValue:y,isItemEqualToValue:E,value:j,open:P,mounted:ge,transitionStatus:de,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Me=Ae(be,ht.activeIndex),pe=Ae(be,ht.selectedIndex),ke=Ae(be,ht.triggerElement),we=Ae(be,ht.positionerElement),We=R.useMemo(()=>x&&Array.isArray(j)&&j.length===0?"":ys(j,y),[x,j,y]),et=R.useMemo(()=>x&&Array.isArray(j)?j.map(ot=>ys(ot,y)):ys(j,y),[x,j,y]),xe=hn(be.state.triggerElement);cd({id:V,commit:q.commit,value:j,controlRef:xe,name:G,getValue:()=>et});const Ge=R.useRef(j);Fe(()=>{j!==Ge.current&&be.set("forceMount",!0)},[be,j]),Fe(()=>{H(j!==null)},[j,H]),Fe(function(){if(P)return;const wt=se.current;if(x){const xt=Array.isArray(j)?j:[];if(xt.length===0){be.set("selectedIndex",null);return}const Qe=xt[xt.length-1],Ht=Kl(wt,Qe,E);be.set("selectedIndex",Ht===-1?null:Ht);return}const bt=Kl(wt,j,E);be.set("selectedIndex",bt===-1?null:bt)},[x,P,j,se,E,be]),ca(j,()=>{M(G),L(j!==z.initialValue),D()?q.commit(j):q.commit(j,!0)});const tt=Pe((ot,wt)=>{if(a?.(ot,wt),!wt.isCanceled&&(I(ot),!ot&&be.state.activeIndex!==null)){const bt=F.current[be.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),dt=Pe(()=>{ue(!1),be.set("activeIndex",null),Oe(),w?.(!1)});Ur({enabled:!S,open:P,ref:te,onComplete(){P||dt()}}),R.useImperativeHandle(S,()=>({unmount:dt}),[dt]);const Se=Pe((ot,wt)=>{o?.(ot,wt),!wt.isCanceled&&W(ot)}),He=Pe(()=>{const ot=be.state.listElement||te.current;if(!ot)return;const wt=ot.scrollTop,bt=ot.scrollTop+ot.clientHeight,xt=wt>1,Qe=bt<ot.scrollHeight-1;be.state.scrollUpArrowVisible!==xt&&be.set("scrollUpArrowVisible",xt),be.state.scrollDownArrowVisible!==Qe&&be.set("scrollDownArrowVisible",Qe)}),Re=O0({open:P,onOpenChange:tt,elements:{reference:ke,floating:we}}),nt=id(Re,{enabled:!p&&!Y,event:"mousedown"}),lt=xp(Re,{bubbles:!1}),Xe=M0(Re,{enabled:!p&&!Y,listRef:F,activeIndex:Me,selectedIndex:pe,disabledIndices:br,onNavigate(ot){ot===null&&!P||be.set("activeIndex",ot)},focusItemOnHover:!1}),st=D0(Re,{enabled:!p&&!Y&&(P||!x),listRef:X,activeIndex:Me,selectedIndex:pe,onMatch(ot){P?be.set("activeIndex",ot):Se(se.current[ot],Ue("none"))},onTypingChange(ot){ne.current=ot}}),{getReferenceProps:Ct,getFloatingProps:ct,getItemProps:nn}=oc([nt,lt,Xe,st]),kt=R.useMemo(()=>Ws(Ct(),De),[Ct,De]);AR(()=>{be.update({popupProps:ct(),triggerProps:kt})}),Fe(()=>{be.update({id:V,modal:g,multiple:x,value:j,open:P,mounted:ge,transitionStatus:de,popupProps:ct(),triggerProps:kt,items:b,itemToStringLabel:_,itemToStringValue:y,isItemEqualToValue:E,openMethod:Ie})},[be,V,g,x,j,P,ge,de,ct,kt,b,_,y,E,Ie]);const vt=R.useMemo(()=>({store:be,name:G,required:f,disabled:Y,readOnly:p,multiple:x,itemToStringLabel:_,itemToStringValue:y,highlightItemOnHover:T,setValue:Se,setOpen:tt,listRef:F,popupRef:te,scrollHandlerRef:ee,handleScrollArrowVisibility:He,scrollArrowsMountedCountRef:Q,getItemProps:nn,events:Re.context.events,valueRef:U,valuesRef:se,labelsRef:X,typingRef:ne,selectionRef:le,selectedItemTextRef:oe,validation:q,onOpenChangeComplete:w,keyboardActiveRef:re,alignItemWithTriggerActiveRef:_e,initialValueRef:Ge}),[be,G,f,Y,p,x,_,y,T,Se,tt,nn,Re.context.events,q,w,He]),Je=cs(C,q.inputRef),Ot=x&&Array.isArray(j)&&j.length>0,It=R.useMemo(()=>!x||!Array.isArray(j)||!G?null:j.map(ot=>{const wt=ys(ot,y);return v.jsx("input",{type:"hidden",name:G,value:wt},wt)}),[x,j,G,y]);return v.jsx(OR.Provider,{value:vt,children:v.jsxs(MR.Provider,{value:Re,children:[A,v.jsx("input",{...q.getInputValidationProps({onFocus(){be.state.triggerElement?.focus()},onChange(ot){if(ot.nativeEvent.defaultPrevented)return;const wt=ot.target.value,bt=Ue(Mn,ot.nativeEvent);function xt(){if(x)return;const Qe=se.current.find(Ht=>ys(Ht,y).toLowerCase()===wt.toLowerCase());Qe!=null&&(L(Qe!==z.initialValue),Se(Qe,bt),D()&&q.commit(Qe))}be.set("forceMount",!0),queueMicrotask(xt)}}),id:t||K||void 0,name:x?void 0:G,value:We,disabled:Y,required:f&&!Ot,readOnly:p,ref:Je,style:ic,tabIndex:-1,"aria-hidden":!0}),It]})})}function N0(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const u=parseFloat(n.width)||0,h=parseFloat(n.height)||0,a=parseFloat(s.width)||0,l=parseFloat(s.height)||0,d=Math.max(t.width,u,a),p=Math.max(t.height,h,l),f=d-t.width,g=p-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Qf=2,U8={...zu,...ja,value:()=>null},W8=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{setTouched:l,setFocused:d,validationMode:p,state:f,disabled:g}=us(),{labelId:S}=wo(),{store:C,setOpen:w,selectionRef:b,validation:x,readOnly:_,alignItemWithTriggerActiveRef:y,disabled:E,keyboardActiveRef:T}=$s(),A=g||E||u,M=Ae(C,ht.open),L=Ae(C,ht.value),D=Ae(C,ht.triggerProps),z=Ae(C,ht.positionerElement),H=Ae(C,ht.listElement),$=Ae(C,ht.serializedValue),N=hn(z),q=R.useRef(null),K=Qt(),V=Qt(),{getButtonProps:Y,buttonRef:G}=Sr({disabled:A,native:h}),j=Pe(ee=>{C.set("triggerElement",ee)}),W=cs(n,q,G,j),P=Qt(),I=Qt();R.useEffect(()=>{if(M)return I.start(200,()=>{b.current.allowUnselectedMouseUp=!0,P.start(200,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{P.clear(),I.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},V.clear()},[M,b,V,P,I]);const F=R.useMemo(()=>H?.id??Hu(z)?.id,[H,z]),X=Ws(D,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?F:void 0,"aria-labelledby":S,"aria-readonly":_||void 0,tabIndex:A?-1:0,ref:W,onFocus(ee){d(!0),M&&y.current&&w(!1,Ue(Ra,ee.nativeEvent)),K.start(0,()=>{C.set("forceMount",!0)})},onBlur(){l(!0),d(!1),p==="onBlur"&&x.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(ee){if(M)return;const Q=xr(ee.currentTarget);function U(se){if(!q.current)return;const ne=se.target;if(ft(q.current,ne)||ft(N.current,ne)||ne===q.current)return;const re=N0(q.current);se.clientX>=re.left-Qf&&se.clientX<=re.right+Qf&&se.clientY>=re.top-Qf&&se.clientY<=re.bottom+Qf||w(!1,Ue(_E,se))}V.start(0,()=>{Q.addEventListener("mouseup",U,{once:!0})})}},x.getValidationProps,a,Y);X.role="combobox";const te=R.useMemo(()=>({...f,open:M,disabled:A,value:L,readOnly:_,placeholder:!$}),[f,M,A,L,_,$]);return at("button",t,{ref:[n,q],state:te,stateAttributesMapping:U8,props:X})}),q8={value:()=>null},G8=R.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:l}=$s(),d=Ae(a,ht.value),p=Ae(a,ht.items),f=Ae(a,ht.itemToStringLabel),g=Ae(a,ht.serializedValue),S=R.useMemo(()=>({value:d,placeholder:!g}),[d,g]),C=typeof u=="function"?u(d):u??(Array.isArray(d)?F8(d,f):H8(d,p,f));return at("span",t,{state:S,ref:[n,l],props:[{children:C},h],stateAttributesMapping:q8})}),$8=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=$s(),a=Ae(h,ht.open),l=R.useMemo(()=>({open:a}),[a]);return at("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:g0})}),K8=R.createContext(void 0),Y8=R.forwardRef(function(t,n){const{store:s}=$s(),o=Ae(s,ht.mounted),u=Ae(s,ht.forceMount);return o||u?v.jsx(K8.Provider,{value:!0,children:v.jsx(_p,{ref:n,...t})}):null}),NR=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function X8(){return R.useContext(NR)}function dd(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=Pe(o),h=R.useRef(0),a=Gn(Z8).current,l=Gn(Q8).current,[d,p]=R.useState(0),f=R.useRef(d),g=Pe((x,_)=>{l.set(x,_??null),f.current+=1,p(f.current)}),S=Pe(x=>{l.delete(x),f.current+=1,p(f.current)}),C=R.useMemo(()=>{const x=new Map;return Array.from(l.keys()).filter(y=>y.isConnected).sort(J8).forEach((y,E)=>{const T=l.get(y)??{};x.set(y,{...T,index:E})}),x},[l,d]);Fe(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const x=new MutationObserver(_=>{const y=new Set,E=T=>y.has(T)?y.delete(T):y.add(T);_.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),y.size===0&&(f.current+=1,p(f.current))});return C.forEach((_,y)=>{y.parentElement&&x.observe(y.parentElement,{childList:!0})}),()=>{x.disconnect()}},[C]),Fe(()=>{f.current===d&&(n.current.length!==C.size&&(n.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),h.current=C.size),u(C)},[u,C,n,s,d]),Fe(()=>()=>{n.current=[]},[n]),Fe(()=>()=>{s&&(s.current=[])},[s]);const w=Pe(x=>(a.add(x),()=>{a.delete(x)}));Fe(()=>{a.forEach(x=>x(C))},[a,C]);const b=R.useMemo(()=>({register:g,unregister:S,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:h}),[g,S,w,n,s,h]);return v.jsx(NR.Provider,{value:b,children:t})}function Q8(){return new Map}function Z8(){return new Set}function J8(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ej=R.createContext(void 0);function Ia(){return R.useContext(ej)?.direction??"ltr"}const tj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:u,platform:h,elements:a,middlewareData:l}=t,{element:d,padding:p=0,offsetParent:f="real"}=Ci(e,t)||{};if(d==null)return{};const g=OE(p),S={x:n,y:s},C=w0(o),w=C0(C),b=await h.getDimensions(d),x=C==="y",_=x?"top":"left",y=x?"bottom":"right",E=x?"clientHeight":"clientWidth",T=u.reference[w]+u.reference[C]-S[C]-u.floating[w],A=S[C]-u.reference[C],M=f==="real"?await h.getOffsetParent?.(d):a.floating;let L=a.floating[E]||u.floating[w];(!L||!await h.isElement?.(M))&&(L=a.floating[E]||u.floating[w]);const D=T/2-A/2,z=L/2-b[w]/2-1,H=Math.min(g[_],z),$=Math.min(g[y],z),N=H,q=L-b[w]-$,K=L/2-b[w]/2+D,V=v_(N,K,q),Y=!l.arrow&&So(o)!=null&&K!==V&&u.reference[w]/2-(K<N?H:$)-b[w]/2<0,G=Y?K<N?K-N:K-q:0;return{[C]:S[C]+G,data:{[C]:V,centerOffset:K-V-G,...Y&&{alignmentOffset:G}},reset:Y}}}),nj=(e,t)=>({...tj(e),options:[e,t]}),rj={name:"hide",async fn(e){const{width:t,height:n,x:s,y:o}=e.rects.reference,u=t===0&&n===0&&s===0&&o===0;return{data:{referenceHidden:(await z6().fn(e)).data?.referenceHidden||u}}}},sj={sideX:"left",sideY:"top"};function BR(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function NC(e,t,n){const{rects:s,placement:o}=e;return{side:BR(t,Hr(o),n),align:So(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function B0(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:h=0,collisionBoundary:a,collisionPadding:l=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:S,mounted:C,collisionAvoidance:w,shiftCrossAxis:b=!1,nodeId:x,adaptiveOrigin:_,lazyFlip:y=!1,externalTree:E}=e,[T,A]=R.useState(null);!C&&T!==null&&A(null);const M=w.side||"flip",L=w.align||"flip",D=w.fallbackAxisSide||"end",z=typeof t=="function"?t:void 0,H=Pe(z),$=z?H:t,N=hn(t),K=Ia()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":K?"left":"right","inline-start":K?"right":"left"}[s],Y=u==="center"?V:`${V}-${u}`;let G=l;const j=1,W=s==="bottom"?j:0,P=s==="top"?j:0,I=s==="right"?j:0,F=s==="left"?j:0;typeof G=="number"?G={top:G+W,right:G+F,bottom:G+P,left:G+I}:G&&(G={top:(G.top||0)+W,right:(G.right||0)+F,bottom:(G.bottom||0)+P,left:(G.left||0)+I});const X={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},te=R.useRef(null),ee=hn(o),Q=hn(h),ne=[P6(Xe=>{const st=NC(Xe,s,K),Ct=typeof ee.current=="function"?ee.current(st):ee.current,ct=typeof Q.current=="function"?Q.current(st):Q.current;return{mainAxis:Ct,crossAxis:ct,alignmentAxis:ct}},[typeof o!="function"?o:0,typeof h!="function"?h:0,K,s])],re=L==="none"&&M!=="shift",oe=!re&&(d||b||M==="shift"),le=M==="none"?null:N6({...X,padding:{top:G.top+j,right:G.right+j,bottom:G.bottom+j,left:G.left+j},mainAxis:!b&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),_e=re?null:j6(Xe=>{const st=xr(Xe.elements.floating).documentElement;return{...X,rootBoundary:b?{x:0,y:0,width:st.clientWidth,height:st.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||b?void 0:I6(Ct=>{if(!te.current)return{};const{width:ct,height:nn}=te.current.getBoundingClientRect(),kt=rs(Hr(Ct.placement)),vt=kt==="y"?ct:nn,Je=kt==="y"?G.left+G.right:G.top+G.bottom;return{offset:vt/2+Je/2}})}},[X,d,b,G,L]);M==="shift"||L==="shift"||u==="center"?ne.push(_e,le):ne.push(le,_e),ne.push(B6({...X,apply({elements:{floating:Xe},rects:{reference:st},availableWidth:Ct,availableHeight:ct}){Object.entries({"--available-width":`${Ct}px`,"--available-height":`${ct}px`,"--anchor-width":`${st.width}px`,"--anchor-height":`${st.height}px`}).forEach(([nn,kt])=>{Xe.style.setProperty(nn,kt)})}}),nj(()=>({element:te.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Xe){const{elements:st,middlewareData:Ct,placement:ct,rects:nn,y:kt}=Xe,vt=Hr(ct),Je=rs(vt),Ot=te.current,It=Ct.arrow?.x||0,ot=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,xt=It+wt/2,Qe=ot+bt/2,Ht=Math.abs(Ct.shift?.y||0),kn=nn.reference.height/2,Yn=typeof o=="function"?o(NC(Xe,s,K)):o,zn=Ht>Yn,Es={top:`${xt}px calc(100% + ${Yn}px)`,bottom:`${xt}px ${-Yn}px`,left:`calc(100% + ${Yn}px) ${Qe}px`,right:`${-Yn}px ${Qe}px`}[vt],Va=`${xt}px ${nn.reference.y+kn-kt}px`;return st.floating.style.setProperty("--transform-origin",oe&&Je==="y"&&zn?Va:Es),{}}},rj,_),Fe(()=>{!C&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[C,S]);const ge=R.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ue,elements:de,x:Ie,y:De,middlewareData:Oe,update:be,placement:Me,context:pe,isPositioned:ke,floatingStyles:we}=fP({rootContext:S,placement:Y,middleware:ne,strategy:n,whileElementsMounted:g?void 0:(...Xe)=>xC(...Xe,ge),nodeId:x,externalTree:E}),{sideX:We,sideY:et}=Oe.adaptiveOrigin||sj,xe=ke?n:"fixed",Ge=R.useMemo(()=>_?{position:xe,[We]:Ie,[et]:De}:{position:xe,...we},[_,xe,We,Ie,et,De,we]),tt=R.useRef(null);Fe(()=>{if(!C)return;const Xe=N.current,st=typeof Xe=="function"?Xe():Xe,ct=(BC(st)?st.current:st)||null||null;ct!==tt.current&&(ue.setPositionReference(ct),tt.current=ct)},[C,ue,$,N]),R.useEffect(()=>{if(!C)return;const Xe=N.current;typeof Xe!="function"&&BC(Xe)&&Xe.current!==tt.current&&(ue.setPositionReference(Xe.current),tt.current=Xe.current)},[C,ue,$,N]),R.useEffect(()=>{if(g&&C&&de.domReference&&de.floating)return xC(de.domReference,de.floating,be,ge)},[g,C,de,be,ge]);const dt=Hr(Me),Se=BR(s,dt,K),He=So(Me)||"center",Re=!!Oe.hide?.referenceHidden;Fe(()=>{y&&C&&ke&&A(dt)},[y,C,ke,dt]);const nt=R.useMemo(()=>({position:"absolute",top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),lt=Oe.arrow?.centerOffset!==0;return R.useMemo(()=>({positionerStyles:Ge,arrowStyles:nt,arrowRef:te,arrowUncentered:lt,side:Se,align:He,physicalSide:dt,anchorHidden:Re,refs:ue,context:pe,isPositioned:ke,update:be}),[Ge,nt,te,lt,Se,He,dt,Re,ue,pe,ke,be])}function BC(e){return e!=null&&"current"in e}const zR=R.createContext(void 0);function z0(){const e=R.useContext(zR);if(!e)throw new Error(Pt(59));return e}function Wh(e,t){e&&Object.assign(e.style,t)}const HR={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ij={position:"fixed"},oj=R.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a="bottom",align:l="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w,alignItemWithTrigger:b=!0,collisionAvoidance:x=l0,..._}=t,{store:y,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:D,popupRef:z,setValue:H}=$s(),$=DR(),N=Ae(y,ht.open),q=Ae(y,ht.mounted),K=Ae(y,ht.modal),V=Ae(y,ht.value),Y=Ae(y,ht.openMethod),G=Ae(y,ht.positionerElement),j=Ae(y,ht.triggerElement),W=Ae(y,ht.isItemEqualToValue),P=R.useRef(null),I=R.useRef(null),[F,X]=R.useState(b),te=q&&F&&Y!=="touch";!q&&F!==b&&X(b),Fe(()=>{q||(ht.scrollUpArrowVisible(y.state)&&y.set("scrollUpArrowVisible",!1),ht.scrollDownArrowVisible(y.state)&&y.set("scrollDownArrowVisible",!1))},[y,q]),R.useImperativeHandle(A,()=>te),Rp((te||K)&&N&&Y!=="touch",j);const ee=B0({anchor:s,floatingRootContext:$,positionMethod:o,mounted:q,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:S,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w??te,collisionAvoidance:x,keepMounted:!0}),Q=te?"none":ee.side,U=te?ij:ee.positionerStyles,se=R.useMemo(()=>{const ue={};return N||(ue.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...U,...ue}}},[N,q,U]),ne=R.useMemo(()=>({open:N,side:Q,align:ee.align,anchorHidden:ee.anchorHidden}),[N,Q,ee.align,ee.anchorHidden]),re=Pe(ue=>{y.set("positionerElement",ue)}),oe=at("div",t,{ref:[n,re],state:ne,stateAttributesMapping:xo,props:[se,_]}),le=R.useRef(0),_e=Pe(ue=>{if(ue.size===0&&le.current===0||L.current.length===0)return;const de=le.current;if(le.current=ue.size,ue.size===de)return;const Ie=Ue(Mn);if(de!==0&&!y.state.multiple&&V!==null&&Kl(L.current,V,W)===-1){const Oe=D.current,Me=Oe!=null&&la(L.current,Oe,W)?Oe:null;H(Me,Ie),Me===null&&(y.set("selectedIndex",null),M.current=null)}if(de!==0&&y.state.multiple&&Array.isArray(V)){const De=V.filter(Oe=>la(L.current,Oe,W));(De.length!==V.length||De.some(Oe=>!la(V,Oe,W)))&&(H(De,Ie),De.length===0&&(y.set("selectedIndex",null),M.current=null))}if(N&&te){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const De={height:""};Wh(G,De),Wh(z.current,De)}}),ge=R.useMemo(()=>({...ee,side:Q,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:P,scrollDownArrowRef:I}),[ee,Q,te,X]);return v.jsx(dd,{elementsRef:E,labelsRef:T,onMapChange:_e,children:v.jsxs(zR.Provider,{value:ge,children:[q&&K&&v.jsx(Ep,{inert:wp(!N),cutout:j}),oe]})})});function FR(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Zf="base-ui-disable-scrollbar",Wu={className:Zf,element:v.jsx("style",{href:Zf,precedence:"base-ui:low",children:`.${Zf}{scrollbar-width:none}.${Zf}::-webkit-scrollbar{display:none}`})},aj=R.createContext(void 0);function H0(e){return R.useContext(aj)}function F0(e){return e==="starting"?LM:tn}const lj={...xo,...Gs},cj=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{store:h,popupRef:a,onOpenChangeComplete:l,setOpen:d,valueRef:p,selectedItemTextRef:f,keyboardActiveRef:g,multiple:S,handleScrollArrowVisibility:C,scrollHandlerRef:w}=$s(),{side:b,align:x,alignItemWithTriggerActive:_,setControlledAlignItemWithTrigger:y,scrollDownArrowRef:E,scrollUpArrowRef:T}=z0(),A=H0()!=null,M=DR(),L=Qt(),D=Ae(h,ht.id),z=Ae(h,ht.open),H=Ae(h,ht.mounted),$=Ae(h,ht.popupProps),N=Ae(h,ht.transitionStatus),q=Ae(h,ht.triggerElement),K=Ae(h,ht.positionerElement),V=Ae(h,ht.listElement),Y=R.useRef(0),G=R.useRef(!1),j=R.useRef(0),W=R.useRef(!1),P=R.useRef({}),I=sd(),F=Pe(Q=>{if(!K||!a.current||!W.current)return;if(G.current||!_){C();return}const U=K.style.top==="0px",se=K.style.bottom==="0px",ne=K.getBoundingClientRect().height,re=xr(K),oe=getComputedStyle(K),le=parseFloat(oe.marginTop),_e=parseFloat(oe.marginBottom),ge=re.documentElement.clientHeight-le-_e,ue=Q.scrollTop,de=Q.scrollHeight,Ie=Q.clientHeight,De=de-Ie;let Oe=null,be=null,Me=!1;if(U){const pe=De-ue,ke=ne+pe,we=Math.min(ke,ge);Oe=we,we!==ge?be=De:Me=!0}else if(se){const pe=ue-0,ke=ne+pe,we=Math.min(ke,ge),We=ke-ge;Oe=we,we!==ge?be=0:(Me=!0,ue<De&&(be=ue-(pe-We)))}Oe!=null&&(K.style.height=`${Oe}px`),be!=null&&(Q.scrollTop=be),Me&&(G.current=!0),C()});R.useImperativeHandle(w,()=>F,[F]),Ur({open:z,ref:a,onComplete(){z&&l?.(!0)}});const X=R.useMemo(()=>({open:z,transitionStatus:N,side:b,align:x}),[z,N,b,x]);Fe(()=>{!K||!a.current||Object.keys(P.current).length||(P.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[a,K]),Fe(()=>{H||_||(W.current=!1,G.current=!1,Y.current=0,j.current=0,Wh(K,P.current))},[H,_,K,a]),Fe(()=>{const Q=a.current;if(!(!H||!q||!K||!Q)){if(!_){W.current=!0,I.request(C);return}queueMicrotask(()=>{const U=getComputedStyle(K),se=getComputedStyle(Q),ne=xr(q),re=Rn(K),oe=q.getBoundingClientRect(),le=K.getBoundingClientRect(),_e=oe.left,ge=oe.height,ue=V||Q,de=ue.scrollHeight,Ie=parseFloat(se.borderBottomWidth),De=parseFloat(U.marginTop)||10,Oe=parseFloat(U.marginBottom)||10,be=parseFloat(U.minHeight)||100,Me=5,pe=5,ke=20,we=ne.documentElement.clientHeight-De-Oe,We=ne.documentElement.clientWidth,et=we-oe.bottom+ge,xe=f.current,Ge=p.current;let tt=0,dt=0;if(xe&&Ge){const vt=Ge.getBoundingClientRect(),Je=xe.getBoundingClientRect(),Ot=vt.left-_e,It=Je.left-le.left,ot=vt.top-oe.top+vt.height/2,wt=Je.top-le.top+Je.height/2;tt=Ot-It,dt=wt-ot}const Se=et+dt+Oe+Ie;let He=Math.min(we,Se);const Re=we-De-Oe,nt=Se-He,lt=Math.max(Me,_e+tt),Xe=We-pe,st=Math.max(0,lt+le.width-Xe);K.style.left=`${lt-st}px`,K.style.height=`${He}px`,K.style.maxHeight="auto",K.style.marginTop=`${De}px`,K.style.marginBottom=`${Oe}px`,Q.style.height="100%";const Ct=ue.scrollHeight-ue.clientHeight,ct=nt>=Ct;ct&&(He=Math.min(we,le.height)-(nt-Ct));const nn=oe.top<ke||oe.bottom>we-ke||He<Math.min(de,be),kt=(re.visualViewport?.scale??1)!==1&&y0;if(nn||kt){W.current=!0,Wh(K,P.current),er.flushSync(()=>y(!1));return}if(ct){const vt=Math.max(0,we-Se);K.style.top=le.height>=Re?"0":`${vt}px`,K.style.height=`${He}px`,ue.scrollTop=ue.scrollHeight-ue.clientHeight,Y.current=Math.max(be,He)}else K.style.bottom="0",Y.current=Math.max(be,He),ue.scrollTop=nt;Y.current===we&&(G.current=!0),C(),setTimeout(()=>{W.current=!0})})}},[h,H,K,q,p,f,a,C,_,y,I,E,T,V]),R.useEffect(()=>{if(!_||!K||!H)return;const Q=Rn(K);function U(se){d(!1,Ue(eD,se))}return Q.addEventListener("resize",U),()=>{Q.removeEventListener("resize",U)}},[d,_,K,H]);const te={...V?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${D}-list`},onKeyDown(Q){g.current=!0,A&&P0.has(Q.key)&&Q.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Q){if(FR(Q)||Q.pointerType==="touch")return;const U=Q.currentTarget;L.start(0,()=>{h.set("activeIndex",null),U.focus({preventScroll:!0})})},onScroll(Q){V||w.current?.(Q.currentTarget)},..._&&{style:V?{height:"100%"}:HR}},ee=at("div",t,{ref:[n,a],state:X,stateAttributesMapping:lj,props:[$,te,F0(N),{className:!V&&_?Wu.className:void 0},u]});return v.jsxs(R.Fragment,{children:[Wu.element,v.jsx(yp,{context:M,modal:!1,disabled:!H,restoreFocus:!0,children:ee})]})}),uj=R.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=$s(),{alignItemWithTriggerActive:l}=z0(),d=Ae(h,ht.hasScrollArrows),p=Ae(h,ht.openMethod),f=Ae(h,ht.multiple),S={id:`${Ae(h,ht.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(w){a.current?.(w.currentTarget)},...l&&{style:HR},className:d&&p!=="touch"?Wu.className:void 0},C=Pe(w=>{h.set("listElement",w)});return at("div",t,{ref:[n,C],props:[S,u]})});let V0=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ac(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:o,index:u}=e,{register:h,unregister:a,subscribeMapChange:l,elementsRef:d,labelsRef:p,nextIndexRef:f}=X8(),g=R.useRef(-1),[S,C]=R.useState(u??(o===V0.GuessFromOrder?()=>{if(g.current===-1){const x=f.current;f.current+=1,g.current=x}return g.current}:-1)),w=R.useRef(null),b=R.useCallback(x=>{if(w.current=x,S!==-1&&x!==null&&(d.current[S]=x,p)){const _=t!==void 0;p.current[S]=_?t:s?.current?.textContent??x.textContent}},[S,d,p,t,s]);return Fe(()=>{if(u!=null)return;const x=w.current;if(x)return h(x,n),()=>{a(x)}},[u,h,a,n]),Fe(()=>{if(u==null)return l(x=>{const _=w.current?x.get(w.current)?.index:null;_!=null&&C(_)})},[u,l,C]),R.useMemo(()=>({ref:b,index:S}),[S,b])}const VR=R.createContext(void 0);function U0(){const e=R.useContext(VR);if(!e)throw new Error(Pt(57));return e}const dj=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u=null,label:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=R.useRef(null),f=ac({label:h,textRef:p,indexGuessBehavior:V0.GuessFromOrder}),{store:g,getItemProps:S,setOpen:C,setValue:w,selectionRef:b,typingRef:x,valuesRef:_,keyboardActiveRef:y,multiple:E,highlightItemOnHover:T}=$s(),A=Qt(),M=Ae(g,ht.isActive,f.index),L=Ae(g,ht.isSelected,f.index,u),D=Ae(g,ht.isSelectedByFocus,f.index),z=Ae(g,ht.isItemEqualToValue),H=f.index,$=H!==-1,N=R.useRef(null),q=hn(H);Fe(()=>{if(!$)return;const ee=_.current;return ee[H]=u,()=>{delete ee[H]}},[$,H,u,_]),Fe(()=>{if(!$)return;const ee=g.state.value;let Q=ee;E&&Array.isArray(ee)&&ee.length>0&&(Q=ee[ee.length-1]),Q!==void 0&&wi(Q,u,z)&&g.set("selectedIndex",H)},[$,H,E,z,g,u]);const K=R.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),V=S({active:M,selected:L});V.onFocus=void 0,V.id=void 0;const Y=R.useRef(null),G=R.useRef("mouse"),j=R.useRef(!1),{getButtonProps:W,buttonRef:P}=Sr({disabled:a,focusableWhenDisabled:!0,native:l});function I(ee){const Q=g.state.value;if(E){const U=Array.isArray(Q)?Q:[],se=L?jR(U,u,z):[...U,u];w(se,Ue(ma,ee))}else w(u,Ue(ma,ee)),C(!1,Ue(ma,ee))}const F={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",H)},onMouseEnter(){!y.current&&g.state.selectedIndex===null&&g.set("activeIndex",H)},onMouseMove(){T&&g.set("activeIndex",H)},onMouseLeave(ee){!T||y.current||FR(ee)||A.start(0,()=>{g.state.activeIndex===H&&g.set("activeIndex",null)})},onTouchStart(){b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){Y.current=ee.key,g.set("activeIndex",H)},onClick(ee){j.current=!1,!(ee.type==="keydown"&&Y.current===null)&&(a||Y.current===" "&&x.current||G.current!=="touch"&&!M||(Y.current=null,I(ee.nativeEvent)))},onPointerEnter(ee){G.current=ee.pointerType},onPointerDown(ee){G.current=ee.pointerType,j.current=!0},onMouseUp(ee){if(a)return;if(j.current){j.current=!1;return}const Q=!b.current.allowSelectedMouseUp&&L,U=!b.current.allowUnselectedMouseUp&&!L;Q||U||G.current!=="touch"&&!M||I(ee.nativeEvent)}},X=at("div",t,{ref:[P,n,f.ref,N],state:K,props:[V,F,d,W]}),te=R.useMemo(()=>({selected:L,indexRef:q,textRef:p,selectedByFocus:D,hasRegistered:$}),[L,q,p,D,$]);return v.jsx(VR.Provider,{value:te,children:X})})),fj=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=U0();return s||o?v.jsx(hj,{...t,ref:n}):null}),hj=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=U0(),a=R.useRef(null),{transitionStatus:l,setMounted:d}=ki(h),p=R.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=at("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Gs});return Ur({open:h,ref:a,onComplete(){h||d(!1)}}),f})),pj=R.memo(R.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=U0(),{selectedItemTextRef:a}=$s(),{className:l,render:d,...p}=t,f=R.useCallback(S=>{if(!S||!h)return;const C=a.current===null||!a.current.isConnected;(u||C&&s.current===0)&&(a.current=S)},[a,s,u,h]);return at("div",t,{ref:[f,n,o],props:p})})),UR=R.forwardRef(function(t,n){const{render:s,className:o,direction:u,keepMounted:h=!1,...a}=t,{store:l,popupRef:d,listRef:p,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:g}=$s(),{side:S,scrollDownArrowRef:C,scrollUpArrowRef:w}=z0(),b=u==="up"?ht.scrollUpArrowVisible:ht.scrollDownArrowVisible,x=Ae(l,b),_=Ae(l,ht.openMethod),y=x&&_!=="touch",E=Qt(),T=u==="up"?w:C,{transitionStatus:A,setMounted:M}=ki(y);Fe(()=>(g.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{g.current=Math.max(0,g.current-1),g.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,g]),Ur({open:y,ref:T,onComplete(){y||M(!1)}});const L=R.useMemo(()=>({direction:u,visible:y,side:S,transitionStatus:A}),[u,y,S,A]),z=at("div",t,{ref:[n,T],state:L,props:[{"aria-hidden":!0,children:u==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove($){if($.movementX===0&&$.movementY===0||E.isStarted())return;l.set("activeIndex",null);function N(){const q=l.state.listElement??d.current;if(!q)return;l.set("activeIndex",null),f();const K=q.scrollTop===0,V=Math.round(q.scrollTop+q.clientHeight)>=q.scrollHeight;if(p.current.length===0&&(u==="up"?l.set("scrollUpArrowVisible",!K):l.set("scrollDownArrowVisible",!V)),u==="up"&&K||u==="down"&&V){E.clear();return}if((l.state.listElement||d.current)&&p.current&&p.current.length>0){const G=p.current,j=T.current?.offsetHeight||0;if(u==="up"){let W=0;const P=q.scrollTop+j;for(let F=0;F<G.length;F+=1){const X=G[F];if(X&&X.offsetTop>=P){W=F;break}}const I=Math.max(0,W-1);if(I<W){const F=G[I];F&&(q.scrollTop=Math.max(0,F.offsetTop-j))}else q.scrollTop=0}else{let W=G.length-1;const P=q.scrollTop+q.clientHeight-j;for(let F=0;F<G.length;F+=1){const X=G[F];if(X&&X.offsetTop+X.offsetHeight>P){W=Math.max(0,F-1);break}}const I=Math.min(G.length-1,W+1);if(I>W){const F=G[I];F&&(q.scrollTop=F.offsetTop+F.offsetHeight-q.clientHeight+j)}else q.scrollTop=q.scrollHeight-q.clientHeight}}E.start(40,N)}E.start(40,N)},onMouseLeave(){E.clear()}},a]});return y||h?z:null}),mj=R.forwardRef(function(t,n){return v.jsx(UR,{...t,ref:n,direction:"down"})}),gj=R.forwardRef(function(t,n){return v.jsx(UR,{...t,ref:n,direction:"up"})}),jl=V8;function Il({className:e,...t}){return v.jsx(G8,{"data-slot":"select-value",className:Be("flex flex-1 text-left",e),...t})}function Nl({className:e,size:t="default",children:n,...s}){return v.jsxs(W8,{"data-slot":"select-trigger","data-size":t,className:Be("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[n,v.jsx($8,{render:v.jsx(ve,{icon:gE,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Bl({className:e,children:t,side:n="bottom",sideOffset:s=4,align:o="center",alignOffset:u=0,alignItemWithTrigger:h=!0,...a}){return v.jsx(Y8,{children:v.jsx(oj,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:v.jsxs(cj,{"data-slot":"select-content",className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...a,children:[v.jsx(vj,{}),v.jsx(uj,{children:t}),v.jsx(_j,{})]})})})}function vr({className:e,children:t,...n}){return v.jsxs(dj,{"data-slot":"select-item",className:Be("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[v.jsx(pj,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),v.jsx(fj,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:v.jsx(ve,{icon:Ma,strokeWidth:2,className:"pointer-events-none"})})]})}function vj({className:e,...t}){return v.jsx(gj,{"data-slot":"select-scroll-up-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:v.jsx(ve,{icon:u0,strokeWidth:2})})}function _j({className:e,...t}){return v.jsx(mj,{"data-slot":"select-scroll-down-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:v.jsx(ve,{icon:pp,strokeWidth:2})})}const WR=R.createContext(void 0);function W0(){const e=R.useContext(WR);if(e===void 0)throw new Error(Pt(64));return e}let yj=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const q0={tabActivationDirection:e=>({[yj.activationDirection]:e})},bj=R.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:l,...d}=t,p=Ia(),f=Object.hasOwn(t,"defaultValue"),g=R.useRef([]),[S,C]=R.useState(()=>new Map),[w,b]=as({controlled:l,default:o,name:"Tabs",state:"value"}),x=l!==void 0,[_,y]=R.useState(()=>new Map),[E,T]=R.useState("none"),A=Pe((Y,G)=>{u?.(Y,G),!G.isCanceled&&(b(Y),T(G.activationDirection))}),M=Pe((Y,G)=>{C(j=>{if(j.get(Y)===G)return j;const W=new Map(j);return W.set(Y,G),W})}),L=Pe((Y,G)=>{C(j=>{if(!j.has(Y)||j.get(Y)!==G)return j;const W=new Map(j);return W.delete(Y),W})}),D=R.useCallback(Y=>S.get(Y),[S]),z=R.useCallback(Y=>{for(const G of _.values())if(Y===G?.value)return G?.id},[_]),H=R.useCallback(Y=>{if(Y===void 0)return null;for(const[G,j]of _.entries())if(j!=null&&Y===(j.value??j.index))return G;return null},[_]),$=R.useMemo(()=>({direction:p,getTabElementBySelectedValue:H,getTabIdByPanelValue:z,getTabPanelIdByValue:D,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:y,unregisterMountedTabPanel:L,tabActivationDirection:E,value:w}),[p,H,z,D,A,h,M,y,L,E,w]),N=R.useMemo(()=>{for(const Y of _.values())if(Y!=null&&Y.value===w)return Y},[_,w]),q=R.useMemo(()=>{for(const Y of _.values())if(Y!=null&&!Y.disabled)return Y.value},[_]);Fe(()=>{if(x||_.size===0)return;const Y=N?.disabled,G=N==null&&w!==null;if(f&&Y&&w===o||!Y&&!G)return;const W=q??null;w!==W&&(b(W),T("none"))},[o,q,f,x,N,T,b,_,w]);const V=at("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:q0});return v.jsx(WR.Provider,{value:$,children:v.jsx(dd,{elementsRef:g,children:V})})}),qR="data-composite-item-active";function GR(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=o0(),{ref:o,index:u}=ac(e),h=n===u,a=R.useRef(null),l=cs(o,a);return{compositeProps:R.useMemo(()=>({tabIndex:h?0:-1,onFocus(){s(u)},onMouseMove(){const p=a.current;if(!t||!p)return;const f=p.hasAttribute("disabled")||p.ariaDisabled==="true";!h&&!f&&p.focus()}}),[h,s,u,t]),compositeRef:l,index:u}}const $R=R.createContext(void 0);function xj(){const e=R.useContext($R);if(e===void 0)throw new Error(Pt(65));return e}const Sj=R.forwardRef(function(t,n){const{className:s,disabled:o=!1,render:u,value:h,id:a,nativeButton:l=!0,...d}=t,{value:p,getTabPanelIdByValue:f,orientation:g}=W0(),{activateOnFocus:S,highlightedTabIndex:C,onTabActivation:w,setHighlightedTabIndex:b,tabsListElement:x}=xj(),_=ar(a),y=R.useMemo(()=>({disabled:o,id:_,value:h}),[o,_,h]),{compositeProps:E,compositeRef:T,index:A}=GR({metadata:y}),M=h===p,L=R.useRef(!1);Fe(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&C!==A))return;const j=x;if(j!=null){const W=_s(xr(j));if(W&&ft(j,W))return}o||b(A)},[M,A,C,b,o,x]);const{getButtonProps:D,buttonRef:z}=Sr({disabled:o,native:l,focusableWhenDisabled:!0}),H=f(h),$=R.useRef(!1),N=R.useRef(!1);function q(j){M||o||w(h,Ue(Mn,j.nativeEvent,void 0,{activationDirection:"none"}))}function K(j){M||(A>-1&&!o&&b(A),!o&&S&&(!$.current||$.current&&N.current)&&w(h,Ue(Mn,j.nativeEvent,void 0,{activationDirection:"none"})))}function V(j){if(M||o)return;$.current=!0;function W(){$.current=!1,N.current=!1}(!j.button||j.button===0)&&(N.current=!0,xr(j.currentTarget).addEventListener("pointerup",W,{once:!0}))}const Y=R.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return at("button",t,{state:Y,ref:[n,z,T],props:[E,{role:"tab","aria-controls":H,"aria-selected":M,id:_,onClick:q,onFocus:K,onPointerDown:V,[qR]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,D]})});let Cj=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const wj=R.forwardRef(function(t,n){const{className:s,value:o,render:u,keepMounted:h=!1,...a}=t,{value:l,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:g,unregisterMountedTabPanel:S}=W0(),C=ar(),w=R.useMemo(()=>({id:C,value:o}),[C,o]),{ref:b,index:x}=ac({metadata:w}),_=o!==l,y=d(o),E=R.useMemo(()=>({hidden:_,orientation:p,tabActivationDirection:f}),[_,p,f]),T=at("div",t,{state:E,ref:[n,b],props:[{"aria-labelledby":y,hidden:_,id:C??void 0,role:"tabpanel",tabIndex:_?-1:0,[Cj.index]:x},a],stateAttributesMapping:q0});return Fe(()=>{if(!(_&&!h)&&C!=null)return g(o,C),()=>{S(o,C)}},[_,h,o,C,g,S]),!_||h?T:null});function Ej(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const Rj=[];function kj(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:o=!1,orientation:u="both",direction:h,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:d,enableHomeAndEndKeys:p=!1,stopEventPropagation:f=!1,disabledIndices:g,modifierKeys:S=Rj}=e,[C,w]=R.useState(0),b=n>1,x=R.useRef(null),_=cs(x,d),y=R.useRef([]),E=R.useRef(!1),T=a??C,A=Pe((D,z=!1)=>{if((l??w)(D),z){const H=y.current[D];TC(x.current,H,h,u)}}),M=Pe(D=>{if(D.size===0||E.current)return;E.current=!0;const z=Array.from(D.keys()),H=z.find(N=>N?.hasAttribute(qR))??null,$=H?z.indexOf(H):-1;$!==-1&&A($),TC(x.current,H,h,u)}),L=R.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:_,onFocus(D){!x.current||!kC(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const z=p?MP:bR;if(!z.has(D.key)||Tj(D,S)||!x.current)return;const $=h==="rtl",N=$?Uu:Pl,q={horizontal:N,vertical:oa,both:N}[u],K=$?Pl:Uu,V={horizontal:K,vertical:Dl,both:K}[u];if(kC(D.target)&&!Ej(D.target)){const F=D.target.selectionStart,X=D.target.selectionEnd,te=D.target.value??"";if(F==null||D.shiftKey||F!==X||D.key!==V&&F<te.length||D.key!==q&&F>0)return}let Y=T;const G=ph(y,g),j=y_(y,g);if(b){const F=t||Array.from({length:y.current.length},()=>({width:1,height:1})),X=DE(F,n,o),te=X.findIndex(Q=>Q!=null&&!go(y,Q,g)),ee=X.reduce((Q,U,se)=>U!=null&&!go(y,U,g)?se:Q,-1);Y=X[ME({current:X.map(Q=>Q?y.current[Q]:null)},{event:D,orientation:u,loopFocus:s,cols:n,disabledIndices:jE([...g||y.current.map((Q,U)=>go(y,U)?U:void 0),void 0],X),minIndex:te,maxIndex:ee,prevIndex:PE(T>j?G:T,F,X,n,D.key===oa?"bl":D.key===Pl?"tr":"tl"),rtl:$})]}const W={horizontal:[N],vertical:[oa],both:[N,oa]}[u],P={horizontal:[K],vertical:[Dl],both:[K,Dl]}[u],I=b?z:{horizontal:p?AP:_R,vertical:p?OP:yR,both:z}[u];p&&(D.key===od?Y=G:D.key===ad&&(Y=j)),Y===T&&(W.includes(D.key)||P.includes(D.key))&&(s&&Y===j&&W.includes(D.key)?Y=G:s&&Y===G&&P.includes(D.key)?Y=j:Y=Wn(y,{startingIndex:Y,decrement:P.includes(D.key),disabledIndices:g})),Y!==T&&!Ll(y,Y)&&(f&&D.stopPropagation(),I.has(D.key)&&D.preventDefault(),A(Y,!0),queueMicrotask(()=>{y.current[Y]?.focus()}))}}),[n,o,h,g,y,p,T,b,t,s,_,S,A,u,f]);return R.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:y,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,y,g,M])}function Tj(e,t){for(const n of NP.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function KR(e){const{render:t,className:n,refs:s=br,props:o=br,state:u=tn,stateAttributesMapping:h,highlightedIndex:a,onHighlightedIndexChange:l,orientation:d,dense:p,itemSizes:f,loopFocus:g,cols:S,enableHomeAndEndKeys:C,onMapChange:w,stopEventPropagation:b=!0,rootRef:x,disabledIndices:_,modifierKeys:y,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=Ia(),{props:L,highlightedIndex:D,onHighlightedIndexChange:z,elementsRef:H,onMapChange:$,relayKeyboardEvent:N}=kj({itemSizes:f,cols:S,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:x,stopEventPropagation:b,enableHomeAndEndKeys:C,direction:M,disabledIndices:_,modifierKeys:y}),q=at(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),K=R.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:z,highlightItemOnHover:E,relayKeyboardEvent:N}),[D,z,E,N]);return v.jsx(W2.Provider,{value:K,children:v.jsx(dd,{elementsRef:H,onMapChange:V=>{w?.(V),$(V)},children:q})})}const Lj=R.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:o,loopFocus:u=!0,render:h,...a}=t,{getTabElementBySelectedValue:l,onValueChange:d,orientation:p,value:f,setTabMap:g,tabActivationDirection:S}=W0(),[C,w]=R.useState(0),[b,x]=R.useState(null),_=Aj(f,p,b,l),y=Pe((M,L)=>{if(M!==f){const D=_(M);L.activationDirection=D,d(M,L)}}),E=R.useMemo(()=>({orientation:p,tabActivationDirection:S}),[p,S]),T={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=R.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:C,onTabActivation:y,setHighlightedTabIndex:w,tabsListElement:b,value:f}),[s,C,y,w,b,f]);return v.jsx($R.Provider,{value:A,children:v.jsx(KR,{render:h,className:o,state:E,refs:[n,x],props:[T,a],stateAttributesMapping:q0,highlightedIndex:C,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:w,onMapChange:g,disabledIndices:br})})});function zC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:o,top:u}=t.getBoundingClientRect(),h=n-o,a=s-u;return{left:h,top:a}}function Aj(e,t,n,s){const[o,u]=R.useState(null);return Fe(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:l}=zC(h,n);u(t==="horizontal"?a:l)},[t,s,n,e]),R.useCallback(h=>{if(h===e)return"none";if(h==null)return u(null),"none";if(h!=null&&n!=null){const a=s(h);if(a!=null){const{left:l,top:d}=zC(a,n);if(o==null)return u(t==="horizontal"?l:d),"none";if(t==="horizontal"){if(l<o)return u(l),"left";if(l>o)return u(l),"right"}else{if(d<o)return u(d),"up";if(d>o)return u(d),"down"}}}return"none"},[s,t,o,n,e])}function _a({className:e,orientation:t="horizontal",...n}){return v.jsx(bj,{"data-slot":"tabs","data-orientation":t,className:Be("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const Oj=Oa("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function ya({className:e,variant:t="default",...n}){return v.jsx(Lj,{"data-slot":"tabs-list","data-variant":t,className:Be(Oj({variant:t}),e),...n})}function ir({className:e,...t}){return v.jsx(Sj,{"data-slot":"tabs-trigger",className:Be("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute 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-active:after:opacity-100",e),...t})}function _r({className:e,...t}){return v.jsx(wj,{"data-slot":"tabs-content",className:Be("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function Mj(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,actionsRef:h,handle:a,triggerId:l,defaultTriggerId:d=null}=e,p=Ei(),f=!!p,g=Gn(()=>a?.store??new wR({open:n??s,activeTriggerId:l!==void 0?l:d,modal:!0,disablePointerDismissal:!0,nested:f,role:"alertdialog"})).current;g.useControlledProp("open",n,s),g.useControlledProp("activeTriggerId",l,d),g.useSyncedValue("nested",f),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",u);const S=g.useState("payload");CR({store:g,actionsRef:h,parentContext:p?.store.context});const C=R.useMemo(()=>({store:g}),[g]);return v.jsx(m0.Provider,{value:C,children:typeof t=="function"?t({payload:S}):t})}const YR=R.createContext(void 0),XR=R.createContext(void 0),QR=R.createContext(void 0),ZR=R.createContext("");function Ti(){const e=R.useContext(YR);if(!e)throw new Error(Pt(22));return e}function Lp(){const e=R.useContext(XR);if(!e)throw new Error(Pt(23));return e}function Na(){const e=R.useContext(QR);if(!e)throw new Error(Pt(24));return e}function G0(){return R.useContext(ZR)}const qe={id:Ee(e=>e.id),query:Ee(e=>e.query),items:Ee(e=>e.items),selectedValue:Ee(e=>e.selectedValue),open:Ee(e=>e.open),mounted:Ee(e=>e.mounted),forceMounted:Ee(e=>e.forceMounted),inline:Ee(e=>e.inline),activeIndex:Ee(e=>e.activeIndex),selectedIndex:Ee(e=>e.selectedIndex),isActive:Ee((e,t)=>e.activeIndex===t),isSelected:Ee((e,t)=>{const n=e.isItemEqualToValue,s=e.selectedValue;return Array.isArray(s)?s.some(o=>wi(o,t,n)):wi(s,t,n)}),transitionStatus:Ee(e=>e.transitionStatus),popupProps:Ee(e=>e.popupProps),inputProps:Ee(e=>e.inputProps),triggerProps:Ee(e=>e.triggerProps),getItemProps:Ee(e=>e.getItemProps),positionerElement:Ee(e=>e.positionerElement),listElement:Ee(e=>e.listElement),triggerElement:Ee(e=>e.triggerElement),inputElement:Ee(e=>e.inputElement),popupSide:Ee(e=>e.popupSide),openMethod:Ee(e=>e.openMethod),inputInsidePopup:Ee(e=>e.inputInsidePopup),selectionMode:Ee(e=>e.selectionMode),listRef:Ee(e=>e.listRef),labelsRef:Ee(e=>e.labelsRef),popupRef:Ee(e=>e.popupRef),emptyRef:Ee(e=>e.emptyRef),inputRef:Ee(e=>e.inputRef),keyboardActiveRef:Ee(e=>e.keyboardActiveRef),chipsContainerRef:Ee(e=>e.chipsContainerRef),clearRef:Ee(e=>e.clearRef),valuesRef:Ee(e=>e.valuesRef),allValuesRef:Ee(e=>e.allValuesRef),name:Ee(e=>e.name),disabled:Ee(e=>e.disabled),readOnly:Ee(e=>e.readOnly),required:Ee(e=>e.required),grid:Ee(e=>e.grid),isGrouped:Ee(e=>e.isGrouped),virtualized:Ee(e=>e.virtualized),onOpenChangeComplete:Ee(e=>e.onOpenChangeComplete),openOnInputClick:Ee(e=>e.openOnInputClick),itemToStringLabel:Ee(e=>e.itemToStringLabel),isItemEqualToValue:Ee(e=>e.isItemEqualToValue),modal:Ee(e=>e.modal),autoHighlight:Ee(e=>e.autoHighlight),submitOnItemClick:Ee(e=>e.submitOnItemClick)};function Dj(e,t){return(n,s)=>{if(n==null)return!1;const o=An(n,t);return e.contains(o,s)}}function Pj(e,t,n){return(s,o)=>{if(s==null)return!1;if(!o)return!0;const u=An(s,t),h=n!=null?An(n,t):"";return h&&e.contains(h,o)&&h.length===o.length?!0:e.contains(u,o)}}const HC=new Map;function JR(e){return Array.isArray(e)?e.map(t=>JR(t)).join(","):e==null?"":String(e)}function jj(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${JR(e.locale)}|${JSON.stringify(t)}`,s=HC.get(n);if(s)return s;const o=new Intl.Collator(e.locale,t),u={contains(h,a,l){if(!a)return!0;const d=An(h,l);for(let p=0;p<=d.length-a.length;p+=1)if(o.compare(d.slice(p,p+a.length),a)===0)return!0;return!1},startsWith(h,a,l){if(!a)return!0;const d=An(h,l);return o.compare(d.slice(0,a.length),a)===0},endsWith(h,a,l){if(!a)return!0;const d=An(h,l),p=a.length;return d.length>=p&&o.compare(d.slice(d.length-p),a)===0}};return HC.set(n,u),u}const Ij=jj,ek=Symbol("none"),Ko={value:ek,index:-1};function Nj(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:s=null,selectedValue:o,onSelectedValueChange:u,defaultInputValue:h,inputValue:a,selectionMode:l="none",onItemHighlighted:d,name:p,disabled:f=!1,readOnly:g=!1,required:S=!1,inputRef:C,grid:w=!1,items:b,filteredItems:x,filter:_,openOnInputClick:y=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:D=PR,virtualized:z=!1,inline:H=!1,fillInputOnItemPress:$=!0,modal:N=!1,limit:q=-1,autoComplete:K="list",locale:V,submitOnItemClick:Y=!1}=e,{clearErrors:G}=ld(),{setDirty:j,validityData:W,shouldValidateOnChange:P,setFilled:I,name:F,disabled:X,validation:te}=us(),ee=Tp({id:t}),Q=Ij({locale:V}),[U,se]=R.useState(!1),[ne,re]=R.useState(null),oe=R.useRef([]),le=R.useRef([]),_e=R.useRef(null),ge=R.useRef(null),ue=R.useRef(null),de=R.useRef(!0),Ie=R.useRef(!1),De=R.useRef(null),Oe=R.useRef(null),be=R.useRef(null),Me=R.useRef(Ko),pe=R.useRef(null),ke=R.useRef([]),we=R.useRef([]),We=X||f,et=F??p,xe=l==="multiple",Ge=l==="single",tt=a!==void 0||h!==void 0,dt=b!==void 0,Se=x!==void 0;let He;E==="always"?He="always":He=E?"input-change":!1;const[Re,nt]=as({controlled:o,default:xe?s??br:s,name:"Combobox",state:"selectedValue"}),lt=R.useMemo(()=>_===null?()=>!0:_!==void 0?_:Ge&&!U?Pj(Q,M,Re):Dj(Q,M),[_,Ge,Re,U,Q,M]),Xe=Gn(()=>tt?h??"":Ge?An(Re,M):"").current,[st,Ct]=as({controlled:a,default:Xe,name:"Combobox",state:"inputValue"}),[ct,nn]=as({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),kt=IR(b),vt=ne??(st===""?"":String(st).trim()),Je=Ge?An(Re,M):"",Ot=Ge&&!U&&vt!==""&&Je!==""&&Je.length===vt.length&&Q.contains(Je,vt),It=Ot?"":vt,ot=dt&&Se&&Ot,wt=R.useMemo(()=>b?kt?b.flatMap(Ve=>Ve.items):b:br,[b,kt]),bt=R.useMemo(()=>{if(x&&!ot)return x;if(!b)return br;if(kt){const rt=b,mt=[];let $t=0;for(const rn of rt){if(q>-1&&$t>=q)break;const vn=It===""?rn.items:rn.items.filter(ti=>lt(ti,It,M));if(vn.length===0)continue;const Js=q>-1?q-$t:1/0,ei=vn.slice(0,Js);if(ei.length>0){const ti={...rn,items:ei};mt.push(ti),$t+=ei.length}}return mt}if(It==="")return q>-1?wt.slice(0,q):wt;const Ve=[];for(const rt of wt){if(q>-1&&Ve.length>=q)break;lt(rt,It,M)&&Ve.push(rt)}return Ve},[x,ot,b,kt,It,q,lt,M,wt]),xt=R.useMemo(()=>kt?bt.flatMap(rt=>rt.items):bt,[bt,kt]),Qe=Gn(()=>new va({id:ee,selectedValue:Re,open:ct,filter:lt,query:vt,items:b,selectionMode:l,listRef:oe,labelsRef:le,popupRef:_e,emptyRef:ue,inputRef:ge,keyboardActiveRef:de,chipsContainerRef:De,clearRef:Oe,valuesRef:ke,allValuesRef:we,selectionEventRef:be,name:et,disabled:We,readOnly:g,required:S,grid:w,isGrouped:kt,virtualized:z,openOnInputClick:y,itemToStringLabel:M,isItemEqualToValue:D,modal:N,autoHighlight:He,submitOnItemClick:Y,hasInputValue:tt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:H,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||on,setOpen:on,setInputValue:on,setSelectedValue:on,setIndices:on,onItemHighlighted:on,handleSelection:on,getItemProps:()=>tn,forceMount:on,requestSubmit:on})).current,Ht=l==="none"?st:Re,kn=R.useMemo(()=>l==="none"?Ht:Array.isArray(Re)?Re.map(Ve=>ys(Ve,L)):ys(Re,L),[Ht,L,l,Re]),Yn=Pe(d),zn=Pe(n),Es=Ae(Qe,qe.activeIndex),Va=Ae(Qe,qe.selectedIndex),wr=Ae(Qe,qe.positionerElement),pn=Ae(Qe,qe.listElement),mn=Ae(Qe,qe.triggerElement),Rs=Ae(Qe,qe.inputElement),Er=Ae(Qe,qe.inline),Xs=Ae(Qe,qe.inputInsidePopup),Up=hn(mn),{mounted:xc,setMounted:ko,transitionStatus:To}=ki(ct),{openMethod:Qs,triggerProps:ks,reset:Lo}=kp(ct);cd({id:ee,name:et,commit:te.commit,value:Ht,controlRef:Xs?Up:ge,getValue:()=>kn});const ds=Pe(()=>{b?le.current=xt.map(Ve=>An(Ve,M)):Qe.set("forceMounted",!0)}),gn=R.useRef(Re);Fe(()=>{Re!==gn.current&&ds()},[ds,Re]);const tr=Pe(Ve=>{Qe.update(Ve);const rt=Ve.type||"none";if(Ve.activeIndex!==void 0)if(Ve.activeIndex===null)Me.current!==Ko&&(Me.current=Ko,Yn(void 0,yu(rt,void 0,{index:-1})));else{const mt=ke.current[Ve.activeIndex];Me.current={value:mt,index:Ve.activeIndex},Yn(mt,yu(rt,void 0,{index:Ve.activeIndex}))}}),nr=Pe((Ve,rt)=>{if(Ie.current=rt.reason===ro,e.onInputValueChange?.(Ve,rt),!rt.isCanceled){if(rt.reason===ia){const mt=Ve.trim()!=="";mt&&se(!0),pe.current={hasQuery:mt},mt&&He&&Qe.state.activeIndex==null&&Qe.set("activeIndex",0)}Ct(Ve)}}),Rr=Pe((Ve,rt)=>{ct!==Ve&&(rt.reason==="escape-key"&&dt&&xt.length===0&&!Qe.state.emptyRef.current&&rt.allowPropagation(),e.onOpenChange?.(Ve,rt),!rt.isCanceled&&(!Ve&&U&&(Ge?(re(vt),vt===""&&se(!1)):xe&&(Er||Xs?tr({activeIndex:null}):re(vt),nr("",Ue(ro,rt.event)))),nn(Ve)))}),fs=Pe((Ve,rt)=>{if(u?.(Ve,rt),rt.isCanceled)return;nt(Ve),(l==="none"&&_e.current&&$||Ge&&!Qe.state.inputInsidePopup)&&nr(An(Ve,M),Ue(rt.reason,rt.event)),Ge&&Ve!=null&&rt.reason!==ia&&U&&re(vt)}),Wp=Pe((Ve,rt)=>{let mt=rt;if(mt===void 0){if(Es===null)return;mt=ke.current[Es]}const $t=Pn(Ve),rn=be.current??Ve;be.current=null;const vn=Ue(ma,rn),Js=$t?.closest("a")?.getAttribute("href");if(Js){Js.startsWith("#")&&Rr(!1,vn);return}if(xe){const ei=Array.isArray(Re)?Re:[],hs=la(ei,mt,Qe.state.isItemEqualToValue)?jR(ei,mt,Qe.state.isItemEqualToValue):[...ei,mt];if(fs(hs,vn),!(ge.current?ge.current.value.trim()!=="":!1))return;Qe.state.inputInsidePopup?nr("",Ue(ro,vn.event)):Rr(!1,vn)}else fs(mt,vn),Rr(!1,vn)}),Ua=Pe(()=>{if(!Qe.state.submitOnItemClick)return;const Ve=Qe.state.inputElement?.form;Ve&&typeof Ve.requestSubmit=="function"&&Ve.requestSubmit()}),Wa=Pe(()=>{if(ko(!1),zn?.(!1),se(!1),Lo(),re(null),tr(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),xe&&ge.current&&ge.current.value!==""&&!Ie.current&&nr("",Ue(ro)),Ge)if(Qe.state.inputInsidePopup)ge.current&&ge.current.value!==""&&nr("",Ue(ro));else{const Ve=An(Re,M);ge.current&&ge.current.value!==Ve&&nr(Ve,Ue(Ve===""?ro:Mn))}}),qp=R.useMemo(()=>Er&&wr?{current:wr.closest('[role="dialog"]')}:_e,[Er,wr]);Ur({enabled:!e.actionsRef,open:ct,ref:qp,onComplete(){ct||Wa()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:Wa}),[Wa]),Fe(function(){if(ct||l==="none")return;const rt=b?wt:we.current;if(xe){const mt=Array.isArray(Re)?Re:[],$t=mt[mt.length-1],rn=Kl(rt,$t,D);tr({selectedIndex:rn===-1?null:rn})}else{const mt=Kl(rt,Re,D);tr({selectedIndex:mt===-1?null:mt})}},[ct,Re,b,l,wt,xe,D,tr]),Fe(()=>{b&&(ke.current=xt,oe.current.length=xt.length)},[b,xt]),Fe(()=>{const Ve=pe.current;if(Ve&&(Ve.hasQuery?He&&Qe.set("activeIndex",0):He==="always"&&Qe.set("activeIndex",0),pe.current=null),!ct&&!Er)return;const mt=dt||Se?xt:ke.current,$t=Qe.state.activeIndex;if($t==null){if(He==="always"&&mt.length>0){Qe.set("activeIndex",0);return}Me.current!==Ko&&(Me.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1})));return}if($t>=mt.length){Me.current!==Ko&&(Me.current=Ko,Qe.state.onItemHighlighted(void 0,yu(Mn,void 0,{index:-1}))),Qe.set("activeIndex",null);return}const rn=mt[$t],vn=Me.current.value,Js=vn!==ek&&Qe.state.isItemEqualToValue(rn,vn);(Me.current.index!==$t||!Js)&&(Me.current={value:rn,index:$t},Qe.state.onItemHighlighted(rn,yu(Mn,void 0,{index:$t})))},[Es,He,Se,dt,xt,Er,ct,Qe]),Fe(()=>{if(!b||l==="none")return;const Ve=wt;if(xe){const $t=Array.isArray(Re)?Re:br,rn=$t.filter(vn=>la(Ve,vn,Qe.state.isItemEqualToValue));rn.length!==$t.length&&nt(rn);return}if(Re==null?!0:la(Ve,Re,Qe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&la(Ve,s,Qe.state.isItemEqualToValue)&&(mt=s),nt(mt),!Qe.state.inputInsidePopup){const $t=An(mt,M);ge.current&&ge.current.value!==$t&&nr($t,Ue(Mn))}},[b,wt,xe,l,Re,s,nt,M,Qe,nr]),Fe(()=>{if(l==="none"){I(String(st)!=="");return}I(xe?Array.isArray(Re)&&Re.length>0:Re!=null)},[I,l,st,Re,xe]),R.useEffect(()=>{dt&&He&&xt.length===0&&tr({activeIndex:null})},[dt,He,xt.length,tr]),ca(vt,()=>{!ct||vt===""||vt===String(Xe)||se(!0)}),ca(Re,()=>{if(l!=="none"&&(G(et),j(Re!==W.initialValue),P()?te.commit(Re):te.commit(Re,!0),xe&&Qe.state.selectedIndex!==null&&(!Array.isArray(Re)||Re.length===0)&&tr({activeIndex:null,selectedIndex:null}),Ge&&!tt&&!Xs)){const Ve=An(Re,M);st!==Ve&&nr(Ve,Ue(Mn))}}),ca(st,()=>{l==="none"&&(G(et),j(st!==W.initialValue),P()?te.commit(st):te.commit(st,!0))}),ca(b,()=>{if(!Ge||tt||Xs||U)return;const Ve=An(Re,M);st!==Ve&&nr(Ve,Ue(Mn))});const Zs=O0({open:Er?!0:ct,onOpenChange:Rr,elements:{reference:Xs?mn:Rs,floating:wr}});let Li,kr;Er||(Li=w?"grid":"listbox",kr=ct?"true":"false");const lr=R.useMemo(()=>{const Ve=Rs?.tagName==="INPUT",rt=Ve||ct,mt=Ve?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return rt&&(mt.role="combobox",mt["aria-expanded"]=kr,mt["aria-haspopup"]=Li,mt["aria-controls"]=ct?pn?.id:void 0,mt["aria-autocomplete"]=K),{reference:mt,floating:{role:"presentation"}}},[Rs,ct,kr,Li,pn?.id,K]),yd=id(Zs,{enabled:!g&&!We&&y,event:"mousedown-only",toggle:!1,touchOpenDelay:Xs?0:50}),Gp=xp(Zs,{enabled:!g&&!We&&!Er,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Er?!0:void 0,outsidePress(Ve){const rt=Pn(Ve);return!ft(mn,rt)&&!ft(Oe.current,rt)&&!ft(De.current,rt)}}),Sc=M0(Zs,{enabled:!g&&!We,id:ee,listRef:oe,activeIndex:Es,selectedIndex:Va,virtual:!0,loopFocus:!0,allowEscape:!He,focusItemOnOpen:U||l==="none"&&!He?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:w?2:1,orientation:w?"horizontal":void 0,disabledIndices:br,onNavigate(Ve,rt){!rt&&!ct||To==="ending"||tr(rt?{activeIndex:Ve,type:de.current?"keyboard":"pointer"}:{activeIndex:Ve})}}),{getReferenceProps:qa,getFloatingProps:Ai,getItemProps:Cc}=oc([lr,yd,Gp,Sc]);AR(()=>{Qe.update({inline:H,popupProps:Ai(),inputProps:qa(),triggerProps:ks,getItemProps:Cc,setOpen:Rr,setInputValue:nr,setSelectedValue:fs,setIndices:tr,onItemHighlighted:Yn,handleSelection:Wp,forceMount:ds,requestSubmit:Ua})}),Fe(()=>{Qe.update({id:ee,selectedValue:Re,open:ct,mounted:xc,transitionStatus:To,items:b,inline:H,popupProps:Ai(),inputProps:qa(),triggerProps:ks,openMethod:Qs,getItemProps:Cc,selectionMode:l,name:et,disabled:We,readOnly:g,required:S,grid:w,isGrouped:kt,virtualized:z,onOpenChangeComplete:zn,openOnInputClick:y,itemToStringLabel:M,modal:N,autoHighlight:He,isItemEqualToValue:D,submitOnItemClick:Y,hasInputValue:tt,requestSubmit:Ua})},[Qe,ee,Re,ct,xc,To,b,Ai,qa,Cc,Qs,ks,l,et,We,g,S,te,w,kt,z,zn,y,M,N,D,Y,tt,H,Ua,He]);const cr=cs(C,te.inputRef),wc=R.useMemo(()=>({query:vt,filteredItems:bt,flatFilteredItems:xt}),[vt,bt,xt]),bd=R.useMemo(()=>Array.isArray(Ht)?"":ys(Ht,L),[Ht,L]),Ec=xe&&Array.isArray(Re)&&Re.length>0,Oi=R.useMemo(()=>!xe||!Array.isArray(Re)||!et?null:Re.map(Ve=>{const rt=ys(Ve,L);return v.jsx("input",{type:"hidden",name:et,value:rt},rt)}),[xe,Re,et,L]),xd=v.jsxs(R.Fragment,{children:[e.children,v.jsx("input",{...te.getInputValidationProps({onFocus(){if(Xs){mn?.focus();return}(ge.current||mn)?.focus()},onChange(Ve){if(Ve.nativeEvent.defaultPrevented)return;const rt=Ve.target.value,mt=Ue(ia,Ve.nativeEvent);function $t(){if(xe)return;if(l==="none"){j(rt!==W.initialValue),nr(rt,mt),P()&&te.commit(rt);return}const rn=ke.current.find(vn=>ys(vn,L).toLowerCase()===rt.toLowerCase());rn!=null&&(j(rn!==W.initialValue),fs?.(rn,mt),P()&&te.commit(rn))}b?$t():(ds(),queueMicrotask($t))}}),id:ee,name:xe||l==="none"?void 0:et,disabled:We,required:S&&!Ec,readOnly:g,value:bd,ref:cr,style:ic,tabIndex:-1,"aria-hidden":!0}),Oi]});return v.jsx(YR.Provider,{value:Qe,children:v.jsx(XR.Provider,{value:Zs,children:v.jsx(QR.Provider,{value:wc,children:v.jsx(ZR.Provider,{value:st,children:xd})})})})}const Jf=2,Bj={...zu,...ja},zj=R.forwardRef(function(t,n){const{render:s,className:o,nativeButton:u=!0,disabled:h=!1,...a}=t,{state:l,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:S}=us(),{labelId:C}=wo(),w=Ti(),b=Ae(w,qe.selectionMode),x=Ae(w,qe.disabled),_=Ae(w,qe.readOnly),y=Ae(w,qe.listElement),E=Ae(w,qe.triggerProps),T=Ae(w,qe.triggerElement),A=Ae(w,qe.inputInsidePopup),M=Ae(w,qe.open),L=Ae(w,qe.selectedValue),D=Ae(w,qe.activeIndex),z=Ae(w,qe.selectedIndex),H=Lp(),$=G0(),N=Qt(),q=d||x||h,K=R.useRef("");function V(te){K.current=te.pointerType}const Y=H.select("domReferenceElement");R.useEffect(()=>{A&&T&&T!==Y&&H.set("domReferenceElement",T)},[T,Y,H,A]);const{reference:G}=D0(H,{enabled:!M&&!_&&!x&&b==="single",listRef:w.state.labelsRef,activeIndex:D,selectedIndex:z,onMatch(te){const ee=w.state.valuesRef.current[te];ee!==void 0&&w.state.setSelectedValue(ee,Ue("none"))}}),{reference:j}=id(H,{enabled:!_&&!x,event:"mousedown"}),{buttonRef:W,getButtonProps:P}=Sr({native:u,disabled:q}),I=R.useMemo(()=>({...l,open:M,disabled:q}),[l,M,q]),F=Pe(te=>{w.set("triggerElement",te)});return at("button",t,{ref:[n,W,F],state:I,props:[E,j,G,{tabIndex:A?0:-1,disabled:q,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?y?.id:void 0,"aria-readonly":_||void 0,"aria-labelledby":C,onPointerDown:V,onPointerEnter:V,onFocus(){f(!0),!(q||_)&&N.start(0,w.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const te=b==="none"?$:L;S.commit(te)}},onMouseDown(te){if(q||_||(A||H.set("domReferenceElement",te.currentTarget),w.state.forceMount(),K.current!=="touch"&&(w.state.inputRef.current?.focus(),A||te.preventDefault()),M))return;const ee=xr(te.currentTarget);function Q(U){if(!T)return;const se=Pn(U),ne=w.state.positionerElement,re=w.state.listElement;if(ft(T,se)||ft(ne,se)||ft(re,se)||se===T)return;const oe=N0(T),le=U.clientX>=oe.left-Jf&&U.clientX<=oe.right+Jf,_e=U.clientY>=oe.top-Jf&&U.clientY<=oe.bottom+Jf;le&&_e||w.state.setOpen(!1,Ue("cancel-open",U))}A&&ee.addEventListener("mouseup",Q,{once:!0})},onKeyDown(te){q||_||(te.key==="ArrowDown"||te.key==="ArrowUp")&&(fn(te),w.state.setOpen(!0,Ue(Du,te.nativeEvent)),w.state.inputRef.current?.focus())}},S?S.getValidationProps(a):a,P],stateAttributesMapping:Bj})}),Hj=R.createContext(void 0);function Fj(){return R.useContext(Hj)}const tk=R.createContext(void 0);function $0(e){const t=R.useContext(tk);if(t===void 0&&!e)throw new Error(Pt(21));return t}const Vj={...zu,...ja,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},Uj=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,id:h,...a}=t,{state:l,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:S}=us(),{labelId:C}=wo(),w=Fj(),x=!!$0(!0),_=Ti(),{filteredItems:y}=Na(),E=G0(),T=ar(h),A=Ia(),M=Ae(_,qe.disabled),L=Ae(_,qe.readOnly),D=Ae(_,qe.name),z=Ae(_,qe.selectionMode),H=Ae(_,qe.autoHighlight),$=Ae(_,qe.inputProps),N=Ae(_,qe.triggerProps),q=Ae(_,qe.open),K=Ae(_,qe.mounted),V=Ae(_,qe.selectedValue),Y=Ae(_,qe.popupSide),G=Ae(_,qe.positionerElement),j=!!H,W=K&&G?Y:null,P=d||M||u,I=y.length===0,[F,X]=R.useState(null),te=R.useRef(!1),ee=Pe(ne=>{const re=x||_.state.inline;re&&!_.state.hasInputValue&&_.state.setInputValue("",Ue(Mn)),_.update({inputElement:ne,inputInsidePopup:re})}),Q=R.useMemo(()=>({...l,open:q,disabled:P,readOnly:L,popupSide:W,listEmpty:I}),[l,q,P,L,W,I]);function U(ne){if(!w)return;let re;const{highlightedChipIndex:oe}=w;if(oe!==void 0){if(ne.key==="ArrowLeft")ne.preventDefault(),oe>0?re=oe-1:re=void 0;else if(ne.key==="ArrowRight")ne.preventDefault(),oe<V.length-1?re=oe+1:re=void 0;else if(ne.key==="Backspace"||ne.key==="Delete"){ne.preventDefault();const le=oe>=V.length-1?V.length-2:oe;re=le>=0?le:void 0,_.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return re}return ne.key==="ArrowLeft"&&(ne.currentTarget.selectionStart??0)===0&&V.length>0?(ne.preventDefault(),re=Math.max(V.length-1,0)):ne.key==="Backspace"&&ne.currentTarget.value===""&&V.length>0&&(_.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),ne.preventDefault()),re}return at("input",t,{state:Q,ref:[n,_.state.inputRef,ee],props:[$,N,{type:"text",value:t.value??F??E,"aria-readonly":L||void 0,"aria-labelledby":C,disabled:P,readOnly:L,...z==="none"&&D&&{name:D},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const ne=z==="none"?E:V;S.commit(ne)}},onCompositionStart(ne){jh||(te.current=!0,X(ne.currentTarget.value))},onCompositionEnd(ne){te.current=!1;const re=ne.currentTarget.value;X(null),_.state.setInputValue(re,Ue(ia,ne.nativeEvent))},onChange(ne){if(te.current){const _e=ne.currentTarget.value;X(_e),_e===""&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.state.setOpen(!1,Ue(ro,ne.nativeEvent));const ge=_e.trim(),ue=j&&ge!=="";!L&&!P&&ge!==""&&(_.state.setOpen(!0,Ue(ia,ne.nativeEvent)),j||_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&_.state.activeIndex!==null&&!ue&&_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?"keyboard":"pointer"});return}_.state.setInputValue(ne.currentTarget.value,Ue(ia,ne.nativeEvent));const re=ne.currentTarget.value==="",oe=Ue(ro,ne.nativeEvent);re&&!_.state.inputInsidePopup&&(z==="single"&&_.state.setSelectedValue(null,oe),_.state.openOnInputClick||_.state.setOpen(!1,oe));const le=ne.currentTarget.value.trim();!L&&!P&&le!==""&&(_.state.setOpen(!0,Ue(ia,ne.nativeEvent)),j||_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&_.state.activeIndex!==null&&!j&&_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(ne){if(P||L||ne.ctrlKey||ne.shiftKey||ne.altKey||ne.metaKey)return;_.state.keyboardActiveRef.current=!0;const re=ne.currentTarget,oe=re.scrollWidth-re.clientWidth,le=A==="rtl";if(ne.key==="Home"){fn(ne);const ge=iC&&le?re.value.length:0;re.setSelectionRange(ge,ge),re.scrollLeft=0;return}if(ne.key==="End"){fn(ne);const ge=iC&&le?0:re.value.length;re.setSelectionRange(ge,ge),re.scrollLeft=le?-oe:oe;return}if(!K&&ne.key==="Escape"){const ge=z==="multiple"&&Array.isArray(V)?V.length===0:V===null,ue=Ue(gp,ne.nativeEvent),de=z==="multiple"?[]:null;_.state.setInputValue("",ue),_.state.setSelectedValue(de,ue),!ge&&!_.state.inline&&!ue.isPropagationAllowed&&ne.stopPropagation();return}if(w&&ne.key==="Backspace"&&re.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(V)&&V.length>0){const ge=V.slice(0,-1);_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?"keyboard":"pointer"}),_.state.setSelectedValue(ge,Ue(Mn,ne.nativeEvent));return}const _e=U(ne);if(w?.setHighlightedChipIndex(_e),_e!==void 0?w?.chipsRef.current[_e]?.focus():_.state.inputRef.current?.focus(),ne.which!==229&&ne.key==="Enter"&&q){const ge=_.state.activeIndex,ue=ne.nativeEvent;if(ge===null){_.state.setOpen(!1,Ue(Mn,ue));return}fn(ne);const de=_.state.listRef.current[ge];de&&(_.state.selectionEventRef.current=ue,de.click(),_.state.selectionEventRef.current=null)}},onPointerMove(){_.state.keyboardActiveRef.current=!1},onPointerDown(){_.state.keyboardActiveRef.current=!1}},S?S.getValidationProps(a):a],stateAttributesMapping:Vj})}),Wj={...Gs,...g0},qj=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,keepMounted:a=!1,...l}=t,{disabled:d}=us(),p=Ti(),f=Ae(p,qe.selectionMode),g=Ae(p,qe.disabled),S=Ae(p,qe.readOnly),C=Ae(p,qe.open),w=Ae(p,qe.selectedValue),b=G0();let x=!1;f==="none"?x=b!=="":f==="single"?x=w!=null:x=Array.isArray(w)&&w.length>0;const _=d||g||u,{buttonRef:y,getButtonProps:E}=Sr({native:h,disabled:_}),{mounted:T,transitionStatus:A,setMounted:M}=ki(x),L=R.useMemo(()=>({disabled:_,open:C,transitionStatus:A}),[_,C,A]);Ur({open:x,ref:p.state.clearRef,onComplete(){x||M(!1)}});const D=at("button",t,{state:L,ref:[n,y,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:_,"aria-readonly":S||void 0,onMouseDown(H){H.preventDefault()},onClick(H){if(_||S)return;const $=p.state.keyboardActiveRef;p.state.setInputValue("",Ue(nC,H.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,Ue(nC,H.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:$.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:$.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},l,E],stateAttributesMapping:Wj});return a||T?D:null}),Gj=R.createContext(null);function $j(){return R.useContext(Gj)}function Kj(e){const{children:t}=e,{filteredItems:n}=Na(),s=$j(),o=s?s.items:n;return o?v.jsx(R.Fragment,{children:o.map(t)}):null}const Yj=R.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,l=Ti(),d=Lp(),p=!!$0(!0),{filteredItems:f}=Na(),g=Ae(l,qe.items),S=Ae(l,qe.labelsRef),C=Ae(l,qe.listRef),w=Ae(l,qe.selectionMode),b=Ae(l,qe.grid),x=Ae(l,qe.popupProps),_=Ae(l,qe.disabled),y=Ae(l,qe.readOnly),E=Ae(l,qe.virtualized),T=w==="multiple",A=f.length===0,M=Pe(N=>{l.set("positionerElement",N)}),L=Pe(N=>{l.set("listElement",N)}),D=R.useMemo(()=>typeof h=="function"?s||(s=v.jsx(Kj,{children:h})):h,[h]),z=R.useMemo(()=>({empty:A}),[A]),H=d.useState("floatingId"),$=at("div",t,{state:z,ref:[n,L,p?null:M],props:[x,{children:D,tabIndex:-1,id:H,role:b?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(N){if(!(_||y)&&N.key==="Enter"){const q=l.state.activeIndex;if(q==null)return;fn(N);const K=N.nativeEvent,V=l.state.listRef.current[q];V&&(l.state.selectionEventRef.current=K,V.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return E?$:v.jsx(dd,{elementsRef:C,labelsRef:g?void 0:S,children:$})}),nk=R.createContext(void 0);function Xj(){const e=R.useContext(nk);if(e===void 0)throw new Error(Pt(20));return e}const Qj=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ti(),h=Ae(u,qe.mounted),a=Ae(u,qe.forceMounted);return h||s||a?v.jsx(nk.Provider,{value:s,children:v.jsx(_p,{ref:n,...o})}):null}),Zj=R.forwardRef(function(t,n){const{render:s,className:o,anchor:u,positionMethod:h="absolute",side:a="bottom",align:l="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:b=l0,...x}=t,_=Ti(),{filteredItems:y}=Na(),E=Lp(),T=Xj(),A=Ae(_,qe.modal),M=Ae(_,qe.open),L=Ae(_,qe.mounted),D=Ae(_,qe.openMethod),z=Ae(_,qe.triggerElement),H=Ae(_,qe.inputElement),$=Ae(_,qe.inputInsidePopup),N=y.length===0,K=B0({anchor:u??($?z:H),floatingRootContext:E,positionMethod:h,mounted:L,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:S,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w,keepMounted:T,collisionAvoidance:b,lazyFlip:!0});Rp(M&&A&&D!=="touch",z);const V=R.useMemo(()=>{const P={...K.positionerStyles};return M||(P.pointerEvents="none"),{role:"presentation",hidden:!L,style:P}},[M,L,K.positionerStyles]),Y=R.useMemo(()=>({open:M,side:K.side,align:K.align,anchorHidden:K.anchorHidden,empty:N}),[M,K.side,K.align,K.anchorHidden,N]);Fe(()=>{_.set("popupSide",K.side)},[_,K.side]);const G=R.useMemo(()=>({side:K.side,align:K.align,arrowRef:K.arrowRef,arrowUncentered:K.arrowUncentered,arrowStyles:K.arrowStyles,anchorHidden:K.anchorHidden,isPositioned:K.isPositioned}),[K.side,K.align,K.arrowRef,K.arrowUncentered,K.arrowStyles,K.anchorHidden,K.isPositioned]),j=Pe(P=>{_.set("positionerElement",P)}),W=at("div",t,{state:Y,ref:[n,j],props:[V,x],stateAttributesMapping:xo});return v.jsxs(tk.Provider,{value:G,children:[L&&A&&v.jsx(Ep,{inert:wp(!M),cutout:H??z}),W]})}),Jj={...xo,...Gs},e9=R.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,l=Ti(),d=$0(),p=Lp(),{filteredItems:f}=Na(),g=Ae(l,qe.mounted),S=Ae(l,qe.open),C=Ae(l,qe.openMethod),w=Ae(l,qe.transitionStatus),b=Ae(l,qe.inputInsidePopup),x=Ae(l,qe.inputElement),_=f.length===0;Ur({open:S,ref:l.state.popupRef,onComplete(){S&&l.state.onOpenChangeComplete(!0)}});const y=R.useMemo(()=>({open:S,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:w,empty:_}),[S,d.side,d.align,d.anchorHidden,w,_]),E=at("div",t,{state:y,ref:[n,l.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(L){const D=Pn(L.nativeEvent);C!=="touch"&&(ft(l.state.listElement,D)||D===L.currentTarget)&&l.state.inputRef.current?.focus()}},F0(w),a],stateAttributesMapping:Jj}),A=u===void 0?b?L=>L==="touch"?l.state.popupRef.current:x:!1:u;let M;return h!=null?M=h:M=b?void 0:!1,v.jsx(yp,{context:p,disabled:!g,modal:!b,openInteractionType:C,initialFocus:A,returnFocus:M,children:E})}),rk=R.createContext(void 0);function sk(){const e=R.useContext(rk);if(!e)throw new Error(Pt(19));return e}const t9=R.createContext(!1);function n9(){return R.useContext(t9)}const r9=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u=null,index:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=R.useRef(!1),f=R.useRef(null),g=ac({index:h,textRef:f,indexGuessBehavior:V0.GuessFromOrder}),S=Ti(),C=n9(),{flatFilteredItems:w}=Na(),b=Ae(S,qe.open),x=Ae(S,qe.selectionMode),_=Ae(S,qe.readOnly),y=Ae(S,qe.virtualized),E=Ae(S,qe.isItemEqualToValue),T=x!=="none",A=h??(y?Kl(w,u,E):g.index),M=g.index!==-1,L=Ae(S,qe.id),D=Ae(S,qe.isActive,A),z=Ae(S,qe.isSelected,u),H=Ae(S,qe.items),$=Ae(S,qe.getItemProps),N=R.useRef(null),q=L!=null&&M?`${L}-${A}`:void 0,K=z&&T;Fe(()=>{if(!(M&&(y||h!=null)))return;const te=S.state.listRef.current;return te[A]=N.current,()=>{delete te[A]}},[M,y,A,h,S]),Fe(()=>{if(!M||H)return;const X=S.state.valuesRef.current;return X[A]=u,x!=="none"&&S.state.allValuesRef.current.push(u),()=>{delete X[A]}},[M,H,A,u,S,x]),Fe(()=>{if(!b){p.current=!1;return}if(!M||H)return;const X=S.state.selectedValue,te=Array.isArray(X)?X[X.length-1]:X;wi(te,u,E)&&S.set("selectedIndex",A)},[M,H,b,S,A,u,E]);const V=R.useMemo(()=>({disabled:a,selected:K,highlighted:D}),[a,K,D]),Y=$({active:D,selected:K});Y.id=void 0,Y.onFocus=void 0;const{getButtonProps:G,buttonRef:j}=Sr({disabled:a,focusableWhenDisabled:!0,native:l});function W(X){function te(){S.state.handleSelection(X,u)}S.state.submitOnItemClick?(er.flushSync(te),S.state.requestSubmit()):te()}const P={id:q,role:C?"gridcell":"option","aria-disabled":a||void 0,"aria-selected":T?K:void 0,tabIndex:void 0,onPointerDownCapture(X){p.current=!0,X.preventDefault()},onClick(X){a||_||W(X.nativeEvent)},onMouseUp(X){const te=p.current;p.current=!1,!(a||_||X.button!==0||te||!D)&&W(X.nativeEvent)}},I=at("div",t,{ref:[j,n,g.ref,N],state:V,props:[Y,P,d,G]}),F=R.useMemo(()=>({selected:K,textRef:f}),[K,f]);return v.jsx(rk.Provider,{value:F,children:I})})),s9=R.forwardRef(function(t,n){const{render:s,className:o,children:u,...h}=t,{filteredItems:a}=Na(),l=Ti(),d=a.length===0?u:null;return at("div",t,{ref:[n,l.state.emptyRef],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},h]})});let FC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function ik(e){return R.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[FC.checked]:""}:{[FC.unchecked]:""}},...ja}),[e.indeterminate])}const ok=R.createContext(void 0);function i9(){const e=R.useContext(ok);if(e===void 0)throw new Error(Pt(14));return e}const o9="data-parent",a9=R.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u=!1,disabled:h=!1,id:a,indeterminate:l=!1,inputRef:d,name:p,onCheckedChange:f,parent:g=!1,readOnly:S=!1,render:C,required:w=!1,uncheckedValue:b,value:x,nativeButton:_=!1,...y}=t,{clearErrors:E}=ld(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:D,setTouched:z,state:H,validationMode:$,validityData:N,shouldValidateOnChange:q,validation:K}=us(),V=s8(),{labelId:Y,controlId:G,setControlId:j,getDescriptionProps:W}=wo(),P=o8(),I=P?.parent,F=I&&P.allValues,X=T||V.disabled||P?.disabled||h,te=A??p,ee=x??te,Q=ar(),U=ar();let se=G;F?se=g?U:`${I.id}-${ee}`:a&&(se=a);let ne={};F&&(g?ne=P.parent.getParentProps():ee&&(ne=P.parent.getChildProps(ee)));const re=Pe(f),{checked:oe=s,indeterminate:le=l,onCheckedChange:_e,...ge}=ne,ue=P?.value,de=P?.setValue,Ie=P?.defaultValue,De=R.useRef(null),{getButtonProps:Oe,buttonRef:be}=Sr({disabled:X,native:_}),Me=P?.validation??K,[pe,ke]=as({controlled:ee&&ue&&!g?ue.includes(ee):oe,default:ee&&Ie&&!g?Ie.includes(ee):u,name:"Checkbox",state:"checked"});Fe(()=>{if(j!==on)return j(se),()=>{j(void 0)}},[se,P,j,g]),cd({enabled:!P,id:Q,commit:Me.commit,value:pe,controlRef:De,name:te,getValue:()=>pe});const we=R.useRef(null),We=cs(d,we,Me.inputRef);Fe(()=>{we.current&&(we.current.indeterminate=le,pe&&L(!0))},[pe,le,L]),ca(pe,()=>{P&&!g||(E(te),L(pe),M(pe!==N.initialValue),q()?Me.commit(pe):Me.commit(pe,!0))});const et=Ws({checked:pe,disabled:X,name:g?void 0:te,id:se??void 0,required:w,ref:We,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(He){if(He.nativeEvent.defaultPrevented)return;const Re=He.target.checked,nt=Ue(Mn,He.nativeEvent);if(_e?.(Re,nt),re(Re,nt),!nt.isCanceled&&(ke(Re),ee&&ue&&de&&!g)){const lt=Re?[...ue,ee]:ue.filter(Xe=>Xe!==ee);de(lt,nt)}},onFocus(){De.current?.focus()}},x!==void 0?{value:(P?pe&&x:x)||""}:tn,W,P?Me.getValidationProps:Me.getInputValidationProps),xe=F?!!oe:pe,Ge=F&&le||l;R.useEffect(()=>{I&&ee&&I.disabledStatesRef.current.set(ee,X)},[I,X,ee]);const tt=R.useMemo(()=>({...H,checked:xe,disabled:X,readOnly:S,required:w,indeterminate:Ge}),[H,xe,X,S,w,Ge]),dt=ik(tt),Se=at("span",t,{state:tt,ref:[be,De,n,P?.registerControlRef],props:[{id:Q,role:"checkbox","aria-checked":le?"mixed":pe,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":Y,[o9]:g?"":void 0,onFocus(){D(!0)},onBlur(){const He=we.current;He&&(z(!0),D(!1),$==="onBlur"&&Me.commit(P?ue:He.checked))},onClick(He){S||X||(He.preventDefault(),we.current?.click())}},W,Me.getValidationProps,y,ge,Oe],stateAttributesMapping:dt});return v.jsxs(ok.Provider,{value:tt,children:[Se,!pe&&!P&&te&&!g&&b!==void 0&&v.jsx("input",{type:"hidden",name:te,value:b}),v.jsx("input",{...et})]})}),l9=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=i9(),l=a.checked||a.indeterminate,{transitionStatus:d,setMounted:p}=ki(l),f=R.useRef(null),g=R.useMemo(()=>({...a,transitionStatus:d}),[a,d]);Ur({open:l,ref:f,onComplete(){l||p(!1)}});const S=ik(a),C=R.useMemo(()=>({...S,...Gs,...ja}),[S]),w=u||l,b=at("span",t,{enabled:w,ref:[n,f],state:g,stateAttributesMapping:C,props:h});return w?b:null});function c9(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return v.jsx(Nj,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const u9=R.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=sk();return s||o?v.jsx(d9,{...t,ref:n}):null}),d9=R.memo(R.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=sk(),a=R.useRef(null),{transitionStatus:l,setMounted:d}=ki(h),p=R.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=at("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Gs});return Ur({open:h,ref:a,onComplete(){h||d(!1)}}),f})),f9=R.createContext(void 0);function Ap(e=!0){const t=R.useContext(f9);if(t===void 0&&!e)throw new Error(Pt(25));return t}const ak=R.createContext(void 0);function K0(e){const t=R.useContext(ak);if(t===void 0&&!e)throw new Error(Pt(33));return t}const lk=R.createContext(void 0);function Eo(e){const t=R.useContext(lk);if(t===void 0&&!e)throw new Error(Pt(36));return t}const ck={type:"regular-item"};function uk(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:o,store:u,nativeButton:h,itemMetadata:a,nodeId:l}=e,d=R.useRef(null),p=Ap(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:S,buttonRef:C}=Sr({disabled:n,focusableWhenDisabled:!0,native:h}),w=R.useCallback(x=>Ws({id:o,role:"menuitem",tabIndex:s?0:-1,onMouseMove(_){l&&g.emit("itemhover",{nodeId:l,target:_.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(_){_.key===" "&&u.context.typingRef.current&&_.preventBaseUIHandler()},onClick(_){t&&g.emit("close",{domEvent:_,reason:ma})},onMouseUp(_){if(p){const y=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&y&&Math.abs(_.clientX-y.x)<=1&&Math.abs(_.clientY-y.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||_.button===2)&&a.type==="regular-item"&&d.current.click()}},x,S),[o,s,S,t,g,u,f,p,a,l]),b=cs(d,C);return R.useMemo(()=>({getItemProps:w,itemRef:b}),[w,b])}let VC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const dk={checked(e){return e?{[VC.checked]:""}:{[VC.unchecked]:""}},...Gs},h9=R.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:l=!1,closeOnClick:d=!0,...p}=t,f=ac({label:h}),g=K0(!0),S=ar(u),{store:C}=Eo(),w=C.useState("isActive",f.index),b=C.useState("itemProps"),{getItemProps:x,itemRef:_}=uk({closeOnClick:d,disabled:l,highlighted:w,id:S,store:C,nativeButton:a,nodeId:g?.nodeId,itemMetadata:ck}),y=R.useMemo(()=>({disabled:l,highlighted:w}),[l,w]);return at("div",t,{state:y,props:[b,p,x],ref:[_,n,f.ref]})}),p9={...xo,...Gs},m9=R.forwardRef(function(t,n){const{render:s,className:o,finalFocus:u,...h}=t,{store:a}=Eo(),{side:l,align:d}=K0(),p=H0()!=null,f=a.useState("open"),g=a.useState("transitionStatus"),S=a.useState("popupProps"),C=a.useState("mounted"),w=a.useState("instantType"),b=a.useState("activeTriggerElement"),x=a.useState("parent"),_=a.useState("lastOpenChangeReason"),y=a.useState("rootId"),E=a.useState("floatingRootContext"),T=a.useState("floatingTreeRoot"),A=a.useState("closeDelay"),M=a.useState("activeTriggerElement");Ur({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),R.useEffect(()=>{function N(q){a.setOpen(!1,Ue(q.reason,q.domEvent))}return T.events.on("close",N),()=>{T.events.off("close",N)}},[T.events,a]);const L=a.useState("hoverEnabled"),D=a.useState("disabled");vP(E,{enabled:L&&!D&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:A});const z=R.useMemo(()=>({transitionStatus:g,side:l,align:d,open:f,nested:x.type==="menu",instant:w}),[g,l,d,f,x.type,w]),H=at("div",t,{state:z,ref:[n,a.context.popupRef],stateAttributesMapping:p9,props:[S,{onKeyDown(N){p&&P0.has(N.key)&&N.stopPropagation()}},F0(g),h,{"data-rootownerid":y}]});let $=x.type===void 0||x.type==="context-menu";return(b||x.type==="menubar"&&_!==v0)&&($=!0),v.jsx(yp,{context:E,modal:!1,disabled:!C,returnFocus:u===void 0?$:u,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:H})}),fk=R.createContext(void 0);function g9(){const e=R.useContext(fk);if(e===void 0)throw new Error(Pt(32));return e}const v9=R.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Eo();return u.useState("mounted")||s?v.jsx(fk.Provider,{value:s,children:v.jsx(_p,{ref:n,...o})}):null}),_9=R.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a,align:l,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:S=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:b=l0,...x}=t,{store:_}=Eo(),y=g9(),E=Ap(!0),T=_.useState("parent"),A=_.useState("floatingRootContext"),M=_.useState("floatingTreeRoot"),L=_.useState("mounted"),D=_.useState("open"),z=_.useState("modal"),H=_.useState("activeTriggerElement"),$=_.useState("lastOpenChangeReason"),N=_.useState("floatingNodeId"),q=_.useState("floatingParentNodeId");let K=s,V=d,Y=p,G=l,j=b;T.type==="context-menu"&&(K=s??T.context?.anchor,G=G??"start",!a&&G!=="center"&&(Y=t.alignOffset??2,V=t.sideOffset??-5));let W=a,P=G;T.type==="menu"?(W=W??"inline-end",P=P??"start",j=t.collisionAvoidance??AM):T.type==="menubar"&&(W=W??"bottom",P=P??"start");const I=T.type==="context-menu",F=B0({anchor:K,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:W,sideOffset:V,align:P,alignOffset:Y,arrowPadding:I?0:S,collisionBoundary:f,collisionPadding:g,sticky:C,nodeId:N,keepMounted:y,disableAnchorTracking:w,collisionAvoidance:j,shiftCrossAxis:I,externalTree:M}),X=R.useMemo(()=>{const ne={};return D||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...F.positionerStyles,...ne}}},[D,L,F.positionerStyles]);R.useEffect(()=>{function ne(re){re.open?(re.parentNodeId===N&&_.set("hoverEnabled",!1),re.nodeId!==N&&re.parentNodeId===_.select("floatingParentNodeId")&&_.setOpen(!1,Ue(ku))):re.parentNodeId===N&&re.reason!==ku&&_.set("hoverEnabled",!0)}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[_,M.events,N]),R.useEffect(()=>{if(_.select("floatingParentNodeId")==null)return;function ne(re){if(re.open||re.nodeId!==_.select("floatingParentNodeId"))return;const oe=re.reason??ku;_.setOpen(!1,Ue(oe))}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[M.events,_]),R.useEffect(()=>{function ne(re){!D||re.nodeId!==_.select("floatingParentNodeId")||re.target&&H&&H!==re.target&&_.setOpen(!1,Ue(ku))}return M.events.on("itemhover",ne),()=>{M.events.off("itemhover",ne)}},[M.events,D,H,_]),R.useEffect(()=>{const ne={open:D,nodeId:N,parentNodeId:q,reason:_.select("lastOpenChangeReason")};M.events.emit("menuopenchange",ne)},[M.events,D,_,N,q]);const te=R.useMemo(()=>({open:D,side:F.side,align:F.align,anchorHidden:F.anchorHidden,nested:T.type==="menu"}),[D,F.side,F.align,F.anchorHidden,T.type]),ee=R.useMemo(()=>({side:F.side,align:F.align,arrowRef:F.arrowRef,arrowUncentered:F.arrowUncentered,arrowStyles:F.arrowStyles,nodeId:F.context.nodeId}),[F.side,F.align,F.arrowRef,F.arrowUncentered,F.arrowStyles,F.context.nodeId]),Q=at("div",t,{state:te,stateAttributesMapping:xo,ref:[n,_.useStateSetter("positionerElement")],props:[X,x]}),U=L&&T.type!=="menu"&&(T.type!=="menubar"&&z&&$!==Br||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=H),v.jsxs(ak.Provider,{value:ee,children:[U&&v.jsx(Ep,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:wp(!D),cutout:se}),v.jsx(VD,{id:N,children:v.jsx(dd,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:Q})})]})}),hk=R.createContext(void 0);function y9(){const e=R.useContext(hk);if(e===void 0)throw new Error(Pt(34));return e}const b9=R.memo(R.forwardRef(function(t,n){const{render:s,className:o,value:u,defaultValue:h,onValueChange:a,disabled:l=!1,...d}=t,[p,f]=as({controlled:u,default:h,name:"MenuRadioGroup"}),g=Pe(a),S=Pe((x,_)=>{g?.(x,_),!_.isCanceled&&f(x)}),C=R.useMemo(()=>({disabled:l}),[l]),w=at("div",t,{state:C,ref:n,props:{role:"group","aria-disabled":l||void 0,...d}}),b=R.useMemo(()=>({value:p,setValue:S,disabled:l}),[p,S,l]);return v.jsx(hk.Provider,{value:b,children:w})})),pk=R.createContext(void 0);function x9(){const e=R.useContext(pk);if(e===void 0)throw new Error(Pt(35));return e}const S9=R.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:l=!1,closeOnClick:d=!1,value:p,...f}=t,g=ac({label:h}),S=K0(!0),C=ar(u),{store:w}=Eo(),b=w.useState("isActive",g.index),x=w.useState("itemProps"),{value:_,setValue:y,disabled:E}=y9(),T=E||l,A=_===p,{getItemProps:M,itemRef:L}=uk({closeOnClick:d,disabled:T,highlighted:b,id:C,store:w,nativeButton:a,nodeId:S?.nodeId,itemMetadata:ck}),D=R.useMemo(()=>({disabled:T,highlighted:b,checked:A}),[T,b,A]),z=Pe($=>{const N={...Ue(ma,$.nativeEvent),preventUnmountOnClose:()=>{}};y(p,N)}),H=at("div",t,{state:D,stateAttributesMapping:dk,props:[x,{role:"menuitemradio","aria-checked":A,onClick:z},f,M],ref:[L,n,g.ref]});return v.jsx(pk.Provider,{value:D,children:H})}),C9=R.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=x9(),l=R.useRef(null),{transitionStatus:d,setMounted:p}=ki(a.checked);Ur({open:a.checked,ref:l,onComplete(){a.checked||p(!1)}});const f=R.useMemo(()=>({checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:d}),[a.checked,a.disabled,a.highlighted,d]);return at("span",t,{state:f,stateAttributesMapping:dk,ref:[n,l],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),w9=R.createContext(null);function mk(e){return R.useContext(w9)}const E9={...hR,disabled:Ee(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ee(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ee(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:Ee(e=>e.stickIfOpen),parent:Ee(e=>e.parent),rootId:Ee(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ee(e=>e.activeIndex),isActive:Ee((e,t)=>e.activeIndex===t),hoverEnabled:Ee(e=>e.hoverEnabled),instantType:Ee(e=>e.instantType),lastOpenChangeReason:Ee(e=>e.openChangeReason),floatingTreeRoot:Ee(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ee(e=>e.floatingNodeId),floatingParentNodeId:Ee(e=>e.floatingParentNodeId),itemProps:Ee(e=>e.itemProps),closeDelay:Ee(e=>e.closeDelay),keyboardEventRelay:Ee(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class Y0 extends L0{constructor(t){super({...R9(),...t},{positionerRef:R.createRef(),popupRef:R.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:R.createRef(),beforeContentFocusGuardRef:R.createRef(),onOpenChangeComplete:void 0,triggerElements:new Sp},E9),this.observe(Ee(n=>n.allowMouseEnter),(n,s)=>{this.state.parent.type==="menu"&&n!==s&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Gn(()=>t??new Y0(n)).current}unsubscribeParentListener=null}function R9(){return{...fR(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new R0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tn,keyboardEventRelay:void 0,closeDelay:0}}const k9=R.createContext(void 0);function T9(){return R.useContext(k9)}function L9(e){const{children:t,open:n,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:u=!1,disabled:h=!1,modal:a,loopFocus:l=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:f=!1,handle:g,triggerId:S,defaultTriggerId:C=null,highlightItemOnHover:w=!0}=e,b=Ap(!0),x=Eo(!0),_=mk(),y=T9(),E=R.useMemo(()=>y&&x?{type:"menu",store:x.store}:_?{type:"menubar",context:_}:b&&!x?{type:"context-menu",context:b}:{type:void 0},[b,x,_,y]),T=Y0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=YE(A),L=Ri();Fe(()=>{b&&!x?T.update({parent:{type:"context-menu",context:b},floatingNodeId:M,floatingParentNodeId:L}):x&&T.update({floatingNodeId:M,floatingParentNodeId:L})},[b,x,M,L,T]),T.useControlledProp("open",n,u),T.useControlledProp("activeTriggerId",S,C),T.useContextCallback("onOpenChangeComplete",o);const D=T.useState("open"),z=T.useState("activeTriggerElement"),H=T.useState("positionerElement"),$=T.useState("hoverEnabled"),N=T.useState("modal"),q=T.useState("disabled"),K=T.useState("lastOpenChangeReason"),V=T.useState("parent"),Y=T.useState("activeIndex"),G=T.useState("payload"),j=T.useState("floatingParentNodeId"),W=R.useRef(null),P=j!=null;let I;T.useSyncedValues({disabled:h,modal:V.type===void 0?a:void 0,rootId:Da()});const{openMethod:F,triggerProps:X,reset:te}=kp(D);uR(T);const{forceUnmount:ee}=dR(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0}),te()}),Q=R.useRef(V.type!=="context-menu"),U=Qt();R.useEffect(()=>{if(D||(W.current=null),V.type==="context-menu"){if(!D){U.clear(),Q.current=!1;return}U.start(500,()=>{Q.current=!0})}},[U,D,V.type]),Rp(D&&N&&K!==Br&&F!=="touch",H),Fe(()=>{!D&&!$&&T.set("hoverEnabled",!0)},[D,$,T]);const se=R.useRef(!0),ne=Qt(),re=Pe((Re,nt)=>{const lt=nt.reason;if(D===Re&&nt.trigger===z||(nt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!Re&&nt.trigger==null&&(nt.trigger=z??void 0),s?.(Re,nt),nt.isCanceled))return;const Xe={open:Re,nativeEvent:nt.event,reason:nt.reason,nested:P};I?.emit("openchange",Xe);const st=nt.event;if(Re===!1&&st?.type==="click"&&st.pointerType==="touch"&&!se.current)return;if(!Re&&Y!==null){const kt=T.context.itemDomElements.current[Y];queueMicrotask(()=>{kt?.setAttribute("tabindex","-1")})}Re&&lt===Ph?(se.current=!1,ne.start(300,()=>{se.current=!0})):(se.current=!0,ne.clear());const Ct=(lt===pa||lt===ma)&&st.detail===0&&st?.isTrusted,ct=!Re&&(lt===gp||lt==null);function nn(){const kt={open:Re,openChangeReason:lt};W.current=nt.event??null;const vt=nt.trigger?.id??null;(vt||Re)&&(kt.activeTriggerId=vt,kt.activeTriggerElement=nt.trigger??null),T.update(kt)}lt===Br?er.flushSync(nn):nn(),V.type==="menubar"&&(lt===Ph||lt===Ra||lt===Br||lt===Du||lt===ku)?T.set("instantType","group"):Ct||ct?T.set("instantType",Ct?"click":"dismiss"):T.set("instantType",void 0)}),oe=R.useCallback(Re=>{const nt=Ue(Re);return nt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},nt},[T]),le=R.useCallback(()=>{T.setOpen(!1,oe(yE))},[T,oe]);R.useImperativeHandle(p,()=>({unmount:ee,close:le}),[ee,le]);let _e;V.type==="context-menu"&&(_e=V.context),R.useImperativeHandle(_e?.positionerRef,()=>H,[H]),R.useImperativeHandle(_e?.actionsRef,()=>({setOpen:re}),[re]);const ge=pR({popupStore:T,onOpenChange:re});I=ge.context.events,R.useEffect(()=>{const Re=({open:nt,eventDetails:lt})=>re(nt,lt);return I.on("setOpen",Re),()=>{I?.off("setOpen",Re)}},[I,re]);const ue=xp(ge,{enabled:!q,bubbles:f&&V.type==="menu",outsidePress(){return V.type!=="context-menu"||W.current?.type==="contextmenu"?!0:Q.current},externalTree:P?A:void 0}),de=gR(ge,{role:"menu"}),Ie=Ia(),De=R.useCallback(Re=>{T.select("activeIndex")!==Re&&T.set("activeIndex",Re)},[T]),Oe=M0(ge,{enabled:!q,listRef:T.context.itemDomElements,activeIndex:Y,nested:V.type!==void 0,loopFocus:l,orientation:d,parentOrientation:V.type==="menubar"?V.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:br,onNavigate:De,openOnArrowKeyDown:V.type!=="context-menu",externalTree:P?A:void 0,focusItemOnHover:w}),be=R.useCallback(Re=>{T.context.typingRef.current=Re},[T]),Me=D0(ge,{listRef:T.context.itemLabels,activeIndex:Y,resetMs:kM,onMatch:Re=>{D&&Re!==Y&&T.set("activeIndex",Re)},onTypingChange:be}),{getReferenceProps:pe,getFloatingProps:ke,getItemProps:we,getTriggerProps:We}=oc([ue,de,Oe,Me]),et=R.useMemo(()=>{const Re=Ws(pe(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},X);return delete Re.role,Re},[pe,T,X]),xe=R.useMemo(()=>{const Re=We();if(!Re)return Re;const nt=Ws(Re,X);return delete nt.role,delete nt["aria-controls"],nt},[We,X]),Ge=sd(),tt=R.useMemo(()=>ke({onMouseEnter(){V.type==="menu"&&Ge.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(Re){const nt=T.select("keyboardEventRelay");nt&&!Re.isPropagationStopped()&&nt(Re)}}),[ke,V.type,Ge,T]),dt=R.useMemo(()=>we(),[we]);T.useSyncedValues({floatingRootContext:ge,activeTriggerProps:et,inactiveTriggerProps:xe,popupProps:tt,itemProps:dt});const Se=R.useMemo(()=>({store:T,parent:E}),[T,E]),He=v.jsx(lk.Provider,{value:Se,children:typeof t=="function"?t({payload:G}):t});return V.type===void 0||V.type==="context-menu"?v.jsx(UD,{externalTree:A,children:He}):He}function gk(e){const{render:t,className:n,state:s=tn,props:o=br,refs:u=br,metadata:h,stateAttributesMapping:a,tag:l="div",...d}=e,{compositeProps:p,compositeRef:f}=GR({metadata:h});return at(l,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function vk(e){if(en(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Hs(e))return vk(Us(e))}function A9(e){const{enabled:t=!0,mouseDownAction:n,open:s}=e,o=R.useRef(!1);return R.useMemo(()=>t?{onMouseDown:u=>{(n==="open"&&!s||n==="close"&&s)&&(o.current=!0,xr(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:tn,[t,n,s])}const eh=2,O9=R.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,openOnHover:l,delay:d=100,closeDelay:p=0,handle:f,payload:g,...S}=t,C=Eo(!0),w=f?.store??C?.store;if(!w)throw new Error(Pt(85));const b=ar(a),x=w.useState("isTriggerActive",b),_=w.useState("floatingRootContext"),y=w.useState("isOpenedByTrigger",b),E=R.useRef(null),T=D9(),A=o0(!0),M=Co(),L=R.useMemo(()=>M??new R0,[M]),D=YE(L),z=Ri(),{registerTrigger:H,isMountedByThisTrigger:$}=cR(b,E,w,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:D,floatingParentNodeId:z,keyboardEventRelay:A?.relayKeyboardEvent}),N=w.useState("disabled"),q=u||N||T.type==="menubar"&&T.context.disabled,{getButtonProps:K,buttonRef:V}=Sr({disabled:q,native:h});R.useEffect(()=>{!y&&T.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,y,T.type]);const Y=R.useRef(null),G=Qt(),j=Pe(de=>{if(!Y.current)return;G.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ie=de.target;if(ft(Y.current,Ie)||ft(w.select("positionerElement"),Ie)||Ie===Y.current||Ie!=null&&vk(Ie)===w.select("rootId"))return;const De=N0(Y.current);de.clientX>=De.left-eh&&de.clientX<=De.right+eh&&de.clientY>=De.top-eh&&de.clientY<=De.bottom+eh||L.events.emit("close",{domEvent:de,reason:_E})});R.useEffect(()=>{y&&w.select("lastOpenChangeReason")===Br&&xr(Y.current).addEventListener("mouseup",j,{once:!0})},[y,j,w]);const W=T.type==="menubar"&&T.context.hasSubmenuOpen,I=bP(_,{enabled:(l??W??!1)&&!q&&T.type!=="context-menu"&&(T.type!=="menubar"||W&&!$),handleClose:RP({blockPointerEvents:T.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:L,isActiveTrigger:x}),F=M9(y,w.select("lastOpenChangeReason")),X=id(_,{enabled:!q&&T.type!=="context-menu",event:y&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?F:!1}),te=hP(_,{enabled:!q&&(T.type!=="menubar"&&y||W)}),ee=A9({open:y,enabled:T.type==="menubar",mouseDownAction:"open"}),Q=oc([X,te]),U=T.type==="menubar",se=R.useMemo(()=>({disabled:q,open:y}),[q,y]),ne=w.useState("triggerProps",$),re=[Y,n,V,H,E],oe=[Q.getReferenceProps(),I??tn,ne,{"aria-haspopup":"menu",id:b,onMouseDown:de=>{if(w.select("open"))return;G.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),xr(de.currentTarget).addEventListener("mouseup",j,{once:!0})}},U?{role:"menuitem"}:{},ee,S,K],le=R.useRef(null),_e=Pe(de=>{er.flushSync(()=>{w.setOpen(!1,Ue(Ra,de.nativeEvent,de.currentTarget))}),HD(le.current)?.focus()}),ge=Pe(de=>{const Ie=w.select("positionerElement");if(Ie&&Al(de,Ie))w.context.beforeContentFocusGuardRef.current?.focus();else{er.flushSync(()=>{w.setOpen(!1,Ue(Ra,de.nativeEvent,de.currentTarget))});let De=zD(E.current);for(;De!==null&&ft(Ie,De)||De?.hasAttribute("aria-hidden");){const Oe=De;if(De=E0(De),De===Oe)break}De?.focus()}}),ue=at("button",t,{enabled:!U,stateAttributesMapping:zu,state:se,ref:re,props:oe});return U?v.jsx(gk,{tag:"button",render:s,className:o,state:se,refs:re,props:oe,stateAttributesMapping:zu}):y?v.jsxs(R.Fragment,{children:[v.jsx($l,{ref:le,onFocus:_e},`${b}-pre-focus-guard`),v.jsx(R.Fragment,{children:ue},b),v.jsx($l,{ref:w.context.triggerFocusTargetRef,onFocus:ge},`${b}-post-focus-guard`)]}):v.jsx(R.Fragment,{children:ue},b)});function M9(e,t){const n=Qt(),[s,o]=R.useState(!1);return Fe(()=>{e&&t==="trigger-hover"?(o(!0),n.start(TM,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function D9(){const e=Ap(!0),t=Eo(!0),n=mk();return R.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function yi(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const _k=R.createContext(void 0);function Op(){const e=R.useContext(_k);if(e===void 0)throw new Error(Pt(53));return e}let qh=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const th=500,UC=16;function ss(e,t,n){if(!e)return 0;const s=getComputedStyle(e),o=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(s[`${t}InlineStart`])*2:parseFloat(s[`${t}${o}Start`])+parseFloat(s[`${t}${o}End`])}let P9=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),wl=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const X0={hasOverflowX:e=>e?{[wl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[wl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[wl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[wl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[wl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[wl.overflowYEnd]:""}:null,cornerHidden:()=>null},WC={width:0,height:0},j9={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},I9=R.forwardRef(function(t,n){const{render:s,className:o,overflowEdgeThreshold:u,...h}=t,[a,l]=R.useState(!1),[d,p]=R.useState(!1),[f,g]=R.useState(!1),[S,C]=R.useState(WC),[w,b]=R.useState(WC),[x,_]=R.useState(!1),[y,E]=R.useState(j9),T=ar(),A=R.useRef(null),M=R.useRef(null),L=R.useRef(null),D=R.useRef(null),z=R.useRef(null),H=R.useRef(null),$=R.useRef(null),N=R.useRef(!1),q=R.useRef(0),K=R.useRef(0),V=R.useRef(0),Y=R.useRef(0),G=R.useRef("vertical"),j=Qt(),W=Qt(),P=R.useRef({x:0,y:0}),[I,F]=R.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),X=N9(u),te=Pe(_e=>{const ge=_e.x-P.current.x,ue=_e.y-P.current.y;P.current=_e,ue!==0&&(g(!0),j.start(th,()=>{g(!1)})),ge!==0&&(p(!0),W.start(th,()=>{p(!1)}))}),ee=Pe(_e=>{_e.button===0&&(N.current=!0,q.current=_e.clientY,K.current=_e.clientX,G.current=_e.currentTarget.getAttribute(P9.orientation),M.current&&(V.current=M.current.scrollTop,Y.current=M.current.scrollLeft),z.current&&G.current==="vertical"&&z.current.setPointerCapture(_e.pointerId),H.current&&G.current==="horizontal"&&H.current.setPointerCapture(_e.pointerId))}),Q=Pe(_e=>{if(!N.current)return;const ge=_e.clientY-q.current,ue=_e.clientX-K.current;if(M.current){const de=M.current.scrollHeight,Ie=M.current.clientHeight,De=M.current.scrollWidth,Oe=M.current.clientWidth;if(z.current&&L.current&&G.current==="vertical"){const be=ss(L.current,"padding","y"),Me=ss(z.current,"margin","y"),pe=z.current.offsetHeight,ke=L.current.offsetHeight-pe-be-Me,we=ge/ke;M.current.scrollTop=V.current+we*(de-Ie),_e.preventDefault(),g(!0),j.start(th,()=>{g(!1)})}if(H.current&&D.current&&G.current==="horizontal"){const be=ss(D.current,"padding","x"),Me=ss(H.current,"margin","x"),pe=H.current.offsetWidth,ke=D.current.offsetWidth-pe-be-Me,we=ue/ke;M.current.scrollLeft=Y.current+we*(De-Oe),_e.preventDefault(),p(!0),W.start(th,()=>{p(!1)})}}}),U=Pe(_e=>{N.current=!1,z.current&&G.current==="vertical"&&z.current.releasePointerCapture(_e.pointerId),H.current&&G.current==="horizontal"&&H.current.releasePointerCapture(_e.pointerId)});function se(_e){const ge=_e.pointerType==="touch";if(_(ge),!ge){const ue=ft(A.current,_e.target);l(ue)}}const ne=R.useMemo(()=>({hasOverflowX:!I.scrollbarXHidden,hasOverflowY:!I.scrollbarYHidden,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:I.cornerHidden}),[I.scrollbarXHidden,I.scrollbarYHidden,I.cornerHidden,y]),re={role:"presentation",onPointerEnter:se,onPointerMove:se,onPointerDown({pointerType:_e}){_(_e==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[qh.scrollAreaCornerHeight]:`${S.height}px`,[qh.scrollAreaCornerWidth]:`${S.width}px`}},oe=at("div",t,{state:ne,ref:[n,A],props:[re,h],stateAttributesMapping:X0}),le=R.useMemo(()=>({handlePointerDown:ee,handlePointerMove:Q,handlePointerUp:U,handleScroll:te,cornerSize:S,setCornerSize:C,thumbSize:w,setThumbSize:b,touchModality:x,cornerRef:$,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:l,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:D,thumbYRef:z,thumbXRef:H,rootId:T,hiddenState:I,setHiddenState:F,overflowEdges:y,setOverflowEdges:E,viewportState:ne,overflowEdgeThreshold:X}),[ee,Q,U,te,S,w,x,$,d,p,f,g,a,l,M,A,L,D,z,H,T,I,y,ne,X]);return v.jsxs(_k.Provider,{value:le,children:[Wu.element,oe]})});function N9(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const B9=R.createContext(void 0);function z9(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(s=>{s.forEach(o=>{o.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let lo=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),qC=!1;function H9(){qC||y0||(typeof CSS<"u"&&"registerProperty"in CSS&&[lo.scrollAreaOverflowXStart,lo.scrollAreaOverflowXEnd,lo.scrollAreaOverflowYStart,lo.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),qC=!0)}const F9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{viewportRef:h,scrollbarYRef:a,scrollbarXRef:l,thumbYRef:d,thumbXRef:p,cornerRef:f,setCornerSize:g,setThumbSize:S,rootId:C,setHiddenState:w,hiddenState:b,handleScroll:x,setHovering:_,setOverflowEdges:y,overflowEdges:E,overflowEdgeThreshold:T}=Op(),A=Ia(),M=R.useRef(!0),L=Qt(),D=Qt();function z(){const Y=h.current,G=a.current,j=l.current,W=d.current,P=p.current,I=f.current;if(!Y)return;const F=Y.scrollHeight,X=Y.scrollWidth,te=Y.clientHeight,ee=Y.clientWidth,Q=Y.scrollTop,U=Y.scrollLeft;if(F===0||X===0)return;const se=te>=F,ne=ee>=X,re=ee/X,oe=te/F,le=Math.max(0,X-ee),_e=Math.max(0,F-te);let ge=0,ue=0;ne||(A==="rtl"?ge=yi(-U,0,le):ge=yi(U,0,le),ue=le-ge);const de=se?0:yi(Q,0,_e),Ie=se?0:_e-de,De=ne?0:ee,Oe=se?0:te,be=ss(j,"padding","x"),Me=ss(G,"padding","y"),pe=ss(P,"margin","x"),ke=ss(W,"margin","y"),we=De-be-pe,We=Oe-Me-ke,et=j?Math.min(j.offsetWidth,we):we,xe=G?Math.min(G.offsetHeight,We):We,Ge=Math.max(UC,et*re),tt=Math.max(UC,xe*oe);if(S(Xe=>Xe.height===tt&&Xe.width===Ge?Xe:{width:Ge,height:tt}),G&&W){const Xe=G.offsetHeight-tt-Me-ke,st=F-te,Ct=st===0?0:Q/st,ct=Math.min(Xe,Math.max(0,Ct*Xe));W.style.transform=`translate3d(0,${ct}px,0)`}if(j&&P){const Xe=j.offsetWidth-Ge-be-pe,st=X-ee,Ct=st===0?0:U/st,ct=A==="rtl"?yi(Ct*Xe,-Xe,0):yi(Ct*Xe,0,Xe);P.style.transform=`translate3d(${ct}px,0,0)`}const dt=yi(ge,0,le),Se=yi(ue,0,le),He=yi(de,0,_e),Re=yi(Ie,0,_e),nt=[[lo.scrollAreaOverflowXStart,dt],[lo.scrollAreaOverflowXEnd,Se],[lo.scrollAreaOverflowYStart,He],[lo.scrollAreaOverflowYEnd,Re]];for(const[Xe,st]of nt)Y.style.setProperty(Xe,`${st}px`);if(I){if(ne||se)g({width:0,height:0});else if(!ne&&!se){const Xe=G?.offsetWidth||0,st=j?.offsetHeight||0;g({width:Xe,height:st})}}w(Xe=>{const st=se||ne;return Xe.scrollbarYHidden===se&&Xe.scrollbarXHidden===ne&&Xe.cornerHidden===st?Xe:{scrollbarYHidden:se,scrollbarXHidden:ne,cornerHidden:st}});const lt={xStart:!ne&&dt>T.xStart,xEnd:!ne&&Se>T.xEnd,yStart:!se&&He>T.yStart,yEnd:!se&&Re>T.yEnd};y(Xe=>Xe.xStart===lt.xStart&&Xe.xEnd===lt.xEnd&&Xe.yStart===lt.yStart&&Xe.yEnd===lt.yEnd?Xe:lt)}const H=Pe(()=>{er.flushSync(z)});Fe(()=>h.current?(H9(),z9(h.current,H)):void 0,[H,h]),Fe(()=>{queueMicrotask(H)},[H,b,A]),Fe(()=>{h.current?.matches(":hover")&&_(!0)},[h,_]),R.useEffect(()=>{const Y=h.current;if(typeof ResizeObserver>"u"||!Y)return;const G=new ResizeObserver(H);return G.observe(Y),D.start(0,()=>{Promise.all(Y.getAnimations({subtree:!0}).map(j=>j.finished)).then(H).catch(()=>{})}),()=>{G.disconnect(),D.clear()}},[H,h,D]);function $(){M.current=!1}const N={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!b.scrollbarXHidden||!b.scrollbarYHidden)&&{tabIndex:0},className:Wu.className,style:{overflow:"scroll"},onScroll(){h.current&&(H(),M.current||x({x:h.current.scrollLeft,y:h.current.scrollTop}),L.start(100,()=>{M.current=!0}))},onWheel:$,onTouchMove:$,onPointerMove:$,onPointerEnter:$,onKeyDown:$},q=R.useMemo(()=>({hasOverflowX:!b.scrollbarXHidden,hasOverflowY:!b.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:b.cornerHidden}),[b.scrollbarXHidden,b.scrollbarYHidden,b.cornerHidden,E]),K=at("div",t,{ref:[n,h],state:q,props:[N,u],stateAttributesMapping:X0}),V=R.useMemo(()=>({computeThumbPosition:H}),[H]);return v.jsx(B9.Provider,{value:V,children:K})}),yk=R.createContext(void 0);function V9(){const e=R.useContext(yk);if(e===void 0)throw new Error(Pt(54));return e}let Gh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const U9=R.forwardRef(function(t,n){const{render:s,className:o,orientation:u="vertical",keepMounted:h=!1,...a}=t,{hovering:l,scrollingX:d,scrollingY:p,hiddenState:f,overflowEdges:g,scrollbarYRef:S,scrollbarXRef:C,viewportRef:w,thumbYRef:b,thumbXRef:x,handlePointerDown:_,handlePointerUp:y,rootId:E,thumbSize:T}=Op(),A=R.useMemo(()=>({hovering:l,scrolling:{horizontal:d,vertical:p}[u],orientation:u,hasOverflowX:!f.scrollbarXHidden,hasOverflowY:!f.scrollbarYHidden,overflowXStart:g.xStart,overflowXEnd:g.xEnd,overflowYStart:g.yStart,overflowYEnd:g.yEnd,cornerHidden:f.cornerHidden}),[l,d,p,u,f,g]),M=Ia();R.useEffect(()=>{const N=w.current,q=u==="vertical"?S.current:C.current;if(!q)return;function K(V){if(!(!N||!q||V.ctrlKey)){if(V.preventDefault(),u==="vertical"){if(N.scrollTop===0&&V.deltaY<0)return}else if(N.scrollLeft===0&&V.deltaX<0)return;if(u==="vertical"){if(N.scrollTop===N.scrollHeight-N.clientHeight&&V.deltaY>0)return}else if(N.scrollLeft===N.scrollWidth-N.clientWidth&&V.deltaX>0)return;u==="vertical"?N.scrollTop+=V.deltaY:N.scrollLeft+=V.deltaX}}return q.addEventListener("wheel",K,{passive:!1}),()=>{q.removeEventListener("wheel",K)}},[u,C,S,w]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(N){if(N.button===0&&N.currentTarget===N.target&&w.current){if(b.current&&S.current&&u==="vertical"){const q=ss(b.current,"margin","y"),K=ss(S.current,"padding","y"),V=b.current.offsetHeight,Y=S.current.getBoundingClientRect(),G=N.clientY-Y.top-V/2-K+q/2,j=w.current.scrollHeight,W=w.current.clientHeight,P=S.current.offsetHeight-V-K-q,F=G/P*(j-W);w.current.scrollTop=F}if(x.current&&C.current&&u==="horizontal"){const q=ss(x.current,"margin","x"),K=ss(C.current,"padding","x"),V=x.current.offsetWidth,Y=C.current.getBoundingClientRect(),G=N.clientX-Y.left-V/2-K+q/2,j=w.current.scrollWidth,W=w.current.clientWidth,P=C.current.offsetWidth-V-K-q,I=G/P;let F;M==="rtl"?(F=(1-I)*(j-W),w.current.scrollLeft<=0&&(F=-F)):F=I*(j-W),w.current.scrollLeft=F}_(N)}},onPointerUp:y,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...u==="vertical"&&{top:0,bottom:`var(${qh.scrollAreaCornerHeight})`,insetInlineEnd:0,[Gh.scrollAreaThumbHeight]:`${T.height}px`},...u==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${qh.scrollAreaCornerWidth})`,bottom:0,[Gh.scrollAreaThumbWidth]:`${T.width}px`}}},D=at("div",t,{ref:[n,u==="vertical"?S:C],state:A,props:[L,a],stateAttributesMapping:X0}),z=R.useMemo(()=>({orientation:u}),[u]),H=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!H?v.jsx(yk.Provider,{value:z,children:D}):null}),W9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{thumbYRef:h,thumbXRef:a,handlePointerDown:l,handlePointerMove:d,handlePointerUp:p,setScrollingX:f,setScrollingY:g}=Op(),{orientation:S}=V9(),C=R.useMemo(()=>({orientation:S}),[S]);return at("div",t,{ref:[n,S==="vertical"?h:a],state:C,props:[{onPointerDown:l,onPointerMove:d,onPointerUp(b){S==="vertical"&&g(!1),S==="horizontal"&&f(!1),p(b)},style:{...S==="vertical"&&{height:`var(${Gh.scrollAreaThumbHeight})`},...S==="horizontal"&&{width:`var(${Gh.scrollAreaThumbWidth})`}}},u]})}),q9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:l}=Op(),d=at("div",t,{ref:[n,h],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:a.width,height:a.height}},u]});return l.cornerHidden?null:d}),bk=R.createContext(void 0);function G9(){const e=R.useContext(bk);if(e===void 0)throw new Error(Pt(63));return e}let GC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const xk={...ja,checked(e){return e?{[GC.checked]:""}:{[GC.unchecked]:""}}},$9=R.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u,id:h,inputRef:a,name:l,nativeButton:d=!1,onCheckedChange:p,readOnly:f=!1,required:g=!1,disabled:S=!1,render:C,uncheckedValue:w,...b}=t,{clearErrors:x}=ld(),{state:_,setTouched:y,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:D,disabled:z,name:H,validation:$}=us(),{labelId:N}=wo(),q=z||S,K=H??l,V=Pe(p),Y=R.useRef(null),G=cs(Y,a,$.inputRef),j=R.useRef(null),W=ar(),P=Tp({id:h,implicit:!1,controlRef:j}),[I,F]=as({controlled:s,default:!!u,name:"Switch",state:"checked"});cd({id:W,commit:$.commit,value:I,controlRef:j,name:K,getValue:()=>I}),Fe(()=>{Y.current&&A(Y.current.checked)},[Y,A]),ca(I,()=>{x(K),E(I!==T.initialValue),A(I),L()?$.commit(I):$.commit(I,!0)});const{getButtonProps:X,buttonRef:te}=Sr({disabled:q,native:d}),ee={id:W,role:"switch","aria-checked":I,"aria-readonly":f||void 0,"aria-labelledby":N,onFocus(){q||M(!0)},onBlur(){const ne=Y.current;!ne||q||(y(!0),M(!1),D==="onBlur"&&$.commit(ne.checked))},onClick(ne){f||q||(ne.preventDefault(),Y?.current?.click())}},Q=R.useMemo(()=>Ws({checked:I,disabled:q,id:P,name:K,required:g,style:ic,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const re=ne.target.checked,oe=Ue(Mn,ne.nativeEvent);V?.(re,oe),!oe.isCanceled&&F(re)},onFocus(){j.current?.focus()}},$.getInputValidationProps),[I,q,G,P,K,V,g,F,$]),U=R.useMemo(()=>({..._,checked:I,disabled:q,readOnly:f,required:g}),[_,I,q,f,g]),se=at("span",t,{state:U,ref:[n,j,te],props:[ee,$.getValidationProps,b,X],stateAttributesMapping:xk});return v.jsxs(bk.Provider,{value:U,children:[se,!I&&K&&w!==void 0&&v.jsx("input",{type:"hidden",name:K,value:w}),v.jsx("input",{...Q})]})}),K9=R.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=us(),a=G9(),l={...h,...a};return at("span",t,{state:l,ref:n,stateAttributesMapping:xk,props:u})}),Sk=R.createContext(void 0);function Y9(e=!0){const t=R.useContext(Sk);if(t===void 0&&!e)throw new Error(Pt(7));return t}const X9=R.forwardRef(function(t,n){const{className:s,defaultPressed:o=!1,disabled:u=!1,form:h,onPressedChange:a,pressed:l,render:d,type:p,value:f,nativeButton:g=!0,...S}=t,C=ar(f||void 0),w=Y9(),b=w?.value??[],x=w?void 0:o,_=(u||w?.disabled)??!1,[y,E]=as({controlled:w?b?.indexOf(C)>-1:l,default:x,name:"Toggle",state:"pressed"}),T=Pe(($,N)=>{C&&w?.setGroupValue?.(C,$,N),a?.($,N)}),{getButtonProps:A,buttonRef:M}=Sr({disabled:_,native:g}),L=R.useMemo(()=>({disabled:_,pressed:y}),[_,y]),D=[M,n],z=[{"aria-pressed":y,onClick($){const N=!y,q=Ue(Mn,$.nativeEvent);T(N,q),!q.isCanceled&&E(N)}},S,A],H=at("button",t,{enabled:!w,state:L,ref:D,props:z});return w?v.jsx(gk,{tag:"button",render:d,className:s,state:L,refs:D,props:z}):H});let Q9=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const $C={multiple(e){return e?{[Q9.multiple]:""}:null}},Z9=R.forwardRef(function(t,n){const{defaultValue:s,disabled:o=!1,loopFocus:u=!0,onValueChange:h,orientation:a="horizontal",multiple:l=!1,value:d,className:p,render:f,...g}=t,S=H0(),C=R.useMemo(()=>{if(d===void 0)return s??[]},[d,s]),w=(S?.disabled??!1)||o,[b,x]=as({controlled:d,default:C,name:"ToggleGroup",state:"value"}),_=Pe((M,L,D)=>{let z;if(l?(z=b.slice(),L?z.push(M):z.splice(b.indexOf(M),1)):z=L?[M]:[],Array.isArray(z)){if(h?.(z,D),D.isCanceled)return;x(z)}}),y=R.useMemo(()=>({disabled:w,multiple:l,orientation:a}),[w,a,l]),E=R.useMemo(()=>({disabled:w,orientation:a,setGroupValue:_,value:b}),[w,a,_,b]),T={role:"group"},A=at("div",t,{enabled:!!S,state:y,ref:n,props:[T,g],stateAttributesMapping:$C});return v.jsx(Sk.Provider,{value:E,children:S?A:v.jsx(KR,{render:f,className:p,state:y,refs:[n],props:[T,g],stateAttributesMapping:$C,loopFocus:u})})});function J9(e){return at(e.defaultTagName??"div",e,e)}function eI({className:e,...t}){return v.jsx("div",{"data-slot":"input-group",role:"group",className:Be("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const tI=Oa("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function nI({className:e,align:t="inline-start",...n}){return v.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Be(tI({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const rI=Oa("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Ck({className:e,type:t="button",variant:n="ghost",size:s="xs",...o}){return v.jsx(Ne,{type:t,"data-size":s,variant:n,className:Be(rI({size:s}),e),...o})}function sI({className:e,...t}){return v.jsx(Wt,{"data-slot":"input-group-control",className:Be("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const iI=c9;function oI({className:e,children:t,...n}){return v.jsxs(zj,{"data-slot":"combobox-trigger",className:Be("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,v.jsx(ve,{icon:pp,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function aI({className:e,...t}){return v.jsx(qj,{"data-slot":"combobox-clear",render:v.jsx(Ck,{variant:"ghost",size:"icon-xs"}),className:Be(e),...t,children:v.jsx(ve,{icon:Si,strokeWidth:2,className:"pointer-events-none"})})}function lI({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return v.jsxs(eI,{className:Be("w-auto",e),children:[v.jsx(Uj,{render:v.jsx(sI,{disabled:n}),...u}),v.jsxs(nI,{align:"inline-end",children:[s&&v.jsx(Ck,{size:"icon-xs",variant:"ghost",render:v.jsx(oI,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&v.jsx(aI,{disabled:n})]}),t]})}function cI({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return v.jsx(Qj,{children:v.jsx(Zj,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:v.jsx(e9,{"data-slot":"combobox-content","data-chips":!!u,className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...h})})})}function uI({className:e,...t}){return v.jsx(Yj,{"data-slot":"combobox-list",className:Be("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function dI({className:e,children:t,...n}){return v.jsxs(r9,{"data-slot":"combobox-item",className:Be("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,v.jsx(u9,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:v.jsx(ve,{icon:Ma,strokeWidth:2,className:"pointer-events-none"})})]})}function fI({className:e,...t}){return v.jsx(s9,{"data-slot":"combobox-empty",className:Be("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const hI=Oa("hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-muted border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),wk=R.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function pI({className:e,variant:t,size:n,spacing:s=0,orientation:o="horizontal",children:u,...h}){return v.jsx(Z9,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":s,"data-orientation":o,style:{"--gap":s},className:Be("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...h,children:v.jsx(wk.Provider,{value:{variant:t,size:n,spacing:s,orientation:o},children:u})})}function Rv({className:e,children:t,variant:n="default",size:s="default",...o}){const u=R.useContext(wk);return v.jsx(X9,{"data-slot":"toggle-group-item","data-variant":u.variant||n,"data-size":u.size||s,"data-spacing":u.spacing,className:Be("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",hI({variant:u.variant||n,size:u.size||s}),e),...o,children:t})}function ea({className:e,size:t="default",...n}){return v.jsx($9,{"data-slot":"switch","data-size":t,className:Be("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:v.jsx(K9,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}async function Zt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(n.status===401)throw window.dispatchEvent(new CustomEvent("vibora:auth-required")),new Error("Authentication required");if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}const Ba="";function Q0(){return Kn({queryKey:["tasks"],queryFn:()=>Zt(`${Ba}/api/tasks`)})}function Ek(e){return Kn({queryKey:["tasks",e],queryFn:()=>Zt(`${Ba}/api/tasks/${e}`),enabled:!!e})}function mI(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function gI(){const e=$n();return jn({mutationFn:({taskId:t,status:n,position:s})=>Zt(`${Ba}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function Z0(){const e=$n();return jn({mutationFn:({taskId:t,updates:n})=>Zt(`${Ba}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function vI(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function _I(){const e=$n();return jn({mutationFn:t=>Zt(`${Ba}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const lc="";function yI(e){return Kn({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Zt(`${lc}/api/fs/list${t}`)},enabled:e!==null})}function bI(e){return Kn({queryKey:["git","branches",e],queryFn:()=>Zt(`${lc}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function xI(e,t={}){const{staged:n=!1,ignoreWhitespace:s=!1,includeUntracked:o=!1}=t;return Kn({queryKey:["git","diff",e,n,s,o],queryFn:()=>{const u=new URLSearchParams({path:e,...n&&{staged:"true"},...s&&{ignoreWhitespace:"true"},...o&&{includeUntracked:"true"}});return Zt(`${lc}/api/git/diff?${u}`)},enabled:!!e,refetchInterval:5e3})}function SI(e){return Kn({queryKey:["fs","tree",e],queryFn:()=>Zt(`${lc}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function CI(e,t,n){return Kn({queryKey:["fs","read",e,t,n?.maxLines],queryFn:()=>{const s=new URLSearchParams({path:t,root:e,...n?.maxLines});return Zt(`${lc}/api/fs/read?${s}`)},enabled:!!e&&!!t})}async function wI(e){return Zt(`${lc}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const cc="",sn={PORT:"port",WORKTREE_BASE_PATH:"worktree_base_path",DEFAULT_GIT_REPOS_DIR:"default_git_repos_dir",TASK_CREATION_COMMAND:"task_creation_command",HOSTNAME:"hostname",SSH_PORT:"ssh_port",LINEAR_API_KEY:"linear_api_key",GITHUB_PAT:"github_pat"},EI=3333,RI="claude --dangerously-skip-permissions";function Ro(e){return Kn({queryKey:["config",e],queryFn:()=>Zt(`${cc}/api/config/${e}`)})}function kI(){const e=Ro(sn.PORT);return{...e,data:e.data?.value??EI,isDefault:e.data?.isDefault??!0}}function Rk(){const e=Ro(sn.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function J0(){const e=Ro(sn.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function kk(){const e=Ro(sn.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??RI,isDefault:e.data?.isDefault??!0}}function Mp(){const e=Ro(sn.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function Dp(){const e=Ro(sn.SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function TI(){const e=Ro(sn.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function LI(){const e=Ro(sn.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function AI(){const e=$n();return jn({mutationFn:({key:t,value:n})=>Zt(`${cc}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===sn.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function OI(){const e=$n();return jn({mutationFn:t=>Zt(`${cc}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function MI(){return Kn({queryKey:["config","notifications"],queryFn:()=>Zt(`${cc}/api/config/notifications`)})}function DI(){const e=$n();return jn({mutationFn:t=>Zt(`${cc}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function PI(){return jn({mutationFn:e=>Zt(`${cc}/api/config/notifications/test/${e}`,{method:"POST"})})}const fd="";function ey(){return Kn({queryKey:["repositories"],queryFn:()=>Zt(`${fd}/api/repositories`)})}function jI(e){return Kn({queryKey:["repositories",e],queryFn:()=>Zt(`${fd}/api/repositories/${e}`),enabled:!!e})}function Tk(){const e=$n();return jn({mutationFn:t=>Zt(`${fd}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function II(){const e=$n();return jn({mutationFn:({id:t,updates:n})=>Zt(`${fd}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function Lk(){const e=$n();return jn({mutationFn:t=>Zt(`${fd}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function Yl({className:e,children:t,...n}){return v.jsxs(I9,{"data-slot":"scroll-area",className:Be("relative",e),...n,children:[v.jsx(F9,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),v.jsx(NI,{}),v.jsx(q9,{})]})}function NI({className:e,orientation:t="vertical",...n}){return v.jsx(U9,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Be("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:v.jsx(W9,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function ty({open:e,onOpenChange:t,onSelect:n,initialPath:s}){const[o,u]=R.useState(s||null),[h,a]=R.useState(""),[l,d]=R.useState("");R.useEffect(()=>{e&&(u(s||null),a(""),d(""))},[e,s]);const{data:p,isLoading:f,error:g}=yI(e?o??"":null),S=y=>{p&&(u(p.path+"/"+y),d(""))},C=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},w=()=>{u(null),d("")},b=()=>{h.trim()&&(u(h.trim()),d(""))},x=y=>{n(y),t(!1)},_=p?.entries.filter(y=>y.name.toLowerCase().includes(l.toLowerCase()));return v.jsx(xs,{open:e,onOpenChange:t,children:v.jsxs(Ss,{className:"sm:max-w-lg",children:[v.jsxs(Bs,{children:[v.jsx(zs,{children:"Select Git Repository"}),v.jsx(aa,{children:"Choose an existing git repository"})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),v.jsx(B8,{}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Wt,{value:h,onChange:y=>a(y.target.value),placeholder:"/path/to/your/project",onKeyDown:y=>y.key==="Enter"&&b(),className:"flex-1"}),v.jsx(Ne,{variant:"outline",size:"sm",onClick:b,children:"Go"})]})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),v.jsxs("div",{className:"relative",children:[v.jsx(ve,{icon:U4,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),v.jsx(Wt,{value:l,onChange:y=>d(y.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ne,{variant:"outline",size:"icon-sm",onClick:w,title:"Home",children:v.jsx(ve,{icon:j4,size:14,strokeWidth:2})}),v.jsx(Ne,{variant:"outline",size:"icon-sm",onClick:C,disabled:!p||p.parent===p.path,title:"Parent directory",children:v.jsx(ve,{icon:u0,size:14,strokeWidth:2})}),v.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate",children:p?.path||"~"}),v.jsxs(Ne,{variant:"outline",size:"sm",onClick:()=>p&&x(p.path),disabled:!p,className:"max-sm:px-2",title:"Select current directory",children:[v.jsx(ve,{icon:d_,size:14,strokeWidth:2,className:"sm:hidden"}),v.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),v.jsx(Yl,{className:"h-64 border rounded-md",children:v.jsxs("div",{className:"p-1",children:[f&&v.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),g&&v.jsx("div",{className:"text-destructive text-xs p-3",children:g.message}),p&&_&&v.jsxs(v.Fragment,{children:[_.length===0&&v.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),_.map(y=>v.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:y.type==="directory"?v.jsxs(v.Fragment,{children:[v.jsx(ve,{icon:y.isGitRepo?d_:os,size:16,strokeWidth:2,className:y.isGitRepo?"text-emerald-500":"text-blue-500"}),v.jsx("button",{onClick:()=>S(y.name),className:"flex-1 text-left text-xs truncate hover:underline",children:y.name}),y.isGitRepo&&v.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-emerald-500/50 text-emerald-500 font-medium shrink-0",children:[v.jsx("span",{className:"max-sm:hidden",children:"git repo"}),v.jsx("span",{className:"sm:hidden",children:"git"})]})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"w-4"}),v.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate",children:y.name})]})},y.name))]})]})}),v.jsxs(vo,{children:[v.jsx(j0,{render:v.jsx(Ne,{variant:"outline"}),children:"Cancel"}),v.jsx(Ne,{onClick:()=>p&&x(p.path),disabled:!p,children:"Select Path"})]})]})})}function BI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function zI(e){const t=BI(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function HI({open:e,onOpenChange:t}={}){const[n,s]=R.useState(!1),o=e??n,u=t??s,[h,a]=R.useState(!1),[l,d]=R.useState(""),[p,f]=R.useState(""),[g,S]=R.useState(""),[C,w]=R.useState(""),[b,x]=R.useState(""),[_,y]=R.useState(""),[E,T]=R.useState(!0),[A,M]=R.useState("none"),[L,D]=R.useState(null),[z,H]=R.useState("browse"),[$,N]=R.useState(""),[q,K]=R.useState(null),[V,Y]=R.useState(!1),G=yo(),j=mI(),W=Tk(),{data:P}=Rk(),{data:I}=J0(),{data:F}=ey(),{data:X,isLoading:te}=bI(g||null),ee=L?F?.find(le=>le.id===L):null,Q=R.useMemo(()=>{if(!F)return[];if(!$.trim())return F;const le=$.toLowerCase();return F.filter(_e=>_e.displayName.toLowerCase().includes(le)||_e.path.toLowerCase().includes(le))},[F,$]);R.useEffect(()=>{F&&F.length>0?H("saved"):H("browse")},[F]),R.useEffect(()=>{w(X?X.current||X.branches[0]||"main":"")},[X,g]),R.useEffect(()=>{p.trim()&&A==="none"&&M("plan")},[p,A]);const U=le=>{d(le),y(zI(le))},se=async le=>{K(null),Y(!0);try{if(!(await wI(le)).isGitRepo){K("Selected folder is not a git repository"),Y(!1);return}if(S(le),D(null),!F?.find(ue=>ue.path===le)){const ue=le.split("/").pop()||"Unknown";W.mutate({path:le,displayName:ue})}}catch(_e){K(_e instanceof Error?_e.message:"Failed to validate repository")}finally{Y(!1)}},ne=le=>{if(le.preventDefault(),!l.trim()||!g)return;const _e=g.split("/").pop()||"repo",ge=b.trim()||_,ue=`${P}/${ge}`;j.mutate({title:l.trim(),description:p.trim(),repoPath:g,repoName:_e,baseBranch:C||"main",branch:ge,worktreePath:ue,initializeVibora:E,copyFiles:ee?.copyFiles||void 0,startupScript:ee?.startupScript||void 0},{onSuccess:de=>{const Ie=A!=="none"&&p.trim()?{aiMode:A,description:p.trim()}:void 0;u(!1),d(""),f(""),S(""),w(""),x(""),y(""),T(!0),M("none"),D(null),N(""),K(null),H(F&&F.length>0?"saved":"browse"),G({to:"/tasks/$taskId",params:{taskId:de.id},state:Ie})}})},re=b.trim()||_,oe=re?`${P}/${re}`:"";return v.jsxs(v.Fragment,{children:[v.jsxs(xs,{open:o,onOpenChange:u,children:[v.jsxs(kR,{render:v.jsx(Ne,{size:"sm"}),children:[v.jsx(ve,{icon:rc,size:16,strokeWidth:2,"data-slot":"icon"}),"New Task"]}),v.jsx(Ss,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:v.jsxs("form",{onSubmit:ne,className:"flex flex-col min-h-0 flex-1",children:[v.jsxs(Bs,{className:"shrink-0",children:[v.jsx(zs,{children:"Create New Task"}),v.jsx(aa,{children:"Create a new task with a git worktree for isolated development."})]}),v.jsxs(ud,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"title",children:"Title"}),v.jsx(Wt,{id:"title",value:l,onChange:le=>U(le.target.value),placeholder:"Add user authentication",required:!0})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"description",children:"Description"}),v.jsx(LR,{id:"description",value:p,onValueChange:f,placeholder:"Implement OAuth2 login flow...",rows:2})]}),v.jsxs(Cn,{children:[v.jsx(wn,{children:"AI Mode"}),v.jsxs(pI,{value:[A],onValueChange:le=>{const _e=Array.isArray(le)?le[0]:le;_e&&M(_e)},className:"w-full",variant:"outline",children:[v.jsx(Rv,{value:"none",className:"flex-1",children:"None"}),v.jsx(Rv,{value:"plan",className:"flex-1",children:"Plan"}),v.jsx(Rv,{value:"default",className:"flex-1",children:"Default"})]})]}),v.jsxs(Cn,{children:[v.jsx(wn,{children:"Repository"}),v.jsxs(_a,{value:z,onValueChange:le=>{H(le),K(null)},children:[v.jsxs(ya,{children:[v.jsx(ir,{value:"saved",disabled:!F?.length,children:"Saved"}),v.jsx(ir,{value:"browse",children:"Browse"})]}),v.jsx(_r,{value:"saved",className:"mt-2",children:v.jsxs(iI,{value:L||"",onValueChange:le=>{const _e=F?.find(ge=>ge.id===le);_e&&(D(le),S(_e.path),N(_e.displayName),K(null))},inputValue:$,onInputValueChange:le=>{N(le),ee&&le!==ee.displayName&&D(null)},itemToStringLabel:le=>F?.find(_e=>_e.id===le)?.displayName||"",children:[v.jsx(lI,{placeholder:"Search repositories...",className:"w-full"}),v.jsx(cI,{children:v.jsxs(uI,{children:[v.jsx(fI,{children:"No repositories found"}),Q.map(le=>v.jsx(dI,{value:le.id,children:le.displayName},le.id))]})})]})}),v.jsx(_r,{value:"browse",className:"mt-2",children:v.jsxs(Ne,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:V,children:[v.jsx(ve,{icon:os,size:14,strokeWidth:2,className:"mr-2"}),V?v.jsx("span",{className:"text-muted-foreground",children:"Validating..."}):g&&!L?v.jsx("span",{className:"truncate",children:g}):v.jsx("span",{className:"text-muted-foreground",children:"Select folder..."})]})})]}),q&&v.jsx("p",{className:"text-sm text-destructive",children:q}),g&&!q&&v.jsx(ao,{className:"font-mono text-xs truncate",children:g})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"baseBranch",children:"Base Branch"}),v.jsxs(jl,{value:C,onValueChange:le=>w(le??""),disabled:!g||te,children:[v.jsx(Nl,{className:"w-full",children:v.jsx(Il,{children:C||v.jsx("span",{className:"text-muted-foreground",children:g?te?"Loading branches...":"Select branch":"Select repository first"})})}),v.jsx(Bl,{children:X?.branches.map(le=>v.jsxs(vr,{value:le,children:[le,le===X.current&&v.jsx("span",{className:"text-muted-foreground ml-2",children:"(current)"})]},le))})]})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"branch",children:"Branch Name"}),v.jsx(Wt,{id:"branch",value:b,onChange:le=>x(le.target.value),placeholder:_||"auto-generated-from-title"}),oe&&v.jsxs(ao,{children:["Worktree: ",oe]}),!b.trim()&&_&&v.jsxs(ao,{children:['Will use "',_,'" if left empty.']})]}),v.jsxs(Cn,{className:"flex flex-row items-center justify-between",children:[v.jsxs("div",{children:[v.jsx(wn,{htmlFor:"initializeVibora",className:"mb-0 cursor-pointer",children:"Initialize Vibora"}),v.jsx(ao,{children:"Create or update CLAUDE.local.md with CLI instructions"})]}),v.jsx(ea,{id:"initializeVibora",checked:E,onCheckedChange:le=>T(le)})]})]}),v.jsxs(vo,{className:"mt-4 shrink-0",children:[v.jsx(j0,{render:v.jsx(Ne,{variant:"outline",type:"button"}),children:"Cancel"}),v.jsx(Ne,{type:"submit",disabled:j.isPending||!l.trim()||!g,children:j.isPending?"Creating...":"Create Task"})]})]})})]}),v.jsx(ty,{open:h,onOpenChange:a,onSelect:se,initialPath:I||void 0})]})}function FI({onNewTaskRef:e,onOpenCommandPalette:t}){const{location:n}=Jn(),s=n.pathname,[o,u]=R.useState(!1);return R.useEffect(()=>{e?.(()=>u(!0))},[e]),v.jsxs("header",{className:"sticky top-0 z-10 flex h-12 shrink-0 items-center justify-between border-b border-border bg-black px-4 max-sm:px-2",children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-1",children:[v.jsx(qn,{to:"/tasks",className:"hidden items-center sm:flex",children:v.jsx("img",{src:"/vibora-logo.jpeg",alt:"Vibora",className:"h-7"})}),v.jsxs("nav",{className:"flex items-center gap-1 max-sm:gap-0",children:[v.jsx(qn,{to:"/tasks",children:v.jsxs(Ne,{variant:s.startsWith("/tasks")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[v.jsx(ve,{icon:Mh,size:16,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Tasks"})]})}),v.jsx(qn,{to:"/terminals",children:v.jsxs(Ne,{variant:s==="/terminals"?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[v.jsx(ve,{icon:d0,size:16,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Terminals"})]})}),v.jsx(qn,{to:"/worktrees",children:v.jsxs(Ne,{variant:s.startsWith("/worktrees")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[v.jsx(ve,{icon:fE,size:16,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Worktrees"})]})}),v.jsx(qn,{to:"/repositories",children:v.jsxs(Ne,{variant:s.startsWith("/repositories")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[v.jsx(ve,{icon:uE,size:16,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Repositories"})]})}),v.jsx(qn,{to:"/review",children:v.jsxs(Ne,{variant:s.startsWith("/review")?"secondary":"ghost",size:"sm",className:"max-sm:px-2",children:[v.jsx(ve,{icon:f0,size:16,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Review"})]})})]})]}),v.jsxs("div",{className:"flex shrink-0 items-center gap-2 max-sm:gap-1",children:[v.jsx(HI,{open:o,onOpenChange:u}),v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:t,title:"Command Palette (⌘K)",children:v.jsx(ve,{icon:u_,size:16,strokeWidth:2})}),v.jsx(qn,{to:"/settings",children:v.jsx(Ne,{variant:s==="/settings"?"secondary":"ghost",size:"icon-sm",children:v.jsx(ve,{icon:pE,size:16,strokeWidth:2})})})]})]})}function VI(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const UI=10,WI=2e3;function qI(){const e=$n(),t=R.useRef(null),n=R.useRef(void 0),s=R.useRef(0),o=R.useRef(void 0),u=R.useCallback(a=>{try{const l=JSON.parse(a.data);if(l.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(l.type==="notification"&&"payload"in l){const{title:d,message:p,notificationType:f}=l.payload;switch(f){case"success":yr.success(d,{description:p});break;case"error":yr.error(d,{description:p});break;case"warning":yr.warning(d,{description:p});break;default:yr.info(d,{description:p});break}}}catch{}},[e]),h=R.useCallback(()=>{const a=t.current;if(a&&(a.readyState===WebSocket.CONNECTING||a.readyState===WebSocket.OPEN))return;const l=VI(),d=new WebSocket(l);t.current=d,d.onopen=()=>{s.current=0},d.onmessage=u,d.onclose=()=>{t.current===d&&(t.current=null),s.current<UI&&(s.current++,n.current=setTimeout(()=>{o.current?.()},WI))},d.onerror=()=>{}},[u]);o.current=h,R.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const Ak=R.createContext(null);function GI({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(!1),u=R.useCallback(d=>{n(d)},[]),h=R.useCallback(d=>{o(d)},[]),a=R.useMemo(()=>!t,[t]),l=R.useMemo(()=>({terminalFocused:t,setTerminalFocused:u,modalOpen:s,setModalOpen:h,shortcutsEnabled:a}),[t,u,s,h,a]);return v.jsx(Ak.Provider,{value:l,children:e})}function ny(){const e=R.useContext(Ak);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function $I(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function Ok(e){const t=e.toLowerCase().split("+"),n=t.pop()||"";return{meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),key:n}}function KI(e,t){const n=Ok(t);if(n.meta!==e.metaKey||n.ctrl!==e.ctrlKey||n.alt!==e.altKey||n.shift!==e.shiftKey)return!1;const s=e.key.toLowerCase(),o=n.key.toLowerCase();return o==="escape"?s==="escape":o==="enter"?s==="enter":o==="space"?s===" ":o==="backspace"?s==="backspace":o==="delete"?s==="delete":o==="tab"?s==="tab":o==="arrowup"?s==="arrowup":o==="arrowdown"?s==="arrowdown":o==="arrowleft"?s==="arrowleft":o==="arrowright"?s==="arrowright":/^[0-9]$/.test(o)?s===o:o==="/"&&!n.shift?s==="/":o==="/"&&n.shift||o==="?"?s==="?":o===","?s===",":o==="\\"?s==="\\":s===o}function Mk(e){const t=Ok(e),n=[],s=$I();t.ctrl&&n.push("Ctrl"),t.alt&&n.push(s?"Option":"Alt"),t.shift&&n.push("Shift"),t.meta&&n.push(s?"Cmd":"Ctrl");let o=t.key.toUpperCase();return o==="ESCAPE"&&(o="Esc"),o==="ENTER"&&(o="Enter"),o==="SPACE"&&(o="Space"),o==="BACKSPACE"&&(o="Backspace"),o==="DELETE"&&(o="Delete"),o==="ARROWUP"&&(o="↑"),o==="ARROWDOWN"&&(o="↓"),o==="ARROWLEFT"&&(o="←"),o==="ARROWRIGHT"&&(o="→"),o===","&&(o=","),o==="/"&&(o="/"),o==="?"&&(o="?"),o==="\\"&&(o="\\"),n.push(o),n.join("+")}function YI(e){if(!e||!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return!!(t==="input"||t==="textarea"||e.isContentEditable)}function bi(e,t,n={}){const{shortcutsEnabled:s}=ny(),{ignoreContext:o=!1,allowInInput:u=!1,allowInTerminal:h=!1,deps:a=[],enabled:l=!0}=n,d=R.useRef(t);d.current=t;const p=Array.isArray(e)?e:[e],f=R.useCallback(g=>{!o&&!s&&!h||!l||!u&&YI(g.target)&&!p.some(w=>w.toLowerCase()==="escape")||!p.some(C=>KI(g,C))||(g.preventDefault(),g.stopPropagation(),d.current(g))},[s,o,u,h,l,...p,...a]);R.useEffect(()=>(document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}),[f])}function KC(e,t){const n=e.toLowerCase(),s=t.toLowerCase();if(n===s)return 100;if(n.startsWith(s))return 80;if(n.includes(s))return 60;let o=0,u=0,h=0;for(;o<n.length&&u<s.length;)n[o]===s[u]&&(h+=1,u++),o++;return u===s.length?h:0}function XI(e,t){return t.trim()?e.map(s=>{let o=KC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=KC(u,t);h>o&&(o=h)}return{command:s,score:o}}).filter(({score:s})=>s>0).sort((s,o)=>o.score-s.score).map(({command:s})=>s):e}function QI(e){const t=new Map;for(const n of e){const s=t.get(n.category)||[];s.push(n),t.set(n.category,s)}return t}const ZI={navigation:"Navigation",actions:"Actions"},JI={activeTabId:null,focusedTerminals:{}};function Dk(){const e=$n(),t=R.useRef(void 0),n=R.useRef({}),{data:s=JI,isLoading:o}=Kn({queryKey:["terminal-view-state"],queryFn:async()=>{const p=await fetch("/api/terminal-view-state");if(!p.ok)throw new Error("Failed to fetch terminal view state");return p.json()}}),u=jn({mutationFn:async p=>{const f=await fetch("/api/terminal-view-state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!f.ok)throw new Error("Failed to update terminal view state");return f.json()},onSuccess:p=>{e.setQueryData(["terminal-view-state"],p)}}),h=R.useCallback(p=>{const f=n.current;n.current={...f,...p,focusedTerminals:p.focusedTerminals||f.focusedTerminals?{...f.focusedTerminals,...p.focusedTerminals}:void 0};const g=n.current,S={activeTabId:g.activeTabId!==void 0?g.activeTabId:s.activeTabId,focusedTerminals:{...s.focusedTerminals,...g.focusedTerminals}};e.setQueryData(["terminal-view-state"],S),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{u.mutate(n.current),n.current={}},500)},[e,s,u]),a=R.useCallback(p=>{h({activeTabId:p})},[h]),l=R.useCallback((p,f)=>{if(f===null){const{[p]:g,...S}=s.focusedTerminals;h({focusedTerminals:S})}else h({focusedTerminals:{[p]:f}})},[h,s.focusedTerminals]),d=R.useCallback(p=>s.focusedTerminals[p]??null,[s.focusedTerminals]);return{viewState:s,isLoading:o,activeTabId:s.activeTabId,setActiveTab:a,getFocusedTerminal:d,setFocusedTerminal:l}}function eN({open:e,onOpenChange:t,onNewTask:n,onShowShortcuts:s}){const[o,u]=R.useState(!1),h=e??o,a=t??u,[l,d]=R.useState(""),[p,f]=R.useState(0),g=R.useRef(null),S=R.useRef(null),C=yo(),{setActiveTab:w}=Dk(),b=R.useMemo(()=>[{id:"goto-tasks",label:"Go to Tasks",shortcut:"meta+1",keywords:["kanban","board","home"],category:"navigation",icon:v.jsx(ve,{icon:Mh,size:16,strokeWidth:2}),action:()=>{C({to:"/tasks"}),a(!1)}},{id:"goto-terminals",label:"Go to Terminals",shortcut:"meta+2",keywords:["shell","console","cli"],category:"navigation",icon:v.jsx(ve,{icon:d0,size:16,strokeWidth:2}),action:()=>{C({to:"/terminals"}),a(!1)}},{id:"goto-task-terminals",label:"Go to Task Terminals",shortcut:"meta+i",keywords:["tasks","shell","console","cli"],category:"navigation",icon:v.jsx(ve,{icon:Mh,size:16,strokeWidth:2}),action:()=>{w("all-tasks"),C({to:"/terminals"}),a(!1)}},{id:"goto-worktrees",label:"Go to Worktrees",shortcut:"meta+3",keywords:["git","branches"],category:"navigation",icon:v.jsx(ve,{icon:fE,size:16,strokeWidth:2}),action:()=>{C({to:"/worktrees"}),a(!1)}},{id:"goto-repositories",label:"Go to Repositories",shortcut:"meta+4",keywords:["repos","git","projects"],category:"navigation",icon:v.jsx(ve,{icon:uE,size:16,strokeWidth:2}),action:()=>{C({to:"/repositories"}),a(!1)}},{id:"goto-settings",label:"Go to Settings",shortcut:"meta+,",keywords:["preferences","config","configuration"],category:"navigation",icon:v.jsx(ve,{icon:pE,size:16,strokeWidth:2}),action:()=>{C({to:"/settings"}),a(!1)}},{id:"new-task",label:"New Task",shortcut:"meta+j",keywords:["create","add"],category:"actions",icon:v.jsx(ve,{icon:rc,size:16,strokeWidth:2}),action:()=>{a(!1),n?.()}},{id:"show-shortcuts",label:"Keyboard Shortcuts",shortcut:"meta+/",keywords:["help","hotkeys","keys"],category:"actions",icon:v.jsx(ve,{icon:P4,size:16,strokeWidth:2}),action:()=>{a(!1),s?.()}}],[C,n,s,w]),x=R.useMemo(()=>XI(b,l),[b,l]),_=R.useMemo(()=>QI(x),[x]),y=R.useMemo(()=>{const A=[],M=["navigation","actions"];for(const L of M){const D=_.get(L);D&&A.push(...D)}return A},[_]);R.useEffect(()=>{f(0)},[l]),R.useEffect(()=>{if(!S.current)return;const A=S.current.querySelector('[data-selected="true"]');A&&A.scrollIntoView({block:"nearest"})},[p]),bi("meta+k",()=>a(!0),{allowInInput:!0,allowInTerminal:!0}),bi("meta+1",()=>C({to:"/tasks"}),{allowInInput:!0,allowInTerminal:!0}),bi("meta+2",()=>C({to:"/terminals"}),{allowInInput:!0,allowInTerminal:!0}),bi("meta+i",()=>{w("all-tasks"),C({to:"/terminals"})},{allowInInput:!0,allowInTerminal:!0}),bi("meta+3",()=>C({to:"/worktrees"}),{allowInInput:!0,allowInTerminal:!0}),bi("meta+4",()=>C({to:"/repositories"}),{allowInInput:!0,allowInTerminal:!0}),bi("meta+,",()=>C({to:"/settings"}),{allowInInput:!0,allowInTerminal:!0}),bi("meta+j",()=>{n?.()},{allowInInput:!1,deps:[n]}),bi("meta+/",()=>{s?.()},{allowInInput:!0,allowInTerminal:!0,deps:[s]});const E=R.useCallback(A=>{switch(A.key){case"ArrowDown":A.preventDefault(),f(M=>Math.min(M+1,y.length-1));break;case"ArrowUp":A.preventDefault(),f(M=>Math.max(M-1,0));break;case"Enter":A.preventDefault(),y[p]&&y[p].action();break;case"Escape":A.preventDefault(),a(!1);break}},[y,p]);R.useEffect(()=>{h&&(d(""),f(0),setTimeout(()=>g.current?.focus(),50))},[h]);let T=0;return v.jsx(xs,{open:h,onOpenChange:a,children:v.jsxs(Ss,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",showCloseButton:!1,onKeyDown:E,children:[v.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[v.jsx("span",{className:"text-muted-foreground mr-2",children:">"}),v.jsx(Wt,{ref:g,value:l,onChange:A=>d(A.target.value),placeholder:"Type a command or search...",className:"border-0 ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 px-0 h-12"}),v.jsx("kbd",{className:"pointer-events-none ml-2 inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"Esc"})]}),v.jsx("div",{ref:S,className:"max-h-80 overflow-y-auto p-2",children:x.length===0?v.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No commands found."}):v.jsx(v.Fragment,{children:["navigation","actions"].map(A=>{const M=_.get(A);return!M||M.length===0?null:v.jsxs("div",{className:"mb-2 last:mb-0",children:[v.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:ZI[A]}),M.map(L=>{const D=T++,z=D===p;return v.jsxs("button",{"data-selected":z,onClick:()=>L.action(),onMouseEnter:()=>f(D),className:Be("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",z?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[L.icon&&v.jsx("span",{className:"text-muted-foreground",children:L.icon}),v.jsx("span",{className:"flex-1 text-left",children:L.label}),L.shortcut&&v.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:Mk(L.shortcut)})]},L.id)})]},A)})})})]})})}const tN=[{title:"Navigation",items:[{label:"Go to Tasks",shortcut:"meta+1"},{label:"Go to Terminals",shortcut:"meta+2"},{label:"Go to Task Terminals",shortcut:"meta+i"},{label:"Go to Worktrees",shortcut:"meta+3"},{label:"Go to Repositories",shortcut:"meta+4"},{label:"Go to Settings",shortcut:"meta+,"}]},{title:"Actions",items:[{label:"Command Palette",shortcut:"meta+k"},{label:"New Task",shortcut:"meta+j"},{label:"Keyboard Shortcuts",shortcut:"meta+/"}]},{title:"General",items:[{label:"Close Modal",shortcut:"escape"}]}];function nN({open:e,onOpenChange:t}){return v.jsx(xs,{open:e,onOpenChange:t,children:v.jsxs(Ss,{className:"sm:max-w-md",children:[v.jsx(Bs,{children:v.jsx(zs,{children:"Keyboard Shortcuts"})}),v.jsx("div",{className:"space-y-4 mt-2",children:tN.map(n=>v.jsxs("div",{children:[v.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:n.title}),v.jsx("div",{className:"space-y-1",children:n.items.map(s=>v.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v.jsx("span",{className:"text-sm",children:s.label}),v.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:Mk(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const rN=({...e})=>v.jsx(P8,{theme:"dark",className:"toaster group",icons:{success:v.jsx(ve,{icon:T4,strokeWidth:2,className:"size-4"}),info:v.jsx(ve,{icon:N4,strokeWidth:2,className:"size-4"}),warning:v.jsx(ve,{icon:nc,strokeWidth:2,className:"size-4"}),error:v.jsx(ve,{icon:F4,strokeWidth:2,className:"size-4"}),loading:v.jsx(ve,{icon:zr,strokeWidth:2,className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e}),Ks=iO({component:iN});function sN(){return qI(),null}function iN(){const[e,t]=R.useState(null),[n,s]=R.useState(!1),[o,u]=R.useState(!1),h=R.useCallback(p=>{t(()=>p)},[]),a=R.useCallback(()=>{e?.()},[e]),l=R.useCallback(()=>{s(!0)},[]),d=R.useCallback(()=>{u(!0)},[]);return v.jsx(GI,{children:v.jsxs("div",{className:"flex h-screen flex-col overflow-x-hidden bg-background text-foreground",children:[v.jsx(sN,{}),v.jsx(FI,{onNewTaskRef:h,onOpenCommandPalette:d}),v.jsx("main",{className:"isolate flex-1 overflow-hidden",children:v.jsx(L2,{})}),v.jsx(eN,{open:o,onOpenChange:u,onNewTask:a,onShowShortcuts:l}),v.jsx(nN,{open:n,onOpenChange:s}),v.jsx(rN,{position:"bottom-right"})]})})}const oN=ws("/")({beforeLoad:()=>{throw h2({to:"/tasks"})}}),Pk="";function aN(){const[e,t]=R.useState(new Map),[n,s]=R.useState(null),[o,u]=R.useState(!0),[h,a]=R.useState(!1),[l,d]=R.useState(null),p=R.useRef(null),f=R.useRef(0),g=R.useCallback(()=>{p.current?.close(),u(!0),a(!1),d(null),t(new Map),s(null);const C=new EventSource(`${Pk}/api/worktrees`);p.current=C,C.addEventListener("worktree:basic",w=>{const b=JSON.parse(w.data);f.current=b.length,t(new Map(b.map(x=>[x.path,{...x,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(b.length>0)}),C.addEventListener("worktree:details",w=>{const b=JSON.parse(w.data);t(x=>{const _=new Map(x),y=_.get(b.path);return y&&_.set(b.path,{...y,size:b.size,sizeFormatted:b.sizeFormatted,branch:b.branch}),_}),f.current--,f.current<=0&&a(!1)}),C.addEventListener("worktree:complete",w=>{const b=JSON.parse(w.data);s(b),a(!1),C.close()}),C.addEventListener("worktree:error",w=>{const{path:b}=JSON.parse(w.data);console.error(`Error loading worktree details for ${b}`),f.current--,f.current<=0&&a(!1)}),C.onerror=()=>{d(new Error("Connection lost")),u(!1),a(!1),C.close()}},[]);return R.useEffect(()=>(g(),()=>{p.current?.close()}),[g]),{worktrees:R.useMemo(()=>Array.from(e.values()).sort((w,b)=>w.isOrphaned!==b.isOrphaned?w.isOrphaned?-1:1:new Date(b.lastModified).getTime()-new Date(w.lastModified).getTime()),[e]),summary:n,isLoading:o,isLoadingDetails:h,error:l,refetch:g}}function lN(){const e=$n();return jn({mutationFn:({worktreePath:t,repoPath:n})=>Zt(`${Pk}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const cN=Oa("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ba({className:e,variant:t="default",render:n,...s}){return J9({defaultTagName:"span",props:Ws({className:Be(cN({className:e,variant:t}))},s),render:n,state:{slot:"badge",variant:t}})}function hd({className:e,size:t="default",...n}){return v.jsx("div",{"data-slot":"card","data-size":t,className:Be("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function uN({className:e,...t}){return v.jsx("div",{"data-slot":"card-header",className:Be("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function dN({className:e,...t}){return v.jsx("div",{"data-slot":"card-title",className:Be("text-sm font-medium",e),...t})}function pd({className:e,...t}){return v.jsx("div",{"data-slot":"card-content",className:Be("px-4 group-data-[size=sm]/card:px-3",e),...t})}function uc({...e}){return v.jsx(Mj,{"data-slot":"alert-dialog",...e})}function dc({...e}){return v.jsx(RR,{"data-slot":"alert-dialog-trigger",...e})}function fN({...e}){return v.jsx(SR,{"data-slot":"alert-dialog-portal",...e})}function hN({className:e,...t}){return v.jsx(vE,{"data-slot":"alert-dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function fc({className:e,size:t="default",...n}){return v.jsxs(fN,{children:[v.jsx(hN,{}),v.jsx(xR,{"data-slot":"alert-dialog-content","data-size":t,className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function hc({className:e,...t}){return v.jsx("div",{"data-slot":"alert-dialog-header",className:Be("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function pc({className:e,...t}){return v.jsx("div",{"data-slot":"alert-dialog-footer",className:Be("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function mc({className:e,...t}){return v.jsx(ER,{"data-slot":"alert-dialog-title",className:Be("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function gc({className:e,...t}){return v.jsx(bE,{"data-slot":"alert-dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function jk({className:e,...t}){return v.jsx(Ne,{"data-slot":"alert-dialog-action",className:Be(e),...t})}function vc({className:e,variant:t="outline",size:n="default",...s}){return v.jsx(vp,{"data-slot":"alert-dialog-cancel",className:Be(e),render:v.jsx(Ne,{variant:t,size:n}),...s})}const Ik={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},E_={IN_PROGRESS:"bg-slate-400/20 text-slate-600 dark:text-slate-400",IN_REVIEW:"bg-violet-400/20 text-violet-600 dark:text-violet-400",DONE:"bg-emerald-400/20 text-emerald-600 dark:text-emerald-400",CANCELED:"bg-rose-400/20 text-rose-600 dark:text-rose-400",ORPHANED:"bg-destructive/20 text-destructive"},pN=ws("/worktrees/")({component:_N});function mN(e){const t=new Date(e),s=new Date().getTime()-t.getTime(),o=Math.floor(s/1e3),u=Math.floor(o/60),h=Math.floor(u/60),a=Math.floor(h/24);return a>0?a===1?"1 day ago":`${a} days ago`:h>0?h===1?"1 hour ago":`${h} hours ago`:u>0?u===1?"1 minute ago":`${u} minutes ago`:"just now"}function YC({className:e}){return v.jsx("span",{className:`inline-block animate-pulse rounded bg-muted ${e}`})}function gN({worktree:e,onDelete:t}){const[n,s]=R.useState(!1),[o,u]=R.useState(!1),h=e.sizeFormatted==="..."||e.branch==="...",a=async()=>{u(!0);try{await t(e),s(!1)}catch{}finally{u(!1)}};return v.jsx(hd,{className:"transition-colors hover:border-border/80",children:v.jsxs(pd,{className:"flex items-start justify-between gap-4 py-4",children:[v.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"truncate font-medium",children:e.name}),e.isOrphaned?v.jsx(ba,{className:Be("shrink-0",E_.ORPHANED),children:"Orphaned"}):e.taskStatus?v.jsx(ba,{className:Be("shrink-0",E_[e.taskStatus]),children:Ik[e.taskStatus]}):null]}),v.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:os,size:12,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{className:"truncate font-mono",children:e.path})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:f_,size:12,strokeWidth:2,className:"shrink-0"}),e.branch==="..."?v.jsx(YC,{className:"h-3 w-16"}):v.jsx("span",{className:"font-mono",children:e.branch})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:D4,size:12,strokeWidth:2,className:"shrink-0"}),e.sizeFormatted==="..."?v.jsx(YC,{className:"h-3 w-12"}):v.jsx("span",{children:e.sizeFormatted})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:R4,size:12,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{children:mN(e.lastModified)})]})]}),e.taskId&&e.taskTitle&&v.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:v.jsxs(qn,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[v.jsx("span",{className:"truncate",children:e.taskTitle}),v.jsx(ve,{icon:mp,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),v.jsxs(uc,{open:n,onOpenChange:s,children:[v.jsx(dc,{render:v.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:h}),children:v.jsx(ve,{icon:td,size:14,strokeWidth:2})}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsx(mc,{children:"Delete Worktree"}),v.jsxs(gc,{children:["This will permanently delete the worktree directory at"," ",v.jsx("span",{className:"font-mono",children:e.name}),".",!e.isOrphaned&&v.jsxs(v.Fragment,{children:[" ","The linked task ",v.jsxs("span",{className:"font-medium",children:['"',e.taskTitle,'"']})," will also be deleted."]})," ","This action cannot be undone."]})]}),v.jsxs(pc,{children:[v.jsx(vc,{disabled:o,children:"Cancel"}),v.jsxs(Ne,{variant:"destructive",onClick:a,disabled:o,className:"gap-2",children:[o&&v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})})}const vN=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function _N(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=aN(),h=lN(),[a,l]=R.useState(new Set),[d,p]=R.useState(!1),[f,g]=R.useState(!1),S=y=>{l(E=>{const T=new Set(E);return T.has(y)?T.delete(y):T.add(y),T})},C=()=>{l(new Set)},w=R.useMemo(()=>a.size===0?e:e.filter(y=>!!(y.isOrphaned&&a.has("ORPHANED")||y.taskStatus&&a.has(y.taskStatus))),[e,a]),b=R.useMemo(()=>e.filter(y=>y.taskStatus==="DONE"||y.taskStatus==="CANCELED"),[e]),x=async()=>{if(b.length!==0){g(!0);try{for(const y of b)await h.mutateAsync({worktreePath:y.path,repoPath:y.repoPath});p(!1),u()}catch{}finally{g(!1)}}},_=async y=>{await h.mutateAsync({worktreePath:y.path,repoPath:y.repoPath}),u()};return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("h1",{className:"text-sm font-medium",children:"Worktrees"}),(t||e.length>0)&&v.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[v.jsxs("span",{children:[t?.total??e.length," total"]}),(t?.orphaned??e.filter(y=>y.isOrphaned).length)>0&&v.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(y=>y.isOrphaned).length," orphaned"]}),s?v.jsx("span",{className:"animate-pulse",children:"calculating..."}):t?v.jsx("span",{children:t.totalSizeFormatted}):null]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[b.length>0&&v.jsxs(uc,{open:d,onOpenChange:p,children:[v.jsxs(dc,{render:v.jsx(Ne,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground hover:text-destructive",disabled:s}),children:[v.jsx(ve,{icon:L4,size:12,strokeWidth:2}),"Clean up (",b.length,")"]}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsx(mc,{children:"Delete Completed Worktrees"}),v.jsxs(gc,{className:"space-y-2",children:[v.jsxs("span",{className:"block",children:["This will permanently delete ",b.length," worktree",b.length!==1?"s":""," and their linked tasks:"]}),v.jsxs("span",{className:"block text-sm",children:[b.filter(y=>y.taskStatus==="DONE").length>0&&v.jsxs("span",{className:"mr-3",children:[v.jsx("span",{className:"font-medium text-emerald-600",children:b.filter(y=>y.taskStatus==="DONE").length})," ","Done"]}),b.filter(y=>y.taskStatus==="CANCELED").length>0&&v.jsxs("span",{children:[v.jsx("span",{className:"font-medium text-rose-600",children:b.filter(y=>y.taskStatus==="CANCELED").length})," ","Canceled"]})]}),v.jsx("span",{className:"block font-medium text-destructive",children:"This action cannot be undone."})]})]}),v.jsxs(pc,{children:[v.jsx(vc,{disabled:f,children:"Cancel"}),v.jsxs(Ne,{variant:"destructive",onClick:x,disabled:f,className:"gap-2",children:[f&&v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),f?"Deleting...":`Delete ${b.length}`]})]})]})]}),a.size>0&&v.jsxs(Ne,{variant:"ghost",size:"sm",onClick:C,className:"gap-1.5 text-xs",children:[v.jsx(ve,{icon:Si,size:12,strokeWidth:2}),"Clear filters"]})]})]}),v.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:vN.map(y=>{const E=a.has(y);return v.jsx("button",{onClick:()=>S(y),className:Be("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",E?E_[y]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:Ik[y]},y)})})]}),v.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[n&&v.jsx("div",{className:"flex items-center justify-center py-12",children:v.jsx(ve,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),o&&v.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[v.jsx(ve,{icon:nc,size:20,strokeWidth:2}),v.jsxs("span",{className:"text-sm",children:["Failed to load worktrees: ",o.message]})]}),!n&&!o&&w.length===0&&v.jsx("div",{className:"py-12 text-muted-foreground",children:v.jsx("p",{className:"text-sm",children:a.size>0?"No worktrees match the selected filters.":"No worktrees found. Worktrees are created when you create tasks."})}),!n&&v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.map(y=>v.jsx(gN,{worktree:y,onDelete:_},y.path))})]})]})}function Gt(e,t="Assertion error"){if(!e)throw Error(t)}function Xl({group:e}){const{orientation:t,panels:n}=e;return n.reduce((s,o)=>(s+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,s),0)}function R_(e,t){return t.sort(e==="horizontal"?yN:bN)}function yN(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function bN(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Nk(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function xN({orientation:e,rects:t,targetRect:n}){const s={x:n.x+n.width/2,y:n.y+n.height/2};let o,u=Number.MAX_VALUE;for(const h of t){const{x:a,y:l}=Nk(s,h),d=e==="horizontal"?a:l;d<u&&(u=d,o=h)}return Gt(o,"No rect found"),o}function Bk(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=R_(n,Array.from(t.children).filter(p=>p instanceof HTMLElement).map(p=>({element:p}))).map(({element:p})=>p),h=[];let a=!1,l,d=[];for(const p of u)if(p.hasAttribute("data-panel")){const f=s.find(g=>g.element===p);if(f){if(l){const g=l.element.getBoundingClientRect(),S=p.getBoundingClientRect();let C;if(a){const w=n==="horizontal"?new DOMRect(g.right,g.top,0,g.height):new DOMRect(g.left,g.bottom,g.width,0),b=n==="horizontal"?new DOMRect(S.left,S.top,0,S.height):new DOMRect(S.left,S.top,S.width,0);switch(d.length){case 0:{C=[w,b];break}case 1:{const x=d[0],_=xN({orientation:n,rects:[g,S],targetRect:x.element.getBoundingClientRect()});C=[x,_===g?b:w];break}default:{C=d;break}}}else d.length?C=d:C=[n==="horizontal"?new DOMRect(g.right,S.top,S.left-g.right,S.height):new DOMRect(S.left,g.bottom,S.width,S.top-g.bottom)];for(const w of C)h.push({group:e,groupSize:Xl({group:e}),panels:[l,f],separator:"width"in w?void 0:w,rect:"width"in w?w:w.element.getBoundingClientRect()})}a=!1,l=f,d=[]}}else if(p.hasAttribute("data-separator")){const f=o.find(g=>g.element===p);f?d.push(f):(l=void 0,d=[])}else a=!0;return h}function SN(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function CN(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function wN(e){return e/100*window.innerHeight}function EN(e){return e/100*window.innerWidth}function RN(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function nh({groupSize:e,panelElement:t,styleProp:n}){let s;const[o,u]=RN(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=CN(t,o);break}case"em":{s=SN(t,o);break}case"vh":{s=wN(o);break}case"vw":{s=EN(o);break}}return s}function Cs(e){return parseFloat(e.toFixed(3))}function XC(e){const{panels:t}=e,n=Xl({group:e});return n===0?t.map(s=>({collapsedSize:0,collapsible:s.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:s.id})):t.map(s=>{const{element:o,panelConstraints:u}=s;let h=0;if(u.collapsedSize){const p=nh({groupSize:n,panelElement:o,styleProp:u.collapsedSize});h=Cs(p/n*100)}let a;if(u.defaultSize){const p=nh({groupSize:n,panelElement:o,styleProp:u.defaultSize});a=Cs(p/n*100)}let l=0;if(u.minSize){const p=nh({groupSize:n,panelElement:o,styleProp:u.minSize});l=Cs(p/n*100)}let d=100;if(u.maxSize){const p=nh({groupSize:n,panelElement:o,styleProp:u.maxSize});d=Cs(p/n*100)}return{collapsedSize:h,collapsible:u.collapsible===!0,defaultSize:a,minSize:l,maxSize:d,panelId:s.id}})}class kN{#e={};addListener(t,n){const s=this.#e[t];return s===void 0?this.#e[t]=[n]:s.includes(n)||s.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const s=this.#e[t];if(s!==void 0)if(s.length===1)s[0].call(null,n);else{let o=!1,u=null;const h=Array.from(s);for(let a=0;a<h.length;a++){const l=h[a];try{l.call(null,n)}catch(d){u===null&&(o=!0,u=d)}}if(o)throw u}}removeAllListeners(){this.#e={}}removeListener(t,n){const s=this.#e[t];if(s!==void 0){const o=s.indexOf(n);o>=0&&s.splice(o,1)}}}function or(e,t,n=0){return Math.abs(Cs(e)-Cs(t))<=n}let Zr={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const xa=new kN;function Ys(){return Zr}function ls(e){const t=typeof e=="function"?e(Zr):e;if(Zr===t)return Zr;const n=Zr;return Zr={...Zr,...t},t.cursorFlags!==void 0&&xa.emit("cursorFlagsChange",Zr.cursorFlags),t.interactionState!==void 0&&xa.emit("interactionStateChange",Zr.interactionState),t.mountedGroups!==void 0&&(Zr.mountedGroups.forEach((s,o)=>{s.derivedPanelConstraints.forEach(u=>{if(u.collapsible){const{layout:h}=n.mountedGroups.get(o)??{};if(h){const a=or(u.collapsedSize,s.layout[u.panelId]),l=or(u.collapsedSize,h[u.panelId]);a&&!l&&(o.inMemoryLastExpandedPanelSizes[u.panelId]=h[u.panelId])}}})}),xa.emit("mountedGroupsChange",Zr.mountedGroups)),Zr}const TN=e=>e,kv=()=>{},zk=1,Hk=2,Fk=4,Vk=8,QC={coarse:10,precise:5};function LN({cursorFlags:e,groups:t,state:n}){let s=0,o=0;switch(n){case"active":case"hover":t.forEach(u=>{if(!u.disableCursor)switch(u.orientation){case"horizontal":{s++;break}case"vertical":{o++;break}}})}if(s===0&&o===0)return null;switch(n){case"active":{const u=(e&zk)!==0,h=(e&Hk)!==0,a=(e&Fk)!==0,l=(e&Vk)!==0;if(e){if(u)return a?"se-resize":l?"ne-resize":"e-resize";if(h)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return s>0&&o>0?"move":s>0?"ew-resize":"ns-resize"}let Tv,Ds;function ry(){Ds===void 0&&(Ds=new CSSStyleSheet,document.adoptedStyleSheets=[Ds]);const{cursorFlags:e,interactionState:t}=Ys();switch(t.state){case"active":case"hover":{const n=LN({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(Tv===s)return;Tv=s,n?Ds.cssRules.length===0?Ds.insertRule(s):Ds.replaceSync(s):Ds.cssRules.length===1&&Ds.deleteRule(0);break}case"inactive":{Tv=void 0,Ds.cssRules.length===1&&Ds.deleteRule(0);break}}}function AN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function qu(e,t){return or(e,t)?0:e>t?1:-1}function kl({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:s,maxSize:o=100,minSize:u=0}=e;if(qu(t,u)<0)if(s){const h=(n+u)/2;qu(t,h)<0?t=n:t=u}else t=u;return t=Math.min(o,t),t=Cs(t),t}function Gu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:u}){if(or(e,0))return t;const h=Object.values(t),a=Object.values(o),l=[...h],[d,p]=s;Gt(d!=null,"Invalid first pivot index"),Gt(p!=null,"Invalid second pivot index");let f=0;if(u==="keyboard"){{const C=e<0?p:d,w=n[C];Gt(w,`Panel constraints not found for index ${C}`);const{collapsedSize:b=0,collapsible:x,minSize:_=0}=w;if(x){const y=h[C];if(Gt(y!=null,`Previous layout not found for panel index ${C}`),or(y,b)){const E=_-y;qu(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}{const C=e<0?d:p,w=n[C];Gt(w,`No panel constraints found for index ${C}`);const{collapsedSize:b=0,collapsible:x,minSize:_=0}=w;if(x){const y=h[C];if(Gt(y!=null,`Previous layout not found for panel index ${C}`),or(y,_)){const E=y-b;qu(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}}{const C=e<0?1:-1;let w=e<0?p:d,b=0;for(;;){const _=h[w];Gt(_!=null,`Previous layout not found for panel index ${w}`);const y=kl({panelConstraints:n[w],size:100})-_;if(b+=y,w+=C,w<0||w>=n.length)break}const x=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-x:x}{let C=e<0?d:p;for(;C>=0&&C<n.length;){const w=Math.abs(e)-Math.abs(f),b=h[C];Gt(b!=null,`Previous layout not found for panel index ${C}`);const x=b-w,_=kl({panelConstraints:n[C],size:x});if(!or(b,_)&&(f+=b-_,l[C]=_,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?C--:C++}}if(AN(a,l))return o;{const C=e<0?p:d,w=h[C];Gt(w!=null,`Previous layout not found for panel index ${C}`);const b=w+f,x=kl({panelConstraints:n[C],size:b});if(l[C]=x,!or(x,b)){let _=b-x,y=e<0?p:d;for(;y>=0&&y<n.length;){const E=l[y];Gt(E!=null,`Previous layout not found for panel index ${y}`);const T=E+_,A=kl({panelConstraints:n[y],size:T});if(or(E,A)||(_-=A-E,l[y]=A),or(_,0))break;e>0?y--:y++}}}const g=Object.values(l).reduce((C,w)=>w+C,0);if(!or(g,100,.1))return o;const S=Object.keys(o);return l.reduce((C,w,b)=>(C[S[b]]=w,C),{})}function _c(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||qu(e[n],t[n])!==0)return!1;return!0}function Uk({event:e,hitRegions:t,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:o}){let u=0;const h=new Map(s);t.forEach(a=>{const{group:l,groupSize:d}=a,{disableCursor:p,orientation:f,panels:g}=l;let S=0;o?f==="horizontal"?S=(e.clientX-o.x)/d*100:S=(e.clientY-o.y)/d*100:f==="horizontal"?S=e.clientX<0?-100:100:S=e.clientY<0?-100:100;const C=n.get(l),{defaultLayoutDeferred:w,derivedPanelConstraints:b,layout:x,separatorToPanels:_}=s.get(l)??{defaultLayoutDeferred:!1};if(b&&C&&x&&_){const y=Gu({delta:S,initialLayout:C,panelConstraints:b,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:x,trigger:"mouse-or-touch"});if(_c(y,x)){if(S!==0&&!p)switch(f){case"horizontal":{u|=S<0?zk:Hk;break}case"vertical":{u|=S<0?Fk:Vk;break}}}else{h.set(a.group,{defaultLayoutDeferred:w,derivedPanelConstraints:b,layout:y,separatorToPanels:_});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=y}}}),ls({cursorFlags:u,mountedGroups:h}),ry()}function ZC(e){if(e.defaultPrevented||e.relatedTarget!==null||e.clientX===0&&e.clientY===0)return;const{interactionState:t,mountedGroups:n}=Ys();t.state==="active"&&t.hitRegions.forEach(s=>{e.currentTarget===s.group.element&&Uk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})})}function vh(e){const t=e.parentElement;Gt(t,"Parent group element not found");const{mountedGroups:n}=Ys();for(const[s]of n)if(s.element===t)return s;throw Error("Could not find parent Group for separator element")}function La({layout:e,panelConstraints:t}){const n=[...Object.values(e)],s=n.reduce((h,a)=>h+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(h=>`${h}%`).join(", ")}`);if(!or(s,100)&&n.length>0)for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=100/s*a;n[h]=l}let o=0;for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=kl({panelConstraints:t[h],size:a});a!=l&&(o+=a-l,n[h]=l)}if(!or(o,0))for(let h=0;h<t.length;h++){const a=n[h];Gt(a!=null,`No layout data found for index ${h}`);const l=a+o,d=kl({panelConstraints:t[h],size:l});if(a!==d&&(o-=d-a,n[h]=d,or(o,0)))break}const u=Object.keys(e);return n.reduce((h,a,l)=>(h[u[l]]=a,h),{})}function Wk({groupId:e}){const t=()=>{const{mountedGroups:n}=Ys();for(const[s,o]of n)if(s.id===e)return{group:s,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:s}=t();return n?{}:s},setLayout(n){const{defaultLayoutDeferred:s,derivedPanelConstraints:o,group:u,layout:h,separatorToPanels:a}=t(),l=La({layout:n,panelConstraints:o});return s?h:(_c(h,l)||ls(d=>({mountedGroups:new Map(d.mountedGroups).set(u,{defaultLayoutDeferred:s,derivedPanelConstraints:o,layout:l,separatorToPanels:a})})),l)}}}function qk(e){const{mountedGroups:t}=Ys(),n=t.get(e);return Gt(n,`Mounted Group ${e.id} not found`),n}function Yo(e,t){const n=vh(e),s=qk(n),o=n.separators.find(p=>p.element===e);Gt(o,"Matching separator not found");const u=s.separatorToPanels.get(o);Gt(u,"Matching panels not found");const h=u.map(p=>n.panels.indexOf(p)),a=Wk({groupId:n.id}).getLayout(),l=Gu({delta:t,initialLayout:a,panelConstraints:s.derivedPanelConstraints,pivotIndices:h,prevLayout:a,trigger:"keyboard"}),d=La({layout:l,panelConstraints:s.derivedPanelConstraints});_c(a,d)||ls(p=>({mountedGroups:new Map(p.mountedGroups).set(n,{defaultLayoutDeferred:s.defaultLayoutDeferred,derivedPanelConstraints:s.derivedPanelConstraints,layout:d,separatorToPanels:s.separatorToPanels})}))}function JC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=vh(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Yo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Yo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Yo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Yo(t,-5);break}case"End":{e.preventDefault(),Yo(t,100);break}case"Enter":{e.preventDefault();const s=vh(t),{derivedPanelConstraints:o,layout:u,separatorToPanels:h}=qk(s),a=s.separators.find(f=>f.element===t);Gt(a,"Matching separator not found");const l=h.get(a);Gt(l,"Matching panels not found");const d=l[0],p=o.find(f=>f.panelId===d.id);if(Gt(p,"Panel metadata not found"),p.collapsible){const f=u[d.id],g=p.collapsedSize===f?s.inMemoryLastExpandedPanelSizes[d.id]??p.minSize:p.collapsedSize;Yo(t,g-f)}break}case"F6":{e.preventDefault();const s=vh(t).separators.map(h=>h.element),o=Array.from(s).findIndex(h=>h===e.currentTarget);Gt(o!==null,"Index not found");const u=e.shiftKey?o>0?o-1:s.length-1:o+1<s.length?o+1:0;s[u].focus();break}case"Home":{e.preventDefault(),Yo(t,-100);break}}}function ON(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=Nk(n,u.rect);switch(e){case"horizontal":{h.x<=o.x&&(s=u,o=h);break}case"vertical":{h.y<=o.y&&(s=u,o=h);break}}}return s?{distance:o,hitRegion:s}:void 0}let rh;function MN(){return rh===void 0&&(typeof matchMedia=="function"?rh=!!matchMedia("(pointer:coarse)").matches:rh=!1),rh}function DN(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:nw(e),b:nw(t)};let s;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),s=e;Gt(s,"Stacking order can only be calculated for elements with a common ancestor");const o={a:tw(ew(n.a)),b:tw(ew(n.b))};if(o.a===o.b){const u=s.childNodes,h={a:n.a.at(-1),b:n.b.at(-1)};let a=u.length;for(;a--;){const l=u[a];if(l===h.a)return 1;if(l===h.b)return-1}}return Math.sign(o.a-o.b)}const PN=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function jN(e){const t=getComputedStyle(Gk(e)??e).display;return t==="flex"||t==="inline-flex"}function IN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||jN(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||PN.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function ew(e){let t=e.length;for(;t--;){const n=e[t];if(Gt(n,"Missing node"),IN(n))return n}return null}function tw(e){return e&&Number(getComputedStyle(e).zIndex)||0}function nw(e){const t=[];for(;e;)t.push(e),e=Gk(e);return t}function Gk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function NN(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function BN({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(DN(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(NN(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function $k(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=MN()?QC.coarse:QC.precise,h=Bk(o),a=ON(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&BN({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function rw(e){if(e.defaultPrevented)return;const{mountedGroups:t}=Ys(),n=$k(e,t),s=new Set,o=new Set,u=new Set,h=new Map;let a=!1;n.forEach(l=>{s.add(l.group),l.panels.forEach(p=>{o.add(p)}),l.separator&&(u.add(l.separator),a||(a=!0,l.separator.element.focus()));const d=t.get(l.group);d&&h.set(l.group,d.layout)}),ls({interactionState:{hitRegions:n,initialLayoutMap:h,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function sw(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Ys();switch(t.state){case"active":{if(e.type!=="pointerleave"&&e.buttons===0){ls(s=>s.interactionState.state==="inactive"?s:{cursorFlags:0,interactionState:{state:"inactive"}});return}Uk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=$k(e,n);s.length===0?t.state!=="inactive"&&ls({interactionState:{state:"inactive"}}):ls({interactionState:{hitRegions:s,state:"hover"}}),ry();break}}}function iw(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=Ys();t.state==="active"&&(ls({cursorFlags:0,interactionState:{state:"inactive"}}),ry())}function ow(e){let t=0,n=0;const s={};for(const u of e)if(u.defaultSize!==void 0){t++;const h=Cs(u.defaultSize);n+=h,s[u.panelId]=h}else s[u.panelId]=void 0;const o=e.length-t;if(o!==0){const u=Cs((100-n)/o);for(const h of e)h.defaultSize===void 0&&(s[h.panelId]=u)}return s}function zN(e,t,n){const s=n[0];if(!s)return;const o=e.panels.find(h=>h.element===t);if(!o||!o.onResize)return;const u=Xl({group:e});o.onResize({asPercentage:Cs(s.inlineSize/u*100),inPixels:s.inlineSize},o.id)}function HN(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function FN(e){let t=!0;const n=new Set,s=new Set,o=new ResizeObserver(S=>{for(const C of S){const{borderBoxSize:w,target:b}=C;if(b===e.element){if(t){if(Xl({group:e})===0)return;ls(x=>{const _=x.mountedGroups.get(e);if(_){const y=XC(e),E=_.defaultLayoutDeferred?ow(y):_.layout,T=La({layout:E,panelConstraints:y});return!_.defaultLayoutDeferred&&_c(E,T)&&HN(_.derivedPanelConstraints,y)?x:{mountedGroups:new Map(x.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:y,layout:T,separatorToPanels:_.separatorToPanels})}}return x})}}else zN(e,b,w)}});o.observe(e.element),e.panels.forEach(S=>{Gt(!n.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),n.add(S.id),S.onResize&&o.observe(S.element)});const u=Xl({group:e}),h=XC(e),a=e.panels.map(({id:S})=>S).join(",");let l=e.defaultLayout;l&&e.panels.length!==Object.keys(l).length&&(l=void 0);const d=e.inMemoryLayouts[a]??l??ow(h),p=La({layout:d,panelConstraints:h}),f=Bk(e),g=ls(S=>{const C=new Map;return f.forEach(w=>{w.separator&&C.set(w.separator,w.panels)}),{mountedGroups:new Map(S.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:h,layout:p,separatorToPanels:C})}});return e.element.addEventListener("pointerleave",ZC),e.separators.forEach(S=>{Gt(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",JC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",rw),window.addEventListener("pointermove",sw),window.addEventListener("pointerup",iw)),function(){t=!1;const S=ls(C=>{const w=new Map(C.mountedGroups);return w.delete(e),{mountedGroups:w}});e.element.removeEventListener("pointerleave",ZC),e.separators.forEach(C=>{C.element.removeEventListener("keydown",JC)}),S.mountedGroups.size===0&&(window.removeEventListener("pointerdown",rw),window.removeEventListener("pointermove",sw),window.removeEventListener("pointerup",iw)),o.disconnect()}}function sy(e){const t=R.useId();return`${e??t}`}const za=typeof window<"u"?R.useLayoutEffect:R.useEffect;function iy(e){const t=R.useRef(e);return za(()=>{t.current=e},[e]),R.useCallback(n=>t.current?.(n),[t])}function oy(...e){return iy(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function VN(e){const t=R.useRef({...e});return za(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Kk="--react-resizable-panels--panel--pointer-events";function Yk(e,t){const n=e.replace(/[^a-zA-Z0-9\-_]/g,""),s=t.replace(/[^a-zA-Z0-9\-_]/g,"");return`--react-resizable-panels--${n}--${s}`}const Xk=R.createContext(null);function UN(e,t){const n=R.useRef({getLayout:()=>({}),setLayout:TN});R.useImperativeHandle(t,()=>n.current,[]),za(()=>{Object.assign(n.current,Wk({groupId:e}))})}function WN({children:e,className:t,defaultLayout:n,disableCursor:s,disabled:o,elementRef:u,groupRef:h,id:a,onLayoutChange:l,orientation:d="horizontal",style:p,...f}){const g=R.useRef({}),S=iy(K=>{_c(g.current,K)||(g.current=K,l?.(K))}),C=sy(a),[w,b]=R.useState(!1),[x,_]=R.useState(null),[y,E]=R.useState(n??{}),[T,A]=R.useState([]),[M,L]=R.useState([]),D=R.useRef({lastExpandedPanelSizes:{},layouts:{}}),z=oy(_,u);UN(C,h);const H=R.useMemo(()=>({id:C,orientation:d,registerPanel:K=>(A(V=>R_(d,[...V,K])),()=>{A(V=>V.filter(Y=>Y!==K))}),registerSeparator:K=>(L(V=>R_(d,[...V,K])),()=>{L(V=>V.filter(Y=>Y!==K))})}),[C,d]),$=VN({defaultLayout:n,disableCursor:s}),N=R.useRef(null);za(()=>{if(x===null)return;const K={defaultLayout:$.defaultLayout,disableCursor:!!$.disableCursor,disabled:!!o,element:x,id:C,inMemoryLastExpandedPanelSizes:D.current.lastExpandedPanelSizes,inMemoryLayouts:D.current.layouts,orientation:d,panels:T,separators:M};N.current=K;const V=FN(K),Y=Ys().mountedGroups.get(K);if(Y){const{defaultLayoutDeferred:W,derivedPanelConstraints:P,layout:I}=Y;!W&&P.length>0&&(E(I),S?.(I))}const G=xa.addListener("interactionStateChange",W=>{W.state==="active"?b(W.hitRegions.some(P=>P.group===K)):b(!1)}),j=xa.addListener("mountedGroupsChange",W=>{const P=W.get(K);if(P){const{defaultLayoutDeferred:I,derivedPanelConstraints:F,layout:X}=P;if(I||F.length===0)return;E(X),S?.(X)}});return()=>{N.current=null,V(),G(),j()}},[o,x,C,S,d,T,M,$]),R.useEffect(()=>{const K=N.current;K&&(K.defaultLayout=n,K.disableCursor=!!s)});const q={[Kk]:w?"none":void 0};for(const K in y){const V=Yk(C,K),Y=y[K];q[V]=Y}return v.jsx(Xk.Provider,{value:H,children:v.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":C,id:C,ref:z,style:{...p,...q,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function ay(){const e=R.useContext(Xk);return Gt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function qN({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Ys();for(const[l,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,separatorToPanels:g}]of a)if(l.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:l,layout:f,separatorToPanels:g};throw Error(`Group ${e} not found`)},s=()=>{const a=n().derivedPanelConstraints.find(l=>l.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(l=>l.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},u=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},h=a=>{const l=u();if(a===l)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,layout:g,separatorToPanels:S}=n(),C=f.panels.findIndex(_=>_.id===t),w=C===f.panels.length-1,b=Gu({delta:w?l-a:a-l,initialLayout:g,panelConstraints:p,pivotIndices:w?[C-1,C]:[C,C+1],prevLayout:g,trigger:"imperative-api"}),x=La({layout:b,panelConstraints:p});_c(g,x)||ls(_=>({mountedGroups:new Map(_.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:x,separatorToPanels:S})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:l}=s(),d=u();a&&d!==l&&h(l)},expand:()=>{const{collapsible:a,collapsedSize:l,minSize:d}=s(),p=u();a&&p===l&&h(d)},getSize:()=>{const{group:a}=n(),l=u(),{element:d}=o(),p=a.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:l,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:l}=s(),d=u();return a&&or(l,d)},resize:a=>{if(u()!==a){let l;switch(typeof a){case"number":{const{group:d}=n(),p=Xl({group:d});l=Cs(a/p*100);break}case"string":{l=parseFloat(a);break}}h(l)}}}}function GN(e,t){const{id:n}=ay(),s=R.useRef({collapse:kv,expand:kv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:kv});R.useImperativeHandle(t,()=>s.current,[]),za(()=>{Object.assign(s.current,qN({groupId:n,panelId:e}))})}function $N({children:e,className:t,collapsedSize:n="0%",collapsible:s=!1,defaultSize:o,elementRef:u,id:h,maxSize:a="100%",minSize:l="0%",onResize:d,panelRef:p,style:f,...g}){const S=!!h,C=sy(h),[w,b]=R.useState(null),x=oy(b,u),{id:_,registerPanel:y}=ay(),E=d!==null,T=iy(M=>{d?.(M,h)});za(()=>{if(w!==null)return y({element:w,id:C,idIsStable:S,onResize:E?T:void 0,panelConstraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:a,minSize:l}})},[n,s,o,w,E,C,S,a,l,T,y]),GN(C,p);const A=Yk(_,C);return v.jsx("div",{...g,"data-panel":!0,"data-testid":C,id:C,ref:x,style:{...KN,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${Kk})`},children:v.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const KN={minHeight:"unset",maxHeight:"unset",height:"unset",minWidth:"unset",maxWidth:"unset",width:"unset",flex:"unset",flexBasis:"unset",flexShrink:"unset",flexGrow:"unset",border:"unset",borderWidth:"unset",padding:"unset",margin:"unset"};function YN({layout:e,panelConstraints:t,panelId:n,panelIndex:s}){let o,u;const h=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,d=u=a.collapsible?a.collapsedSize:a.minSize,p=[s,s+1];u=La({layout:Gu({delta:d-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=La({layout:Gu({delta:l-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:u,valueNow:h}}function XN({children:e,className:t,elementRef:n,id:s,style:o,...u}){const h=sy(s),[a,l]=R.useState({}),[d,p]=R.useState("inactive"),[f,g]=R.useState(null),S=oy(g,n),{id:C,orientation:w,registerSeparator:b}=ay(),x=w==="horizontal"?"vertical":"horizontal";return za(()=>{if(f!==null){const _={element:f,id:h},y=b(_),E=xa.addListener("interactionStateChange",A=>{p(A.state!=="inactive"&&A.hitRegions.some(M=>M.separator===_)?A.state:"inactive")}),T=xa.addListener("mountedGroupsChange",A=>{A.forEach(({derivedPanelConstraints:M,layout:L,separatorToPanels:D},z)=>{if(z.id===C){const H=D.get(_);if(H){const $=H[0],N=z.panels.indexOf($);l(YN({layout:L,panelConstraints:M,panelId:$.id,panelIndex:N}))}}})});return()=>{E(),T(),y()}}},[f,C,h,b]),v.jsx("div",{...u,"aria-controls":a.valueControls,"aria-orientation":x,"aria-valuemax":a.valueMax,"aria-valuemin":a.valueMin,"aria-valuenow":a.valueNow,children:e,className:t,"data-separator":d,"data-testid":h,id:h,ref:S,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}function ta({className:e,direction:t,...n}){return v.jsx(WN,{"data-slot":"resizable-panel-group",orientation:t,className:Be("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function ts({...e}){return v.jsx($N,{"data-slot":"resizable-panel",...e})}function na({withHandle:e,className:t,...n}){return v.jsx(XN,{"data-slot":"resizable-handle",className:Be("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 [&[data-orientation=vertical]>div]:rotate-90",t),...n,children:e&&v.jsx("div",{className:"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"})})}var Lv={exports:{}},aw;function QN(){return aw||(aw=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(h,a,l){var d=this&&this.__decorate||function(_,y,E,T){var A,M=arguments.length,L=M<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,y,E,T);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(L=(M<3?A(L):M>3?A(y,E,L):A(y,E))||L);return M>3&&L&&Object.defineProperty(y,E,L),L},p=this&&this.__param||function(_,y){return function(E,T){y(E,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=l(9042),g=l(9924),S=l(844),C=l(4725),w=l(2585),b=l(3656);let x=a.AccessibilityManager=class extends S.Disposable{constructor(_,y,E,T){super(),this._terminal=_,this._coreBrowserService=E,this._renderService=T,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
27
+ `)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let y=0;y<_;y++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
28
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,y){this._liveRegionDebouncer.refresh(_,y,this._terminal.rows)}_renderRows(_,y){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=_;A<=y;A++){const M=E.lines.get(E.ydisp+A),L=[],D=M?.translateToString(!0,void 0,void 0,L)||"",z=(E.ydisp+A+1).toString(),H=this._rowElements[A];H&&(D.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=D,this._rowColumns.set(H,L)),H.setAttribute("aria-posinset",z),H.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,y){const E=_.target,T=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==T)return;let A,M;if(y===0?(A=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(A=this._rowElements.shift(),M=E,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:_.anchorNode,offset:_.anchorOffset},E={node:_.focusNode,offset:_.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const T=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:T,offset:T.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const A=({node:D,offset:z})=>{const H=D instanceof Text?D.parentNode:D;let $=parseInt(H?.getAttribute("aria-posinset"),10)-1;if(isNaN($))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(H);if(!N)return console.warn("columns is null. Race condition?"),null;let q=z<N.length?N[z]:N.slice(-1)[0]+1;return q>=this._terminal.cols&&(++$,q=0),{row:$,column:q}},M=A(y),L=A(E);if(M&&L){if(M.row>L.row||M.row===L.row&&M.column>=L.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(L.row-M.row)*this._terminal.cols-M.column+L.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=x=d([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],x)},3614:(h,a)=>{function l(g){return g.replace(/\r?\n/g,"\r")}function d(g,S){return S?"\x1B[200~"+g+"\x1B[201~":g}function p(g,S,C,w){g=d(g=l(g),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),S.value=""}function f(g,S,C){const w=C.getBoundingClientRect(),b=g.clientX-w.left-10,x=g.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${b}px`,S.style.top=`${x}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=l,a.bracketTextForPaste=d,a.copyHandler=function(g,S){g.clipboardData&&g.clipboardData.setData("text/plain",S.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,S,C,w){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),S,C,w)},a.paste=p,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(g,S,C,w,b){f(g,S,C),b&&w.rightClickSelect(g),S.value=w.selectionText,S.select()}},7239:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=l(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,f,g){this._css.set(p,f,g)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,g){this._color.set(p,f,g)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,d,p,f){l.addEventListener(d,p,f);let g=!1;return{dispose:()=>{g||(g=!0,l.removeEventListener(d,p,f))}}}},3551:function(h,a,l){var d=this&&this.__decorate||function(x,_,y,E){var T,A=arguments.length,M=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(_,y,M):T(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,E){_(y,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=l(3656),g=l(8460),S=l(844),C=l(2585),w=l(4725);let b=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(x,_,y,E,T){super(),this._element=x,this._mouseService=_,this._renderService=y,this._bufferService=E,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(x){this._lastMouseEvent=x;const _=this._positionFromMouseEvent(x,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const y=x.composedPath();for(let E=0;E<y.length;E++){const T=y[E];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(x){if(this._activeLine!==x.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(x,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,x)||(this._clearCurrentLink(),this._askForLink(x,!0))}_askForLink(x,_){this._activeProviderReplies&&_||(this._activeProviderReplies?.forEach((E=>{E?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=x.y);let y=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())_?this._activeProviderReplies?.get(E)&&(y=this._checkLinkProviderResult(E,x,y)):T.provideLinks(x.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),y=this._checkLinkProviderResult(E,x,y),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(x.y,this._activeProviderReplies)}))}_removeIntersectingLinks(x,_){const y=new Set;for(let E=0;E<_.size;E++){const T=_.get(E);if(T)for(let A=0;A<T.length;A++){const M=T[A],L=M.link.range.start.y<x?0:M.link.range.start.x,D=M.link.range.end.y>x?this._bufferService.cols:M.link.range.end.x;for(let z=L;z<=D;z++){if(y.has(z)){T.splice(A--,1);break}y.add(z)}}}}_checkLinkProviderResult(x,_,y){if(!this._activeProviderReplies)return y;const E=this._activeProviderReplies.get(x);let T=!1;for(let A=0;A<x;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(T=!0);if(!T&&E){const A=E.find((M=>this._linkAtPosition(M.link,_)));A&&(y=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,_)));if(M){y=!0,this._handleNewLink(M);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(x){if(!this._currentLink)return;const _=this._positionFromMouseEvent(x,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(x,this._currentLink.link.text)}_clearCurrentLink(x,_){this._currentLink&&this._lastMouseEvent&&(!x||!_||this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(x){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(x.link,_)&&(this._currentLink=x,this._currentLink.state={decorations:{underline:x.link.decorations===void 0||x.link.decorations.underline,pointerCursor:x.link.decorations===void 0||x.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,x.link,this._lastMouseEvent),x.link.decorations={},Object.defineProperties(x.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:y=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:y=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(x.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(E,T),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(x,_,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&x.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(y,_.text)}_fireUnderlineEvent(x,_){const y=x.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(x,_,y){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&x.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(y,_.text)}_linkAtPosition(x,_){const y=x.range.start.y*this._bufferService.cols+x.range.start.x,E=x.range.end.y*this._bufferService.cols+x.range.end.x,T=_.y*this._bufferService.cols+_.x;return y<=T&&T<=E}_positionFromMouseEvent(x,_,y){const E=y.getCoords(x,_,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(x,_,y,E,T){return{x1:x,y1:_,x2:y,y2:E,cols:this._bufferService.cols,fg:T}}};a.Linkifier=b=d([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],b)},9042:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(h,a,l){var d=this&&this.__decorate||function(w,b,x,_){var y,E=arguments.length,T=E<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,b,x,_);else for(var A=w.length-1;A>=0;A--)(y=w[A])&&(T=(E<3?y(T):E>3?y(b,x,T):y(b,x))||T);return E>3&&T&&Object.defineProperty(b,x,T),T},p=this&&this.__param||function(w,b){return function(x,_){b(x,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=l(511),g=l(2585);let S=a.OscLinkProvider=class{constructor(w,b,x){this._bufferService=w,this._optionsService=b,this._oscLinkService=x}provideLinks(w,b){const x=this._bufferService.buffer.lines.get(w-1);if(!x)return void b(void 0);const _=[],y=this._optionsService.rawOptions.linkHandler,E=new f.CellData,T=x.getTrimmedLength();let A=-1,M=-1,L=!1;for(let D=0;D<T;D++)if(M!==-1||x.hasContent(D)){if(x.loadCell(D,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=D,A=E.extended.urlId;continue}L=E.extended.urlId!==A}else M!==-1&&(L=!0);if(L||M!==-1&&D===T-1){const z=this._oscLinkService.getLinkData(A)?.uri;if(z){const H={start:{x:M+1,y:w},end:{x:D+(L||D!==T-1?0:1),y:w}};let $=!1;if(!y?.allowNonHttpProtocols)try{const N=new URL(z);["http:","https:"].includes(N.protocol)||($=!0)}catch{$=!0}$||_.push({text:z,range:H,activate:(N,q)=>y?y.activate(N,q,H):C(0,q),hover:(N,q)=>y?.hover?.(N,q,H),leave:(N,q)=>y?.leave?.(N,q,H)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=D,A=E.extended.urlId):(M=-1,A=-1)}}b(_)}};function C(w,b){if(confirm(`Do you want to navigate to ${b}?
29
+
30
+ WARNING: This link could potentially be dangerous`)){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=S=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],S)},6193:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,d){this._renderCallback=l,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,d,p){this._rowCount=p,l=l!==void 0?l:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=l(3614),p=l(3656),f=l(3551),g=l(9042),S=l(3730),C=l(1680),w=l(3107),b=l(5744),x=l(2950),_=l(1296),y=l(428),E=l(4269),T=l(5114),A=l(8934),M=l(3230),L=l(9312),D=l(4725),z=l(6731),H=l(8055),$=l(8969),N=l(8460),q=l(844),K=l(6114),V=l(8437),Y=l(2584),G=l(7399),j=l(5941),W=l(9074),P=l(2585),I=l(5435),F=l(4567),X=l(779);class te extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(W.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,se)=>this.refresh(U,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,q.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const U of Q){let se,ne="";switch(U.index){case 256:se="foreground",ne="10";break;case 257:se="background",ne="11";break;case 258:se="cursor",ne="12";break;default:se="ansi",ne="4;"+U.index}switch(U.type){case 0:const re=H.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${ne};${(0,j.toRgbString)(re)}${Y.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((oe=>oe.ansi[U.index]=H.channels.toColor(...U.color)));else{const oe=se;this._themeService.modifyColors((le=>le[oe]=H.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.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(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(Q);if(!U)return;const se=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,re=U.getWidth(se),oe=this._renderService.dimensions.css.cell.width*re,le=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=le+"px",this.textarea.style.width=oe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,d.copyHandler)(U,this._selectionService)})));const Q=U=>(0,d.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Q)),K.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,d.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,d.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,d.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.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"),Q.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(T.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(z.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(x.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(L.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,U=this.element;function se(oe){const le=Q._mouseService.getMouseReportCoords(oe,Q.screenElement);if(!le)return!1;let _e,ge;switch(oe.overrideType||oe.type){case"mousemove":ge=32,oe.buttons===void 0?(_e=3,oe.button!==void 0&&(_e=oe.button<3?oe.button:3)):_e=1&oe.buttons?0:4&oe.buttons?1:2&oe.buttons?2:3;break;case"mouseup":ge=0,_e=oe.button<3?oe.button:3;break;case"mousedown":ge=1,_e=oe.button<3?oe.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(oe)===!1||Q.viewport.getLinesScrolled(oe)===0)return!1;ge=oe.deltaY<0?0:1,_e=4;break;default:return!1}return!(ge===void 0||_e===void 0||_e>4)&&Q.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:ge,ctrl:oe.ctrlKey,alt:oe.altKey,shift:oe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:oe=>(se(oe),oe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(oe)),wheel:oe=>(se(oe),this.cancel(oe,!0)),mousedrag:oe=>{oe.buttons&&se(oe)},mousemove:oe=>{oe.buttons||se(oe)}};this.register(this.coreMouseService.onProtocolChange((oe=>{oe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(oe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&oe?ne.mousemove||(U.addEventListener("mousemove",re.mousemove),ne.mousemove=re.mousemove):(U.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&oe?ne.wheel||(U.addEventListener("wheel",re.wheel,{passive:!1}),ne.wheel=re.wheel):(U.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&oe?ne.mouseup||(ne.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&oe?ne.mousedrag||(ne.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(U,"mousedown",(oe=>{if(oe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(oe))return se(oe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(oe)}))),this.register((0,p.addDisposableDomListener)(U,"wheel",(oe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(oe)===!1)return!1;if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(oe);if(le===0)return;const _e=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ge="";for(let ue=0;ue<Math.abs(le);ue++)ge+=_e;return this.coreService.triggerDataEvent(ge,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(U,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(U,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(Q,U){this._renderService?.refreshRows(Q,U)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?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(Q,U,se=0){se===1?(super.scrollLines(Q,U,se),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,d.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,U,se){this._selectionService.setSelection(Q,U,se)}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(Q,U){this._selectionService?.selectLines(Q,U)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!U&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,G.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),se.type===3||se.type===2){const ne=this.rows-1;return this.scrollLines(se.type===2?-ne:ne),this.cancel(Q,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(se.cancel&&this.cancel(Q,!0),!se.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==Y.C0.ETX&&se.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,U){const se=Q.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||Q.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||Q.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?se:se&&(!U.keyCode||U.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)U=Q.charCode;else if(Q.which===null||Q.which===void 0)U=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;U=Q.which}return!(!U||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=Q.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(Q),!0}return!1}resize(Q,U){Q!==this.cols||U!==this.rows?super.resize(Q,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,U){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}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 Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case I.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${se};${U}t`);break;case I.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${re};${ne}t`)}}cancel(Q,U){if(this.options.cancelEvents||U)return Q.preventDefault(),Q.stopPropagation(),!1}}a.Terminal=te},9924:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,d=1e3){this._renderCallback=l,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,d,p){this._rowCount=p,l=l!==void 0?l:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,S=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,d)}}},1680:function(h,a,l){var d=this&&this.__decorate||function(x,_,y,E){var T,A=arguments.length,M=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(_,y,M):T(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,E){_(y,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=l(3656),g=l(4725),S=l(8460),C=l(844),w=l(2585);let b=a.Viewport=class extends C.Disposable{constructor(x,_,y,E,T,A,M,L){super(),this._viewportElement=x,this._scrollArea=_,this._bufferService=y,this._optionsService=E,this._charSizeService=T,this._renderService=A,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(L.colors),this.register(L.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(x){this._viewportElement.style.backgroundColor=x.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(x){if(x)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const x=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==x&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=x),this._refreshAnimationFrame=null}syncScrollArea(x=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(x);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(x)}_handleScroll(x){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const x=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(x*(this._smoothScrollState.target-this._smoothScrollState.origin)),x<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(x,_){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&y<this._lastRecordedBufferHeight)||(x.cancelable&&x.preventDefault(),!1)}handleWheel(x){const _=this._getPixelsScrolled(x);return _!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(x,_))}scrollLines(x){if(x!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=x*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!1})}_getPixelsScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let _=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(x,_){let y,E="";const T=[],A=_??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=x;L<A;L++){const D=M.get(L);if(!D)continue;const z=M.get(L+1)?.isWrapped;if(E+=D.translateToString(!z),!z||L===M.length-1){const H=document.createElement("div");H.textContent=E,T.push(H),E.length>0&&(y=H),E=""}}return{bufferElements:T,cursorElement:y}}getLinesScrolled(x){if(x.deltaY===0||x.shiftKey)return 0;let _=this._applyScrollModifier(x.deltaY,x);return x.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):x.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(x,_){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&_.altKey||y==="ctrl"&&_.ctrlKey||y==="shift"&&_.shiftKey?x*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:x*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(x){this._lastTouchY=x.touches[0].pageY}handleTouchMove(x){const _=this._lastTouchY-x.touches[0].pageY;return this._lastTouchY=x.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(x,_))}};a.Viewport=b=d([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],b)},3107:function(h,a,l){var d=this&&this.__decorate||function(w,b,x,_){var y,E=arguments.length,T=E<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,b,x,_);else for(var A=w.length-1;A>=0;A--)(y=w[A])&&(T=(E<3?y(T):E>3?y(b,x,T):y(b,x))||T);return E>3&&T&&Object.defineProperty(b,x,T),T},p=this&&this.__param||function(w,b){return function(x,_){b(x,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=l(4725),g=l(844),S=l(2585);let C=a.BufferDecorationRenderer=class extends g.Disposable{constructor(w,b,x,_,y){super(),this._screenElement=w,this._bufferService=b,this._coreBrowserService=x,this._decorationService=_,this._renderService=y,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((E=>this._removeDecoration(E)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),b.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const x=w.options.x??0;return x&&x>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(w,b),b}_refreshStyle(w){const b=w.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let x=this._decorationElements.get(w);x||(x=this._createElement(w),w.element=x,this._decorationElements.set(w,x),this._container.appendChild(x),w.onDispose((()=>{this._decorationElements.delete(w),x.remove()}))),x.style.top=b*this._renderService.dimensions.css.cell.height+"px",x.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(x)}}_refreshXPosition(w,b=w.element){if(!b)return;const x=w.options.x??0;(w.options.anchor||"left")==="right"?b.style.right=x?x*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=x?x*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){this._decorationElements.get(w)?.remove(),this._decorationElements.delete(w),w.dispose()}};a.BufferDecorationRenderer=C=d([p(1,S.IBufferService),p(2,f.ICoreBrowserService),p(3,S.IDecorationService),p(4,f.IRenderService)],C)},5871:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const d of this._zones)if(d.color===l.options.overviewRulerOptions.color&&d.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,l.marker.line))return;if(this._lineAdjacentToZone(d,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(d,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,d){return d>=l.startBufferLine&&d<=l.endBufferLine}_lineAdjacentToZone(l,d,p){return d>=l.startBufferLine-this._linePadding[p||"full"]&&d<=l.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(l,d){l.startBufferLine=Math.min(l.startBufferLine,d),l.endBufferLine=Math.max(l.endBufferLine,d)}}},5744:function(h,a,l){var d=this&&this.__decorate||function(y,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,E,T,A);else for(var z=y.length-1;z>=0;z--)(M=y[z])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(y,E){return function(T,A){E(T,A,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=l(5871),g=l(4725),S=l(844),C=l(2585),w={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0};let _=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,T,A,M,L,D){super(),this._viewportElement=y,this._screenElement=E,this._bufferService=T,this._decorationService=A,this._renderService=M,this._optionsService=L,this._coreBrowserService=D,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const z=this._canvas.getContext("2d");if(!z)throw new Error("Ctx cannot be null");this._ctx=z,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),x.full=0,x.left=0,x.center=b.left,x.right=b.left+b.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(x[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-w[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=_=d([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,g.IRenderService),p(5,C.IOptionsService),p(6,g.ICoreBrowserService)],_)},2950:function(h,a,l){var d=this&&this.__decorate||function(w,b,x,_){var y,E=arguments.length,T=E<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,b,x,_);else for(var A=w.length-1;A>=0;A--)(y=w[A])&&(T=(E<3?y(T):E>3?y(b,x,T):y(b,x))||T);return E>3&&T&&Object.defineProperty(b,x,T),T},p=this&&this.__param||function(w,b){return function(x,_){b(x,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=l(4725),g=l(2585),S=l(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,b,x,_,y,E){this._textarea=w,this._compositionView=b,this._bufferService=x,this._optionsService=_,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let x;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,x=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),x.length>0&&this._coreService.triggerDataEvent(x,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,x=b.replace(w,"");this._dataAlreadySent=x,b.length>w.length?this._coreService.triggerDataEvent(x,!0):b.length<w.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):b.length===w.length&&b!==w&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),x=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=x+"px",this._compositionView.style.lineHeight=x+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,f.IRenderService)],C)},9806:(h,a)=>{function l(d,p,f){const g=f.getBoundingClientRect(),S=d.getComputedStyle(f),C=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[p.clientX-g.left-C,p.clientY-g.top-w]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(d,p,f,g,S,C,w,b,x){if(!C)return;const _=l(d,p,f);return _?(_[0]=Math.ceil((_[0]+(x?w/2:0))/w),_[1]=Math.ceil(_[1]/b),_[0]=Math.min(Math.max(_[0],1),g+(x?1:0)),_[1]=Math.min(Math.max(_[1],1),S),_):void 0}},9504:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=l(2584);function p(b,x,_,y){const E=b-f(b,_),T=x-f(x,_),A=Math.abs(E-T)-(function(M,L,D){let z=0;const H=M-f(M,D),$=L-f(L,D);for(let N=0;N<Math.abs(H-$);N++){const q=g(M,L)==="A"?-1:1;D.buffer.lines.get(H+q*N)?.isWrapped&&z++}return z})(b,x,_);return w(A,C(g(b,x),y))}function f(b,x){let _=0,y=x.buffer.lines.get(b),E=y?.isWrapped;for(;E&&b>=0&&b<x.rows;)_++,y=x.buffer.lines.get(--b),E=y?.isWrapped;return _}function g(b,x){return b>x?"A":"B"}function S(b,x,_,y,E,T){let A=b,M=x,L="";for(;A!==_||M!==y;)A+=E?1:-1,E&&A>T.cols-1?(L+=T.buffer.translateBufferLineToString(M,!1,b,A),A=0,b=0,M++):!E&&A<0&&(L+=T.buffer.translateBufferLineToString(M,!1,0,b+1),A=T.cols-1,b=A,M--);return L+T.buffer.translateBufferLineToString(M,!1,b,A)}function C(b,x){const _=x?"O":"[";return d.C0.ESC+_+b}function w(b,x){b=Math.floor(b);let _="";for(let y=0;y<b;y++)_+=x;return _}a.moveToCellSequence=function(b,x,_,y){const E=_.buffer.x,T=_.buffer.y;if(!_.buffer.hasScrollback)return(function(L,D,z,H,$,N){return p(D,H,$,N).length===0?"":w(S(L,D,L,D-f(D,$),!1,$).length,C("D",N))})(E,T,0,x,_,y)+p(T,x,_,y)+(function(L,D,z,H,$,N){let q;q=p(D,H,$,N).length>0?H-f(H,$):D;const K=H,V=(function(Y,G,j,W,P,I){let F;return F=p(j,W,P,I).length>0?W-f(W,P):G,Y<j&&F<=W||Y>=j&&F<W?"C":"D"})(L,D,z,H,$,N);return w(S(L,q,z,K,V==="C",$).length,C(V,N))})(E,T,b,x,_,y);let A;if(T===x)return A=E>b?"D":"C",w(Math.abs(E-b),C(A,y));A=T>x?"D":"C";const M=Math.abs(T-x);return w((function(L,D){return D.cols-L})(T>x?b:E,_)+(M-1)*_.cols+1+((T>x?E:b)-1),C(A,y))}},1296:function(h,a,l){var d=this&&this.__decorate||function(N,q,K,V){var Y,G=arguments.length,j=G<3?q:V===null?V=Object.getOwnPropertyDescriptor(q,K):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(N,q,K,V);else for(var W=N.length-1;W>=0;W--)(Y=N[W])&&(j=(G<3?Y(j):G>3?Y(q,K,j):Y(q,K))||j);return G>3&&j&&Object.defineProperty(q,K,j),j},p=this&&this.__param||function(N,q){return function(K,V){q(K,V,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=l(3787),g=l(2550),S=l(2223),C=l(6171),w=l(6052),b=l(4725),x=l(8055),_=l(8460),y=l(844),E=l(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",D="xterm-focus",z="xterm-selection";let H=1,$=a.DomRenderer=class extends y.Disposable{constructor(N,q,K,V,Y,G,j,W,P,I,F,X,te){super(),this._terminal=N,this._document=q,this._element=K,this._screenElement=V,this._viewportElement=Y,this._helperContainer=G,this._linkifier2=j,this._charSizeService=P,this._optionsService=I,this._bufferService=F,this._coreBrowserService=X,this._themeService=te,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(A),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(z),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,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(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${A} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${A} .xterm-dim { color: ${x.color.multiplyOpacity(N.foreground,.5).css};}`,q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;q+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${V} { 50% { box-shadow: none; }}`,q+=`@keyframes ${Y} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,q+=`${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${z} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${z} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${z} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[G,j]of N.ansi.entries())q+=`${this._terminalSelector} .${M}${G} { color: ${j.css}; }${this._terminalSelector} .${M}${G}.xterm-dim { color: ${x.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${L}${G} { background-color: ${j.css}; }`;q+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${x.color.opaque(N.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${x.color.multiplyOpacity(x.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${L}${S.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,q){for(let K=this._rowElements.length;K<=q;K++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,q){this._refreshRowElements(N,q),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(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,q,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,q,K),this.renderRows(0,this._bufferService.rows-1),!N||!q)return;this._selectionRenderModel.update(this._terminal,N,q,K);const V=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,G=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(G>=this._bufferService.rows||j<0)return;const W=this._document.createDocumentFragment();if(K){const P=N[0]>q[0];W.appendChild(this._createSelectionElement(G,P?q[0]:N[0],P?N[0]:q[0],j-G+1))}else{const P=V===G?N[0]:0,I=G===Y?q[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(G,P,I));const F=j-G-1;if(W.appendChild(this._createSelectionElement(G+1,0,this._bufferService.cols,F)),G!==j){const X=Y===j?q[0]:this._bufferService.cols;W.appendChild(this._createSelectionElement(j,0,X))}}this._selectionContainer.appendChild(W)}_createSelectionElement(N,q,K,V=1){const Y=this._document.createElement("div"),G=q*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(K-q);return G+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-G),Y.style.height=V*this.dimensions.css.cell.height+"px",Y.style.top=N*this.dimensions.css.cell.height+"px",Y.style.left=`${G}px`,Y.style.width=`${j}px`,Y}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,q){const K=this._bufferService.buffer,V=K.ybase+K.y,Y=Math.min(K.x,this._bufferService.cols-1),G=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,W=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=N;P<=q;P++){const I=P+K.ydisp,F=this._rowElements[P],X=K.lines.get(I);if(!F||!X)break;F.replaceChildren(...this._rowFactory.createRow(X,I,I===V,j,W,Y,G,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,q,K,V,Y,G){K<0&&(N=0),V<0&&(q=0);const j=this._bufferService.rows-1;K=Math.max(Math.min(K,j),0),V=Math.max(Math.min(V,j),0),Y=Math.min(Y,this._bufferService.cols);const W=this._bufferService.buffer,P=W.ybase+W.y,I=Math.min(W.x,Y-1),F=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,te=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=K;ee<=V;++ee){const Q=ee+W.ydisp,U=this._rowElements[ee],se=W.lines.get(Q);if(!U||!se)break;U.replaceChildren(...this._rowFactory.createRow(se,Q,Q===P,X,te,I,F,this.dimensions.css.cell.width,this._widthCache,G?ee===K?N:0:-1,G?(ee===V?q:Y)-1:-1))}}};a.DomRenderer=$=d([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],$)},3787:function(h,a,l){var d=this&&this.__decorate||function(A,M,L,D){var z,H=arguments.length,$=H<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(A,M,L,D);else for(var N=A.length-1;N>=0;N--)(z=A[N])&&($=(H<3?z($):H>3?z(M,L,$):z(M,L))||$);return H>3&&$&&Object.defineProperty(M,L,$),$},p=this&&this.__param||function(A,M){return function(L,D){M(L,D,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const f=l(2223),g=l(643),S=l(511),C=l(2585),w=l(8055),b=l(4725),x=l(4269),_=l(6171),y=l(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,D,z,H,$){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=D,this._coreService=z,this._decorationService=H,this._themeService=$,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,M,L){this._selectionStart=A,this._selectionEnd=M,this._columnSelectMode=L}createRow(A,M,L,D,z,H,$,N,q,K,V){const Y=[],G=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let W,P=A.getNoBgTrimmedLength();L&&P<H+1&&(P=H+1);let I=0,F="",X=0,te=0,ee=0,Q=!1,U=0,se=!1,ne=0;const re=[],oe=K!==-1&&V!==-1;for(let le=0;le<P;le++){A.loadCell(le,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let ge=!1,ue=le,de=this._workCell;if(G.length>0&&le===G[0][0]){ge=!0;const Se=G.shift();de=new x.JoinedCellData(this._workCell,A.translateToString(!0,Se[0],Se[1]),Se[1]-Se[0]),ue=Se[1]-1,_e=de.getWidth()}const Ie=this._isCellInSelection(le,M),De=L&&le===H,Oe=oe&&le>=K&&le<=V;let be=!1;this._decorationService.forEachDecorationAtCell(le,M,void 0,(Se=>{be=!0}));let Me=de.getChars()||g.WHITESPACE_CELL_CHAR;if(Me===" "&&(de.isUnderline()||de.isOverline())&&(Me=" "),ne=_e*N-q.get(Me,de.isBold(),de.isItalic()),W){if(I&&(Ie&&se||!Ie&&!se&&de.bg===X)&&(Ie&&se&&j.selectionForeground||de.fg===te)&&de.extended.ext===ee&&Oe===Q&&ne===U&&!De&&!ge&&!be){de.isInvisible()?F+=g.WHITESPACE_CELL_CHAR:F+=Me,I++;continue}I&&(W.textContent=F),W=this._document.createElement("span"),I=0,F=""}else W=this._document.createElement("span");if(X=de.bg,te=de.fg,ee=de.extended.ext,Q=Oe,U=ne,se=Ie,ge&&H>=le&&H<=ue&&(H=le),!this._coreService.isCursorHidden&&De&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&re.push("xterm-cursor-blink"),re.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(z)switch(z){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(de.isBold()&&re.push("xterm-bold"),de.isItalic()&&re.push("xterm-italic"),de.isDim()&&re.push("xterm-dim"),F=de.isInvisible()?g.WHITESPACE_CELL_CHAR:de.getChars()||g.WHITESPACE_CELL_CHAR,de.isUnderline()&&(re.push(`xterm-underline-${de.extended.underlineStyle}`),F===" "&&(F=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let Se=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&Se<8&&(Se+=8),W.style.textDecorationColor=j.ansi[Se].css}de.isOverline()&&(re.push("xterm-overline"),F===" "&&(F=" ")),de.isStrikethrough()&&re.push("xterm-strikethrough"),Oe&&(W.style.textDecoration="underline");let pe=de.getFgColor(),ke=de.getFgColorMode(),we=de.getBgColor(),We=de.getBgColorMode();const et=!!de.isInverse();if(et){const Se=pe;pe=we,we=Se;const He=ke;ke=We,We=He}let xe,Ge,tt,dt=!1;switch(this._decorationService.forEachDecorationAtCell(le,M,void 0,(Se=>{Se.options.layer!=="top"&&dt||(Se.backgroundColorRGB&&(We=50331648,we=Se.backgroundColorRGB.rgba>>8&16777215,xe=Se.backgroundColorRGB),Se.foregroundColorRGB&&(ke=50331648,pe=Se.foregroundColorRGB.rgba>>8&16777215,Ge=Se.foregroundColorRGB),dt=Se.options.layer==="top")})),!dt&&Ie&&(xe=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,we=xe.rgba>>8&16777215,We=50331648,dt=!0,j.selectionForeground&&(ke=50331648,pe=j.selectionForeground.rgba>>8&16777215,Ge=j.selectionForeground)),dt&&re.push("xterm-decoration-top"),We){case 16777216:case 33554432:tt=j.ansi[we],re.push(`xterm-bg-${we}`);break;case 50331648:tt=w.channels.toColor(we>>16,we>>8&255,255&we),this._addStyle(W,`background-color:#${T((we>>>0).toString(16),"0",6)}`);break;default:et?(tt=j.foreground,re.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):tt=j.background}switch(xe||de.isDim()&&(xe=w.color.multiplyOpacity(tt,.5)),ke){case 16777216:case 33554432:de.isBold()&&pe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(pe+=8),this._applyMinimumContrast(W,tt,j.ansi[pe],de,xe,void 0)||re.push(`xterm-fg-${pe}`);break;case 50331648:const Se=w.channels.toColor(pe>>16&255,pe>>8&255,255&pe);this._applyMinimumContrast(W,tt,Se,de,xe,Ge)||this._addStyle(W,`color:#${T(pe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,tt,j.foreground,de,xe,Ge)||et&&re.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}re.length&&(W.className=re.join(" "),re.length=0),De||ge||be?W.textContent=F:I++,ne!==this.defaultSpacing&&(W.style.letterSpacing=`${ne}px`),Y.push(W),le=ue}return W&&I&&(W.textContent=F),Y}_applyMinimumContrast(A,M,L,D,z,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const $=this._getContrastCache(D);let N;if(z||H||(N=$.getColor(M.rgba,L.rgba)),N===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);N=w.color.ensureContrastRatio(z||M,H||L,q),$.setColor((z||M).rgba,(H||L).rgba,N??null)}return!!N&&(this._addStyle(A,`color:${N.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,M){A.setAttribute("style",`${A.getAttribute("style")||""}${M};`)}_isCellInSelection(A,M){const L=this._selectionStart,D=this._selectionEnd;return!(!L||!D)&&(this._columnSelectMode?L[0]<=D[0]?A>=L[0]&&M>=L[1]&&A<D[0]&&M<=D[1]:A<L[0]&&M>=L[1]&&A>=D[0]&&M<=D[1]:M>L[1]&&M<D[1]||L[1]===D[1]&&M===L[1]&&A>=L[0]&&A<D[0]||L[1]<D[1]&&M===D[1]&&A<D[0]||L[1]<D[1]&&M===L[1]&&A>=L[0])}};function T(A,M,L){for(;A.length<L;)A=M+A;return A}a.DomRendererRowFactory=E=d([p(1,b.ICharacterJoinerService),p(2,C.IOptionsService),p(3,b.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,b.IThemeService)],E)},2550:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=l.createElement("span");p.classList.add("xterm-char-measure-element");const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=l.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const S=l.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[p,f,g,S],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(S),d.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(l,d,p,f){l===this._font&&d===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=l,this._fontSize=d,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(l,d,p){let f=0;if(!d&&!p&&l.length===1&&(f=l.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const C=this._measure(l,0);return C>0&&(this._flat[f]=C),C}let g=l;d&&(g+="B"),p&&(g+="I");let S=this._holey.get(g);if(S===void 0){let C=0;d&&(C|=1),p&&(C|=2),S=this._measure(l,C),S>0&&this._holey.set(g,S)}return S}_measure(l,d){const p=this._measureElements[d];return p.textContent=l.repeat(32),p.offsetWidth/32}}},2223:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(h,a)=>{function l(p){return 57508<=p&&p<=57558}function d(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=d,a.allowRescaling=function(p,f,g,S){return f===1&&g>Math.ceil(1.5*S)&&p!==void 0&&p>255&&!d(p)&&!l(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return l(p)||(function(f){return 9472<=f&&f<=9631})(p)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(p,f,g=0){return(p-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,f,g,S=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const C=p.buffers.active.ydisp,w=f[1]-C,b=g[1]-C,x=Math.max(w,0),_=Math.min(b,p.rows-1);x>=p.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=b,this.viewportCappedStartRow=x,this.viewportCappedEndRow=_,this.startCol=f[0],this.endCol=g[0])}isCellSelected(p,f,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f<this.endCol&&g<=this.viewportCappedEndRow:f<this.startCol&&g>=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,d=this.selectionEnd;return!(!l||!d)&&(l[1]>d[1]||l[1]===d[1]&&l[0]>d[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(h,a,l){var d=this&&this.__decorate||function(_,y,E,T){var A,M=arguments.length,L=M<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,y,E,T);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(L=(M<3?A(L):M>3?A(y,E,L):A(y,E))||L);return M>3&&L&&Object.defineProperty(y,E,L),L},p=this&&this.__param||function(_,y){return function(E,T){y(E,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=l(2585),g=l(8460),S=l(844);let C=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new x(this._optionsService))}catch{this._measureStrategy=this.register(new b(_,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([p(2,f.IOptionsService)],C);class w extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends w{constructor(y,E,T){super(),this._document=y,this._parentElement=E,this._optionsService=T,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class x extends w{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(h,a,l){var d=this&&this.__decorate||function(x,_,y,E){var T,A=arguments.length,M=A<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,E);else for(var L=x.length-1;L>=0;L--)(T=x[L])&&(M=(A<3?T(M):A>3?T(_,y,M):T(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,E){_(y,E,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=l(3734),g=l(643),S=l(511),C=l(2585);class w extends f.AttributeData{constructor(_,y,E){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let b=a.CharacterJoinerService=class Qk{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(_){const y={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(y),y.id}deregister(_){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===_)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(_);if(!y||y.length===0)return[];const E=[],T=y.translateToString(!0);let A=0,M=0,L=0,D=y.getFg(0),z=y.getBg(0);for(let H=0;H<y.getTrimmedLength();H++)if(y.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==z){if(H-A>1){const $=this._getJoinedRanges(T,L,M,y,A);for(let N=0;N<$.length;N++)E.push($[N])}A=H,L=M,D=this._workCell.fg,z=this._workCell.bg}M+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const H=this._getJoinedRanges(T,L,M,y,A);for(let $=0;$<H.length;$++)E.push(H[$])}return E}_getJoinedRanges(_,y,E,T,A){const M=_.substring(y,E);let L=[];try{L=this._characterJoiners[0].handler(M)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const z=this._characterJoiners[D].handler(M);for(let H=0;H<z.length;H++)Qk._mergeRanges(L,z[H])}catch(z){console.error(z)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(_,y,E){let T=0,A=!1,M=0,L=_[T];if(L){for(let D=E;D<this._bufferService.cols;D++){const z=y.getWidth(D),H=y.getString(D).length||g.WHITESPACE_CELL_CHAR.length;if(z!==0){if(!A&&L[0]<=M&&(L[0]=D,A=!0),L[1]<=M){if(L[1]=D,L=_[++T],!L)break;L[0]<=M?(L[0]=D,A=!0):A=!1}M+=H}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(_,y){let E=!1;for(let T=0;T<_.length;T++){const A=_[T];if(E){if(y[1]<=A[0])return _[T-1][1]=y[1],_;if(y[1]<=A[1])return _[T-1][1]=Math.max(y[1],A[1]),_.splice(T,1),_;_.splice(T,1),T--}else{if(y[1]<=A[0])return _.splice(T,0,y),_;if(y[1]<=A[1])return A[0]=Math.min(y[0],A[0]),_;y[0]<A[1]&&(A[0]=Math.min(y[0],A[0]),E=!0)}}return E?_[_.length-1][1]=y[1]:_.push(y),_}};a.CharacterJoinerService=b=d([p(0,C.IBufferService)],b)},5114:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=l(844),p=l(8460),f=l(3656);class g extends d.Disposable{constructor(w,b,x){super(),this._textarea=w,this._window=b,this.mainDocument=x,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=g;class S extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(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)}}},779:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=l(844);class p extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const S=this.linkProviders.indexOf(g);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=p},8934:function(h,a,l){var d=this&&this.__decorate||function(C,w,b,x){var _,y=arguments.length,E=y<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,b,x);else for(var T=C.length-1;T>=0;T--)(_=C[T])&&(E=(y<3?_(E):y>3?_(w,b,E):_(w,b))||E);return y>3&&E&&Object.defineProperty(w,b,E),E},p=this&&this.__param||function(C,w){return function(b,x){w(b,x,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=l(4725),g=l(9806);let S=a.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,b,x,_){return(0,g.getCoords)(window,C,w,b,x,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(C,w){const b=(0,g.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};a.MouseService=S=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],S)},3230:function(h,a,l){var d=this&&this.__decorate||function(_,y,E,T){var A,M=arguments.length,L=M<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,y,E,T);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(L=(M<3?A(L):M>3?A(y,E,L):A(y,E))||L);return M>3&&L&&Object.defineProperty(y,E,L),L},p=this&&this.__param||function(_,y){return function(E,T){y(E,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=l(6193),g=l(4725),S=l(8460),C=l(844),w=l(7226),b=l(2585);let x=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,y,E,T,A,M,L,D){super(),this._rowCount=_,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((z,H)=>this._renderRows(z,H)),L),this.register(this._renderDebouncer),this.register(L.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(L.window,y),this.register(L.onWindowChange((z=>this._registerIntersectionObserver(z,y))))}_registerIntersectionObserver(_,y){if("IntersectionObserver"in _){const E=new _.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(y),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(_,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,y,this._rowCount))}_renderRows(_,y){this._renderer.value&&(_=Math.min(_,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(_,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:y}),this._onRender.fire({start:_,end:y}),this._isNextRenderRedrawOnly=!0)}resize(_,y){this._rowCount=y,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_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(_,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(_,y))):this._renderer.value.handleResize(_,y),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(_,y,E){this._selectionState.start=_,this._selectionState.end=y,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(_,y,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};a.RenderService=x=d([p(2,b.IOptionsService),p(3,g.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],x)},9312:function(h,a,l){var d=this&&this.__decorate||function(L,D,z,H){var $,N=arguments.length,q=N<3?D:H===null?H=Object.getOwnPropertyDescriptor(D,z):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(L,D,z,H);else for(var K=L.length-1;K>=0;K--)($=L[K])&&(q=(N<3?$(q):N>3?$(D,z,q):$(D,z))||q);return N>3&&q&&Object.defineProperty(D,z,q),q},p=this&&this.__param||function(L,D){return function(z,H){D(z,H,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=l(9806),g=l(9504),S=l(456),C=l(4725),w=l(8460),b=l(844),x=l(6114),_=l(4841),y=l(511),E=l(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends b.Disposable{constructor(L,D,z,H,$,N,q,K,V){super(),this._element=L,this._screenElement=D,this._linkifier=z,this._bufferService=H,this._coreService=$,this._mouseService=N,this._optionsService=q,this._renderService=K,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!L||!D||L[0]===D[0]&&L[1]===D[1])}get selectionText(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!L||!D)return"";const z=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(L[0]===D[0])return"";const $=L[0]<D[0]?L[0]:D[0],N=L[0]<D[0]?D[0]:L[0];for(let q=L[1];q<=D[1];q++){const K=z.translateBufferLineToString(q,!0,$,N);H.push(K)}}else{const $=L[1]===D[1]?D[0]:void 0;H.push(z.translateBufferLineToString(L[1],!0,L[0],$));for(let N=L[1]+1;N<=D[1]-1;N++){const q=z.lines.get(N),K=z.translateBufferLineToString(N,!0);q?.isWrapped?H[H.length-1]+=K:H.push(K)}if(L[1]!==D[1]){const N=z.lines.get(D[1]),q=z.translateBufferLineToString(D[1],!0,0,D[0]);N&&N.isWrapped?H[H.length-1]+=q:H.push(q)}}return H.map(($=>$.replace(A," "))).join(x.isWindows?`\r
31
+ `:`
32
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),x.isLinux&&L&&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(L){const D=this._getMouseBufferCoords(L),z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(z&&H&&D)&&this._areCoordsInSelection(D,z,H)}isCellInSelection(L,D){const z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!z||!H)&&this._areCoordsInSelection([L,D],z,H)}_areCoordsInSelection(L,D,z){return L[1]>D[1]&&L[1]<z[1]||D[1]===z[1]&&L[1]===D[1]&&L[0]>=D[0]&&L[0]<z[0]||D[1]<z[1]&&L[1]===z[1]&&L[0]<z[0]||D[1]<z[1]&&L[1]===D[1]&&L[0]>=D[0]}_selectWordAtCursor(L,D){const z=this._linkifier.currentLink?.link?.range;if(z)return this._model.selectionStart=[z.start.x-1,z.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(z,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(L);return!!H&&(this._selectWordAt(H,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,D){this._model.clearSelection(),L=Math.max(L,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const D=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(L){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,L,this._screenElement)[1];const z=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=z?0:(D>z&&(D-=z),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(L){return x.isMac?L.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:L.shiftKey}handleMouseDown(L){if(this._mouseDownTimeStamp=L.timeStamp,(L.button!==2||!this.hasSelection)&&L.button===0){if(!this._enabled){if(!this.shouldForceSelection(L))return;L.stopPropagation()}L.preventDefault(),this._dragScrollAmount=0,this._enabled&&L.shiftKey?this._handleIncrementalClick(L):L.detail===1?this._handleSingleClick(L):L.detail===2?this._handleDoubleClick(L):L.detail===3&&this._handleTripleClick(L),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(L){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(L))}_handleSingleClick(L){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(L)?3:0,this._model.selectionStart=this._getMouseBufferCoords(L),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const D=this._getMouseBufferCoords(L);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(L){return L.altKey&&!(x.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(L),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(L),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const z=this._bufferService.buffer;if(this._model.selectionEnd[1]<z.lines.length){const H=z.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const L=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(L.ydisp+this._bufferService.rows,L.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=L.ydisp),this.refresh()}}_handleMouseUp(L){const D=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const z=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(z&&z[0]!==void 0&&z[1]!==void 0){const H=(0,g.moveToCellSequence)(z[0]-1,z[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,z=!(!L||!D||L[0]===D[0]&&L[1]===D[1]);z?L&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,D,z)):this._oldHasSelection&&this._fireOnSelectionChange(L,D,z)}_fireOnSelectionChange(L,D,z){this._oldSelectionStart=L,this._oldSelectionEnd=D,this._oldHasSelection=z,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(L,D){let z=D;for(let H=0;D>=H;H++){const $=L.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?z--:$>1&&D!==H&&(z+=$-1)}return z}setSelection(L,D,z){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,D],this._model.selectionStartLength=z,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,D,z=!0,H=!0){if(L[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,N=$.lines.get(L[1]);if(!N)return;const q=$.translateBufferLineToString(L[1],!1);let K=this._convertViewportColToCharacterIndex(N,L[0]),V=K;const Y=L[0]-K;let G=0,j=0,W=0,P=0;if(q.charAt(K)===" "){for(;K>0&&q.charAt(K-1)===" ";)K--;for(;V<q.length&&q.charAt(V+1)===" ";)V++}else{let X=L[0],te=L[0];N.getWidth(X)===0&&(G++,X--),N.getWidth(te)===2&&(j++,te++);const ee=N.getString(te).length;for(ee>1&&(P+=ee-1,V+=ee-1);X>0&&K>0&&!this._isCharWordSeparator(N.loadCell(X-1,this._workCell));){N.loadCell(X-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(G++,X--):Q>1&&(W+=Q-1,K-=Q-1),K--,X--}for(;te<N.length&&V+1<q.length&&!this._isCharWordSeparator(N.loadCell(te+1,this._workCell));){N.loadCell(te+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,te++):Q>1&&(P+=Q-1,V+=Q-1),V++,te++}}V++;let I=K+Y-G+W,F=Math.min(this._bufferService.cols,V-K+G+j-W-P);if(D||q.slice(K,V).trim()!==""){if(z&&I===0&&N.getCodePoint(0)!==32){const X=$.lines.get(L[1]-1);if(X&&N.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const te=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(te){const ee=this._bufferService.cols-te.start;I-=ee,F+=ee}}}if(H&&I+F===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const X=$.lines.get(L[1]+1);if(X?.isWrapped&&X.getCodePoint(0)!==32){const te=this._getWordAt([0,L[1]+1],!1,!1,!0);te&&(F+=te.length)}}return{start:I,length:F}}}_selectWordAt(L,D){const z=this._getWordAt(L,D);if(z){for(;z.start<0;)z.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[z.start,L[1]],this._model.selectionStartLength=z.length}}_selectToWordAt(L){const D=this._getWordAt(L,!0);if(D){let z=L[1];for(;D.start<0;)D.start+=this._bufferService.cols,z--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,z++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,z]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const D=this._bufferService.buffer.getWrappedRangeForLine(L),z={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(z,this._bufferService.cols)}};a.SelectionService=M=d([p(3,E.IBufferService),p(4,E.ICoreService),p(5,C.IMouseService),p(6,E.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],M)},4725:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=l(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(h,a,l){var d=this&&this.__decorate||function(M,L,D,z){var H,$=arguments.length,N=$<3?L:z===null?z=Object.getOwnPropertyDescriptor(L,D):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,L,D,z);else for(var q=M.length-1;q>=0;q--)(H=M[q])&&(N=($<3?H(N):$>3?H(L,D,N):H(L,D))||N);return $>3&&N&&Object.defineProperty(L,D,N),N},p=this&&this.__param||function(M,L){return function(D,z){L(D,z,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=l(7239),g=l(8055),S=l(8460),C=l(844),w=l(2585),b=g.css.toColor("#ffffff"),x=g.css.toColor("#000000"),_=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],L=[0,95,135,175,215,255];for(let D=0;D<216;D++){const z=L[D/36%6|0],H=L[D/6%6|0],$=L[D%6];M.push({css:g.channels.toCss(z,H,$),rgba:g.channels.toRgba(z,H,$)})}for(let D=0;D<24;D++){const z=8+10*D;M.push({css:g.channels.toCss(z,z,z),rgba:g.channels.toRgba(z,z,z)})}return M})());let T=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:x,cursor:_,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:g.color.blend(x,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:g.color.blend(x,E),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(M={}){const L=this._colors;if(L.foreground=A(M.foreground,b),L.background=A(M.background,x),L.cursor=A(M.cursor,_),L.cursorAccent=A(M.cursorAccent,y),L.selectionBackgroundTransparent=A(M.selectionBackground,E),L.selectionBackgroundOpaque=g.color.blend(L.background,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundTransparent=A(M.selectionInactiveBackground,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundOpaque=g.color.blend(L.background,L.selectionInactiveBackgroundTransparent),L.selectionForeground=M.selectionForeground?A(M.selectionForeground,g.NULL_COLOR):void 0,L.selectionForeground===g.NULL_COLOR&&(L.selectionForeground=void 0),g.color.isOpaque(L.selectionBackgroundTransparent)&&(L.selectionBackgroundTransparent=g.color.opacity(L.selectionBackgroundTransparent,.3)),g.color.isOpaque(L.selectionInactiveBackgroundTransparent)&&(L.selectionInactiveBackgroundTransparent=g.color.opacity(L.selectionInactiveBackgroundTransparent,.3)),L.ansi=a.DEFAULT_ANSI_COLORS.slice(),L.ansi[0]=A(M.black,a.DEFAULT_ANSI_COLORS[0]),L.ansi[1]=A(M.red,a.DEFAULT_ANSI_COLORS[1]),L.ansi[2]=A(M.green,a.DEFAULT_ANSI_COLORS[2]),L.ansi[3]=A(M.yellow,a.DEFAULT_ANSI_COLORS[3]),L.ansi[4]=A(M.blue,a.DEFAULT_ANSI_COLORS[4]),L.ansi[5]=A(M.magenta,a.DEFAULT_ANSI_COLORS[5]),L.ansi[6]=A(M.cyan,a.DEFAULT_ANSI_COLORS[6]),L.ansi[7]=A(M.white,a.DEFAULT_ANSI_COLORS[7]),L.ansi[8]=A(M.brightBlack,a.DEFAULT_ANSI_COLORS[8]),L.ansi[9]=A(M.brightRed,a.DEFAULT_ANSI_COLORS[9]),L.ansi[10]=A(M.brightGreen,a.DEFAULT_ANSI_COLORS[10]),L.ansi[11]=A(M.brightYellow,a.DEFAULT_ANSI_COLORS[11]),L.ansi[12]=A(M.brightBlue,a.DEFAULT_ANSI_COLORS[12]),L.ansi[13]=A(M.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),L.ansi[14]=A(M.brightCyan,a.DEFAULT_ANSI_COLORS[14]),L.ansi[15]=A(M.brightWhite,a.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const D=Math.min(L.ansi.length-16,M.extendedAnsi.length);for(let z=0;z<D;z++)L.ansi[z+16]=A(M.extendedAnsi[z],a.DEFAULT_ANSI_COLORS[z+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let L=0;L<this._restoreColors.ansi.length;++L)this._colors.ansi[L]=this._restoreColors.ansi[L]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function A(M,L){if(M!==void 0)try{return g.css.toColor(M)}catch{}return L}a.ThemeService=T=d([p(0,w.IOptionsService)],T)},6349:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=l(8460),p=l(844);class f extends p.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const C=new Array(S);for(let w=0;w<Math.min(S,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let C=this._length;C<S;C++)this._array[C]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,C){this._array[this._getCyclicIndex(S)]=C}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,C,...w){if(C){for(let b=S;b<this._length-C;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+C)];this._length-=C,this.onDeleteEmitter.fire({index:S,amount:C})}for(let b=this._length-1;b>=S;b--)this._array[this._getCyclicIndex(b+w.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<w.length;b++)this._array[this._getCyclicIndex(S+b)]=w[b];if(w.length&&this.onInsertEmitter.fire({index:S,amount:w.length}),this._length+w.length>this._maxLength){const b=this._length+w.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=w.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,C,w){if(!(C<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let x=C-1;x>=0;x--)this.set(S+x+w,this.get(S+x));const b=S+C+w-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<C;b++)this.set(S+b+w,this.get(S+b))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=f},1439:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(d,p=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=p<=1?d[g]:d[g]&&l(d[g],p-1);return f}},8055:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let l=0,d=0,p=0,f=0;var g,S,C,w,b;function x(y){const E=y.toString(16);return E.length<2?"0"+E:E}function _(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,T,A,M){return M!==void 0?`#${x(E)}${x(T)}${x(A)}${x(M)}`:`#${x(E)}${x(T)}${x(A)}`},y.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},y.toColor=function(E,T,A,M){return{css:y.toCss(E,T,A,M),rgba:y.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(y){function E(T,A){return f=Math.round(255*A),[l,d,p]=b.toChannels(T.rgba),{css:g.toCss(l,d,p,f),rgba:g.toRgba(l,d,p,f)}}y.blend=function(T,A){if(f=(255&A.rgba)/255,f===1)return{css:A.css,rgba:A.rgba};const M=A.rgba>>24&255,L=A.rgba>>16&255,D=A.rgba>>8&255,z=T.rgba>>24&255,H=T.rgba>>16&255,$=T.rgba>>8&255;return l=z+Math.round((M-z)*f),d=H+Math.round((L-H)*f),p=$+Math.round((D-$)*f),{css:g.toCss(l,d,p),rgba:g.toRgba(l,d,p)}},y.isOpaque=function(T){return(255&T.rgba)==255},y.ensureContrastRatio=function(T,A,M){const L=b.ensureContrastRatio(T.rgba,A.rgba,M);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},y.opaque=function(T){const A=(255|T.rgba)>>>0;return[l,d,p]=b.toChannels(A),{css:g.toCss(l,d,p),rgba:A}},y.opacity=E,y.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},y.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(S||(a.color=S={})),(function(y){let E,T;try{const A=document.createElement("canvas");A.width=1,A.height=1;const M=A.getContext("2d",{willReadFrequently:!0});M&&(E=M,E.globalCompositeOperation="copy",T=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return l=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),g.toColor(l,d,p);case 5:return l=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),f=parseInt(A.slice(4,5).repeat(2),16),g.toColor(l,d,p,f);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const M=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),d=parseInt(M[2]),p=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),g.toColor(l,d,p,f);if(!E||!T)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=T,E.fillStyle=A,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[l,d,p,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(l,d,p,f),css:A}}})(C||(a.css=C={})),(function(y){function E(T,A,M){const L=T/255,D=A/255,z=M/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}y.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},y.relativeLuminance2=E})(w||(a.rgb=w={})),(function(y){function E(A,M,L){const D=A>>24&255,z=A>>16&255,H=A>>8&255;let $=M>>24&255,N=M>>16&255,q=M>>8&255,K=_(w.relativeLuminance2($,N,q),w.relativeLuminance2(D,z,H));for(;K<L&&($>0||N>0||q>0);)$-=Math.max(0,Math.ceil(.1*$)),N-=Math.max(0,Math.ceil(.1*N)),q-=Math.max(0,Math.ceil(.1*q)),K=_(w.relativeLuminance2($,N,q),w.relativeLuminance2(D,z,H));return($<<24|N<<16|q<<8|255)>>>0}function T(A,M,L){const D=A>>24&255,z=A>>16&255,H=A>>8&255;let $=M>>24&255,N=M>>16&255,q=M>>8&255,K=_(w.relativeLuminance2($,N,q),w.relativeLuminance2(D,z,H));for(;K<L&&($<255||N<255||q<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),N=Math.min(255,N+Math.ceil(.1*(255-N))),q=Math.min(255,q+Math.ceil(.1*(255-q))),K=_(w.relativeLuminance2($,N,q),w.relativeLuminance2(D,z,H));return($<<24|N<<16|q<<8|255)>>>0}y.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,D=M>>16&255,z=M>>8&255,H=A>>24&255,$=A>>16&255,N=A>>8&255;return l=H+Math.round((L-H)*f),d=$+Math.round((D-$)*f),p=N+Math.round((z-N)*f),g.toRgba(l,d,p)},y.ensureContrastRatio=function(A,M,L){const D=w.relativeLuminance(A>>8),z=w.relativeLuminance(M>>8);if(_(D,z)<L){if(z<D){const N=E(A,M,L),q=_(D,w.relativeLuminance(N>>8));if(q<L){const K=T(A,M,L);return q>_(D,w.relativeLuminance(K>>8))?N:K}return N}const H=T(A,M,L),$=_(D,w.relativeLuminance(H>>8));if($<L){const N=E(A,M,L);return $>_(D,w.relativeLuminance(N>>8))?H:N}return H}},y.reduceLuminance=E,y.increaseLuminance=T,y.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(b||(a.rgba=b={})),a.toPaddedHex=x,a.contrastRatio=_},8969:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=l(844),p=l(2585),f=l(4348),g=l(7866),S=l(744),C=l(7302),w=l(6975),b=l(8460),x=l(1753),_=l(1480),y=l(7994),E=l(9282),T=l(5435),A=l(5981),M=l(2660);let L=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((H=>{this._onScrollApi?.fire(H.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(H){for(const $ in H)this.optionsService.options[$]=H[$]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new C.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(x.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new A.WriteBuffer((($,N)=>this._inputHandler.parse($,N)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,$){this._writeBuffer.write(H,$)}writeSync(H,$){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(H,$)}input(H,$=!0){this.coreService.triggerDataEvent(H,$)}resize(H,$){isNaN(H)||isNaN($)||(H=Math.max(H,S.MINIMUM_COLS),$=Math.max($,S.MINIMUM_ROWS),this._bufferService.resize(H,$))}scroll(H,$=!1){this._bufferService.scroll(H,$)}scrollLines(H,$,N){this._bufferService.scrollLines(H,$,N)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const $=H-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(H,$){return this._inputHandler.registerEscHandler(H,$)}registerDcsHandler(H,$){return this._inputHandler.registerDcsHandler(H,$)}registerCsiHandler(H,$){return this._inputHandler.registerCsiHandler(H,$)}registerOscHandler(H,$){return this._inputHandler.registerOscHandler(H,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?H=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const $ of H)$.dispose()}))}}}a.CoreTerminal=D},8460:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===l)return void this._listeners.splice(d,1)}}})),this._event}fire(l,d){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,l,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,d){return l((p=>d.fire(p)))},a.runAndSubscribe=function(l,d){return d(void 0),l((p=>d(p)))}},5435:function(h,a,l){var d=this&&this.__decorate||function(G,j,W,P){var I,F=arguments.length,X=F<3?j:P===null?P=Object.getOwnPropertyDescriptor(j,W):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(G,j,W,P);else for(var te=G.length-1;te>=0;te--)(I=G[te])&&(X=(F<3?I(X):F>3?I(j,W,X):I(j,W))||X);return F>3&&X&&Object.defineProperty(j,W,X),X},p=this&&this.__param||function(G,j){return function(W,P){j(W,P,G)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=l(2584),g=l(7116),S=l(2015),C=l(844),w=l(482),b=l(8437),x=l(8460),_=l(643),y=l(511),E=l(3734),T=l(2585),A=l(1480),M=l(6242),L=l(6351),D=l(5941),z={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function $(G,j){if(G>24)return j.setWinLines||!1;switch(G){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var N;(function(G){G[G.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",G[G.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(a.WindowsOptionsReportType=N={}));let q=0;class K extends C.Disposable{getAttrData(){return this._curAttrData}constructor(j,W,P,I,F,X,te,ee,Q=new S.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=W,this._coreService=P,this._logService=I,this._optionsService=F,this._oscLinkService=X,this._coreMouseService=te,this._unicodeService=ee,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new x.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new x.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new x.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new x.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new x.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new x.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new x.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new x.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new x.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new x.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new x.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new x.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:se.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,se,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:se,data:ne})})),this._parser.setDcsHandlerFallback(((U,se,ne)=>{se==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:se,payload:ne})})),this._parser.setPrintHandler(((U,se,ne)=>this.print(U,se,ne))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new M.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new M.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new M.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new M.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new M.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new M.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new M.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new M.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new M.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new M.OscHandler((U=>this.restoreCursorColor(U)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const U in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((U,se)=>this.requestStatusString(U,se))))}_preserveStack(j,W,P,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=W,this._parseStack.decodedLength=P,this._parseStack.position=I}_logSlowResolvingAsync(j){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([j,new Promise(((W,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((W=>{if(W!=="#SLOW_TIMEOUT")throw W;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,W){let P,I=this._activeBuffer.x,F=this._activeBuffer.y,X=0;const te=this._parseStack.paused;if(te){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,W))return this._logSlowResolvingAsync(P),P;I=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>H&&(X=this._parseStack.position+H)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(U=>String.fromCharCode(U))).join("")}"`),typeof j=="string"?j.split("").map((U=>U.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(j.length,H))),te||this._dirtyRowTracker.clearRange(),j.length>H)for(let U=X;U<j.length;U+=H){const se=U+H<j.length?U+H:j.length,ne=typeof j=="string"?this._stringDecoder.decode(j.substring(U,se),this._parseBuffer):this._utf8Decoder.decode(j.subarray(U,se),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(I,F,ne,U),this._logSlowResolvingAsync(P),P}else if(!te){const U=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,U))return this._preserveStack(I,F,U,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===I&&this._activeBuffer.y===F||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(j,W,P){let I,F;const X=this._charsetService.charset,te=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,se=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-W>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let re=this._parser.precedingJoinState;for(let oe=W;oe<P;++oe){if(I=j[oe],I<127&&X){const ue=X[String.fromCharCode(I)];ue&&(I=ue.charCodeAt(0))}const le=this._unicodeService.charProperties(I,re);F=A.UnicodeService.extractWidth(le);const _e=A.UnicodeService.extractShouldJoin(le),ge=_e?A.UnicodeService.extractWidth(re):0;if(re=le,te&&this._onA11yChar.fire((0,w.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-ge>ee){if(Q){const ue=ne;let de=this._activeBuffer.x-ge;for(this._activeBuffer.x=ge,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ge>0&&ne instanceof b.BufferLine&&ne.copyCellsFrom(ue,de,0,ge,!1);de<ee;)ue.setCellFromCodepoint(de++,0,1,se)}else if(this._activeBuffer.x=ee-1,F===2)continue}if(_e&&this._activeBuffer.x){const ue=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-ue,I,F);for(let de=F-ge;--de>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(U&&(ne.insertCells(this._activeBuffer.x,F-ge,this._activeBuffer.getNullCell(se)),ne.getWidth(ee-1)===2&&ne.setCellFromCodepoint(ee-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,se)),ne.setCellFromCodepoint(this._activeBuffer.x++,I,F,se),F>0)for(;--F;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=re,this._activeBuffer.x<ee&&P-W>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,W){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,W):this._parser.registerCsiHandler(j,(P=>!$(P.params[0],this._optionsService.rawOptions.windowOptions)||W(P)))}registerDcsHandler(j,W){return this._parser.registerDcsHandler(j,new L.DcsHandler(W))}registerEscHandler(j,W){return this._parser.registerEscHandler(j,W)}registerOscHandler(j,W){return this._parser.registerOscHandler(j,new M.OscHandler(W))}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;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,W){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+W):(this._activeBuffer.x=j,this._activeBuffer.y=W),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,W){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+W)}cursorUp(j){const W=this._activeBuffer.y-this._activeBuffer.scrollTop;return W>=0?this._moveCursor(0,-Math.min(W,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const W=this._activeBuffer.scrollBottom-this._activeBuffer.y;return W>=0?this._moveCursor(0,Math.min(W,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const W=j.params[0];return W===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:W===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let W=j.params[0]||1;for(;W--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const W=j.params[0];return W===1&&(this._curAttrData.bg|=536870912),W!==2&&W!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,W,P,I=!1,F=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);X.replaceCells(W,P,this._activeBuffer.getNullCell(this._eraseAttrData()),F),I&&(X.isWrapped=!1)}_resetBufferLine(j,W=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),W),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),P.isWrapped=!1)}eraseInDisplay(j,W=!1){let P;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);P<this._bufferService.rows;P++)this._resetBufferLine(P,W);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,W),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,W);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,W);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(j,W=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,W);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,W);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,W)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;W--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let W=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;W--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let W=j.params[0]||1;for(;W--;)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(j){let W=j.params[0]||1;for(;W--;)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(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(0,W,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const W=j.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(this._activeBuffer.x,W,this._activeBuffer.getNullCell(this._eraseAttrData())),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return W&&(W.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const W=this._parser.precedingJoinState;if(!W)return!0;const P=j.params[0]||1,I=A.UnicodeService.extractWidth(W),F=this._activeBuffer.x-I,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),te=new Uint32Array(X.length*P);let ee=0;for(let U=0;U<X.length;){const se=X.codePointAt(U)||0;te[ee++]=se,U+=se>65535?2:1}let Q=ee;for(let U=1;U<P;++U)te.copyWithin(Q,0,ee),Q+=ee;return this.print(te,0,Q),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let W=0;W<j.length;W++)switch(j.params[W]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[W]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,W){const P=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:F}=this._coreMouseService,X=this._coreService,{buffers:te,cols:ee}=this._bufferService,{active:Q,alt:U}=te,se=this._optionsService.rawOptions,ne=_e=>_e?1:2,re=j.params[0];return oe=re,le=W?re===2?4:re===4?ne(X.modes.insertMode):re===12?3:re===20?ne(se.convertEol):0:re===1?ne(P.applicationCursorKeys):re===3?se.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:re===6?ne(P.origin):re===7?ne(P.wraparound):re===8?3:re===9?ne(I==="X10"):re===12?ne(se.cursorBlink):re===25?ne(!X.isCursorHidden):re===45?ne(P.reverseWraparound):re===66?ne(P.applicationKeypad):re===67?4:re===1e3?ne(I==="VT200"):re===1002?ne(I==="DRAG"):re===1003?ne(I==="ANY"):re===1004?ne(P.sendFocus):re===1005?4:re===1006?ne(F==="SGR"):re===1015?4:re===1016?ne(F==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?ne(Q===U):re===2004?ne(P.bracketedPasteMode):0,X.triggerDataEvent(`${f.C0.ESC}[${W?"":"?"}${oe};${le}$y`),!0;var oe,le}_updateAttrColor(j,W,P,I,F){return W===2?(j|=50331648,j&=-16777216,j|=E.AttributeData.fromColorRGB([P,I,F])):W===5&&(j&=-50331904,j|=33554432|255&P),j}_extractColor(j,W,P){const I=[0,0,-1,0,0,0];let F=0,X=0;do{if(I[X+F]=j.params[W+X],j.hasSubParams(W+X)){const te=j.getSubParams(W+X);let ee=0;do I[1]===5&&(F=1),I[X+ee+1+F]=te[ee];while(++ee<te.length&&ee+X+1+F<I.length);break}if(I[1]===5&&X+F>=2||I[1]===2&&X+F>=5)break;I[1]&&(F=1)}while(++X+W<j.length&&X+F<I.length);for(let te=2;te<I.length;++te)I[te]===-1&&(I[te]=0);switch(I[0]){case 38:P.fg=this._updateAttrColor(P.fg,I[1],I[3],I[4],I[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,I[1],I[3],I[4],I[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,I[1],I[3],I[4],I[5])}return X}_processUnderline(j,W){W.extended=W.extended.clone(),(!~j||j>5)&&(j=1),W.extended.underlineStyle=j,W.fg|=268435456,j===0&&(W.fg&=-268435457),W.updateExtended()}_processSGR0(j){j.fg=b.DEFAULT_ATTR_DATA.fg,j.bg=b.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const W=j.length;let P;const I=this._curAttrData;for(let F=0;F<W;F++)P=j.params[F],P>=30&&P<=37?(I.fg&=-50331904,I.fg|=16777216|P-30):P>=40&&P<=47?(I.bg&=-50331904,I.bg|=16777216|P-40):P>=90&&P<=97?(I.fg&=-50331904,I.fg|=16777224|P-90):P>=100&&P<=107?(I.bg&=-50331904,I.bg|=16777224|P-100):P===0?this._processSGR0(I):P===1?I.fg|=134217728:P===3?I.bg|=67108864:P===4?(I.fg|=268435456,this._processUnderline(j.hasSubParams(F)?j.getSubParams(F)[0]:1,I)):P===5?I.fg|=536870912:P===7?I.fg|=67108864:P===8?I.fg|=1073741824:P===9?I.fg|=2147483648:P===2?I.bg|=134217728:P===21?this._processUnderline(2,I):P===22?(I.fg&=-134217729,I.bg&=-134217729):P===23?I.bg&=-67108865:P===24?(I.fg&=-268435457,this._processUnderline(0,I)):P===25?I.fg&=-536870913:P===27?I.fg&=-67108865:P===28?I.fg&=-1073741825:P===29?I.fg&=2147483647:P===39?(I.fg&=-67108864,I.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):P===49?(I.bg&=-67108864,I.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?F+=this._extractColor(j,F,I):P===53?I.bg|=1073741824:P===55?I.bg&=-1073741825:P===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):P===100?(I.fg&=-67108864,I.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const W=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${W};${P}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const W=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${W};${P}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const W=j.params[0]||1;switch(W){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=W%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(j){const W=j.params[0]||1;let P;return(j.length<2||(P=j.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>W&&(this._activeBuffer.scrollTop=W-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(j){if(!$(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const W=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:W!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:W!==0&&W!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),W!==0&&W!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:W!==0&&W!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),W!==0&&W!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const W=[],P=j.split(";");for(;P.length>1;){const I=P.shift(),F=P.shift();if(/^\d+$/.exec(I)){const X=parseInt(I);if(Y(X))if(F==="?")W.push({type:0,index:X});else{const te=(0,D.parseColor)(F);te&&W.push({type:1,index:X,color:te})}}}return W.length&&this._onColor.fire(W),!0}setHyperlink(j){const W=j.split(";");return!(W.length<2)&&(W[1]?this._createHyperlink(W[0],W[1]):!W[0]&&this._finishHyperlink())}_createHyperlink(j,W){this._getCurrentLinkId()&&this._finishHyperlink();const P=j.split(":");let I;const F=P.findIndex((X=>X.startsWith("id=")));return F!==-1&&(I=P[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:W}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,W){const P=j.split(";");for(let I=0;I<P.length&&!(W>=this._specialColors.length);++I,++W)if(P[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[W]}]);else{const F=(0,D.parseColor)(P[I]);F&&this._onColor.fire([{type:1,index:this._specialColors[W],color:F}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const W=[],P=j.split(";");for(let I=0;I<P.length;++I)if(/^\d+$/.exec(P[I])){const F=parseInt(P[I]);Y(F)&&W.push({type:2,index:F})}return W.length&&this._onColor.fire(W),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,g.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(z[j[0]],g.CHARSETS[j[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new y.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let W=0;W<this._bufferService.rows;++W){const P=this._activeBuffer.ybase+this._activeBuffer.y+W,I=this._activeBuffer.lines.get(P);I&&(I.fill(j),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,W){const P=this._bufferService.buffer,I=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${F}${f.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,W){this._dirtyRowTracker.markRangeDirty(j,W)}}a.InputHandler=K;let V=class{constructor(G){this._bufferService=G,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(G){G<this.start?this.start=G:G>this.end&&(this.end=G)}markRangeDirty(G,j){G>j&&(q=G,G=j,j=q),G<this.start&&(this.start=G),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(G){return 0<=G&&G<256}V=d([p(0,T.IBufferService)],V)},844:(h,a)=>{function l(d){for(const p of d)p.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=l,a.getDisposeArrayDisposable=function(d){return{dispose:()=>l(d)}}},1505:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(p,f,g){this._data[p]||(this._data[p]={}),this._data[p][f]=g}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(d,p,f,g,S){this._data.get(d,p)||this._data.set(d,p,new l),this._data.get(d,p).set(f,g,S)}get(d,p,f,g){return this._data.get(d,p)?.get(f,g)}clear(){this._data.clear()}}},6114:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const l=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=l.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(l=this._search(this._getKey(d)),this._array.splice(l,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(l=this._search(p),l===-1)||this._getKey(this._array[l])!==p)return!1;do if(this._array[l]===d)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(l=this._search(d),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===d))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===d)}forEachByKey(d,p){if(this._array.length!==0&&(l=this._search(d),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===d))do p(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===d)}values(){return[...this._array].values()}_search(d){let p=0,f=this._array.length-1;for(;f>=p;){let g=p+f>>1;const S=this._getKey(this._array[g]);if(S>d)f=g-1;else{if(!(S<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=l(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let C=0,w=0,b=S.timeRemaining(),x=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),x=S.timeRemaining(),1.5*w>x)return b-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-C))}ms`),void this._start();b=x}this.clear()}}class f extends p{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const C=Date.now()+S;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=f,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=l(643);a.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=f?.get(p.cols-1),S=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);S&&g&&(S.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new l;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=l;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=l(6349),p=l(7226),f=l(3734),g=l(8437),S=l(4634),C=l(511),w=l(643),b=l(4863),x=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(_,y,E){this._hasScrollback=_,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=x.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,y){return new g.BufferLine(this._bufferService.cols,this.getNullCell(_),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const y=_+this._optionsService.rawOptions.scrollback;return y>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:y}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=g.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(_))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(_,y){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(y);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<_)for(let L=0;L<this.lines.length;L++)T+=+this.lines.get(L).resize(_,E);let M=0;if(this._rows<y)for(let L=this._rows;L<y;L++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(_,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(_,E)));else for(let L=this._rows;L>y;L--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const L=this.lines.length-A;L>0&&(this.lines.trimStart(L),this.ybase=Math.max(this.ybase-L,0),this.ydisp=Math.max(this.ydisp-L,0),this.savedY=Math.max(this.savedY-L,0)),this.lines.maxLength=A}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,y-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(_,y),this._cols>_))for(let M=0;M<this.lines.length;M++)T+=+this.lines.get(M).resize(_,E);this._cols=_,this._rows=y,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,y){this._cols!==_&&(_>this._cols?this._reflowLarger(_,y):this._reflowSmaller(_,y))}_reflowLarger(_,y){const E=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,S.reflowLargerCreateNewLayout)(this.lines,E);(0,S.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(_,y,T.countRemoved)}}_reflowLargerAdjustViewport(_,y,E){const T=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=E;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new g.BufferLine(_,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(_,y){const E=this.getNullCell(g.DEFAULT_ATTR_DATA),T=[];let A=0;for(let M=this.lines.length-1;M>=0;M--){let L=this.lines.get(M);if(!L||!L.isWrapped&&L.getTrimmedLength()<=_)continue;const D=[L];for(;L.isWrapped&&M>0;)L=this.lines.get(--M),D.unshift(L);const z=this.ybase+this.y;if(z>=M&&z<M+D.length)continue;const H=D[D.length-1].getTrimmedLength(),$=(0,S.reflowSmallerGetNewLineLengths)(D,this._cols,_),N=$.length-D.length;let q;q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const K=[];for(let P=0;P<N;P++){const I=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);K.push(I)}K.length>0&&(T.push({start:M+D.length+A,newLines:K}),A+=K.length),D.push(...K);let V=$.length-1,Y=$[V];Y===0&&(V--,Y=$[V]);let G=D.length-N-1,j=H;for(;G>=0;){const P=Math.min(j,Y);if(D[V]===void 0)break;if(D[V].copyCellsFrom(D[G],j-P,Y-P,P,!0),Y-=P,Y===0&&(V--,Y=$[V]),j-=P,j===0){G--;const I=Math.max(G,0);j=(0,S.getWrappedLineTrimmedLength)(D,I,this._cols)}}for(let P=0;P<D.length;P++)$[P]<_&&D[P].setCell($[P],E);let W=N-q;for(;W-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+y-1)}if(T.length>0){const M=[],L=[];for(let V=0;V<this.lines.length;V++)L.push(this.lines.get(V));const D=this.lines.length;let z=D-1,H=0,$=T[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let N=0;for(let V=Math.min(this.lines.maxLength-1,D+A-1);V>=0;V--)if($&&$.start>z+N){for(let Y=$.newLines.length-1;Y>=0;Y--)this.lines.set(V--,$.newLines[Y]);V++,M.push({index:z+1,amount:$.newLines.length}),N+=$.newLines.length,$=T[++H]}else this.lines.set(V,L[z--]);let q=0;for(let V=M.length-1;V>=0;V--)M[V].index+=q,this.lines.onInsertEmitter.fire(M[V]),q+=M[V].amount;const K=Math.max(0,D+A-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(_,y,E=0,T){const A=this.lines.get(_);return A?A.translateToString(y,E,T):""}getWrappedRangeForLine(_){let y=_,E=_;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===_&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const y=new b.Marker(_);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=l(3734),p=l(511),f=l(643),g=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class C{constructor(b,x,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=x||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){const x=this._data[3*b+0],_=2097151&x;return[this._data[3*b+1],2097152&x?this._combined[b]:_?(0,g.stringFromCodePoint)(_):"",x>>22,2097152&x?this._combined[b].charCodeAt(this._combined[b].length-1):_]}set(b,x){this._data[3*b+1]=x[f.CHAR_DATA_ATTR_INDEX],x[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=x[1],this._data[3*b+0]=2097152|b|x[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=x[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const x=this._data[3*b+0];return 2097152&x?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&x}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const x=this._data[3*b+0];return 2097152&x?this._combined[b]:2097151&x?(0,g.stringFromCodePoint)(2097151&x):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,x){return S=3*b,x.content=this._data[S+0],x.fg=this._data[S+1],x.bg=this._data[S+2],2097152&x.content&&(x.combinedData=this._combined[b]),268435456&x.bg&&(x.extended=this._extendedAttrs[b]),x}setCell(b,x){2097152&x.content&&(this._combined[b]=x.combinedData),268435456&x.bg&&(this._extendedAttrs[b]=x.extended),this._data[3*b+0]=x.content,this._data[3*b+1]=x.fg,this._data[3*b+2]=x.bg}setCellFromCodepoint(b,x,_,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=x|_<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,x,_){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,g.stringFromCodePoint)(x):2097151&y?(this._combined[b]=(0,g.stringFromCodePoint)(2097151&y)+(0,g.stringFromCodePoint)(x),y&=-2097152,y|=2097152):y=x|4194304,_&&(y&=-12582913,y|=_<<22),this._data[3*b+0]=y}insertCells(b,x,_){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),x<this.length-b){const y=new p.CellData;for(let E=this.length-b-x-1;E>=0;--E)this.setCell(b+x+E,this.loadCell(b+E,y));for(let E=0;E<x;++E)this.setCell(b+E,_)}else for(let y=b;y<this.length;++y)this.setCell(y,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(b,x,_){if(b%=this.length,x<this.length-b){const y=new p.CellData;for(let E=0;E<this.length-b-x;++E)this.setCell(b+E,this.loadCell(b+x+E,y));for(let E=this.length-x;E<this.length;++E)this.setCell(E,_)}else for(let y=b;y<this.length;++y)this.setCell(y,_);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,_)}replaceCells(b,x,_,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,_),x<this.length&&this.getWidth(x-1)===2&&!this.isProtected(x)&&this.setCellFromCodepoint(x,0,1,_);b<x&&b<this.length;)this.isProtected(b)||this.setCell(b,_),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),x<this.length&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x,0,1,_);b<x&&b<this.length;)this.setCell(b++,_)}resize(b,x){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const y=new Uint32Array(_);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,x)}else{this._data=this._data.subarray(0,_);const y=Object.keys(this._combined);for(let T=0;T<y.length;T++){const A=parseInt(y[T],10);A>=b&&delete this._combined[A]}const E=Object.keys(this._extendedAttrs);for(let T=0;T<E.length;T++){const A=parseInt(E[T],10);A>=b&&delete this._extendedAttrs[A]}}return this.length=b,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,x=!1){if(x)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,b);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const x in b._combined)this._combined[x]=b._combined[x];this._extendedAttrs={};for(const x in b._extendedAttrs)this._extendedAttrs[x]=b._extendedAttrs[x];this.isWrapped=b.isWrapped}clone(){const b=new C(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const x in this._combined)b._combined[x]=this._combined[x];for(const x in this._extendedAttrs)b._extendedAttrs[x]=this._extendedAttrs[x];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,x,_,y,E){const T=b._data;if(E)for(let M=y-1;M>=0;M--){for(let L=0;L<3;L++)this._data[3*(_+M)+L]=T[3*(x+M)+L];268435456&T[3*(x+M)+2]&&(this._extendedAttrs[_+M]=b._extendedAttrs[x+M])}else for(let M=0;M<y;M++){for(let L=0;L<3;L++)this._data[3*(_+M)+L]=T[3*(x+M)+L];268435456&T[3*(x+M)+2]&&(this._extendedAttrs[_+M]=b._extendedAttrs[x+M])}const A=Object.keys(b._combined);for(let M=0;M<A.length;M++){const L=parseInt(A[M],10);L>=x&&(this._combined[L-x+_]=b._combined[L])}}translateToString(b,x,_,y){x=x??0,_=_??this.length,b&&(_=Math.min(_,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;x<_;){const T=this._data[3*x+0],A=2097151&T,M=2097152&T?this._combined[x]:A?(0,g.stringFromCodePoint)(A):f.WHITESPACE_CELL_CHAR;if(E+=M,y)for(let L=0;L<M.length;++L)y.push(x);x+=T>>22||1}return y&&y.push(x),E}}a.BufferLine=C},4841:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,d){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return d*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(h,a)=>{function l(d,p,f){if(p===d.length-1)return d[p].getTrimmedLength();const g=!d[p].hasContent(f-1)&&d[p].getWidth(f-1)===1,S=d[p+1].getWidth(0)===2;return g&&S?f-1:f}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,p,f,g,S){const C=[];for(let w=0;w<d.length-1;w++){let b=w,x=d.get(++b);if(!x.isWrapped)continue;const _=[d.get(w)];for(;b<d.length&&x.isWrapped;)_.push(x),x=d.get(++b);if(g>=w&&g<b){w+=_.length-1;continue}let y=0,E=l(_,y,p),T=1,A=0;for(;T<_.length;){const L=l(_,T,p),D=L-A,z=f-E,H=Math.min(D,z);_[y].copyCellsFrom(_[T],A,E,H,!1),E+=H,E===f&&(y++,E=0),A+=H,A===L&&(T++,A=0),E===0&&y!==0&&_[y-1].getWidth(f-1)===2&&(_[y].copyCellsFrom(_[y-1],f-1,E++,1,!1),_[y-1].setCell(f-1,S))}_[y].replaceCells(E,f,S);let M=0;for(let L=_.length-1;L>0&&(L>y||_[L].getTrimmedLength()===0);L--)M++;M>0&&(C.push(w+_.length-M),C.push(M)),w+=_.length-1}return C},a.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,S=p[g],C=0;for(let w=0;w<d.length;w++)if(S===w){const b=p[++g];d.onDeleteEmitter.fire({index:w-C,amount:b}),w+=b-1,C+=b,S=p[++g]}else f.push(w);return{layout:f,countRemoved:C}},a.reflowLargerApplyNewLayout=function(d,p){const f=[];for(let g=0;g<p.length;g++)f.push(d.get(p[g]));for(let g=0;g<f.length;g++)d.set(g,f[g]);d.length=p.length},a.reflowSmallerGetNewLineLengths=function(d,p,f){const g=[],S=d.map(((x,_)=>l(d,_,p))).reduce(((x,_)=>x+_));let C=0,w=0,b=0;for(;b<S;){if(S-b<f){g.push(S-b);break}C+=f;const x=l(d,w,p);C>x&&(C-=x,w++);const _=d[w].getWidth(C-1)===2;_&&C--;const y=_?f-1:f;g.push(y),b+=y}return g},a.getWrappedLineTrimmedLength=l},5295:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=l(8460),p=l(844),f=l(9092);class g extends p.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=g},511:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=l(482),p=l(643),f=l(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new g;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const b=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const x=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=x&&x<=57343?this.content=1024*(b-55296)+x-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=l(8460),p=l(844);class f{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=f,f._nextId=1},7116:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(h,a)=>{var l,d,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
33
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(l||(a.C0=l={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(a.C1=d={})),(function(f){f.ST=`${l.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=l(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(f,g,S,C){const w={type:0,cancel:!1,key:void 0},b=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,f.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;b?(w.key=d.C0.ESC+"[1;"+(b+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(S?"b":"[1;5D"))):w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;b?(w.key=d.C0.ESC+"[1;"+(b+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(S?"f":"[1;5C"))):w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;b?(w.key=d.C0.ESC+"[1;"+(b+1)+"A",S||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;b?(w.key=d.C0.ESC+"[1;"+(b+1)+"B",S||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=b?d.C0.ESC+"[3;"+(b+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=b?d.C0.ESC+"[1;"+(b+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=b?d.C0.ESC+"[1;"+(b+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=d.C0.ESC+"[5;"+(b+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=d.C0.ESC+"[6;"+(b+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=b?d.C0.ESC+"[1;"+(b+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=b?d.C0.ESC+"[1;"+(b+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=b?d.C0.ESC+"[1;"+(b+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=b?d.C0.ESC+"[1;"+(b+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=b?d.C0.ESC+"[15;"+(b+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=b?d.C0.ESC+"[17;"+(b+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=b?d.C0.ESC+"[18;"+(b+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=b?d.C0.ESC+"[19;"+(b+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=b?d.C0.ESC+"[20;"+(b+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=b?d.C0.ESC+"[21;"+(b+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=b?d.C0.ESC+"[23;"+(b+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=b?d.C0.ESC+"[24;"+(b+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(S&&!C||!f.altKey||f.metaKey)!S||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=d.C0.US),f.key==="@"&&(w.key=d.C0.NUL)):f.keyCode===65&&(w.type=1);else{const x=p[f.keyCode],_=x?.[f.shiftKey?1:0];if(_)w.key=d.C0.ESC+_;else if(f.keyCode>=65&&f.keyCode<=90){const y=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(y);f.shiftKey&&(E=E.toUpperCase()),w.key=d.C0.ESC+E}else if(f.keyCode===32)w.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let y=f.code.slice(3,4);f.shiftKey||(y=y.toLowerCase()),w.key=d.C0.ESC+y,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=d.C0.DEL:f.keyCode===219?w.key=d.C0.ESC:f.keyCode===220?w.key=d.C0.FS:f.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,d=0,p=l.length){let f="";for(let g=d;g<p;++g){let S=l[g];S>65535?(S-=65536,f+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):f+=String.fromCharCode(S)}return f},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,d){const p=l.length;if(!p)return 0;let f=0,g=0;if(this._interim){const S=l.charCodeAt(g++);56320<=S&&S<=57343?d[f++]=1024*(this._interim-55296)+S-56320+65536:(d[f++]=this._interim,d[f++]=S),this._interim=0}for(let S=g;S<p;++S){const C=l.charCodeAt(S);if(55296<=C&&C<=56319){if(++S>=p)return this._interim=C,f;const w=l.charCodeAt(S);56320<=w&&w<=57343?d[f++]=1024*(C-55296)+w-56320+65536:(d[f++]=C,d[f++]=w)}else C!==65279&&(d[f++]=C)}return f}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,d){const p=l.length;if(!p)return 0;let f,g,S,C,w=0,b=0,x=0;if(this.interim[0]){let E=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let A,M=0;for(;(A=63&this.interim[++M])&&M<4;)T<<=6,T|=A;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=L-M;for(;x<D;){if(x>=p)return 0;if(A=l[x++],(192&A)!=128){x--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?x--:d[w++]=T:L===3?T<2048||T>=55296&&T<=57343||T===65279||(d[w++]=T):T<65536||T>1114111||(d[w++]=T)),this.interim.fill(0)}const _=p-4;let y=x;for(;y<p;){for(;!(!(y<_)||128&(f=l[y])||128&(g=l[y+1])||128&(S=l[y+2])||128&(C=l[y+3]));)d[w++]=f,d[w++]=g,d[w++]=S,d[w++]=C,y+=4;if(f=l[y++],f<128)d[w++]=f;else if((224&f)==192){if(y>=p)return this.interim[0]=f,w;if(g=l[y++],(192&g)!=128){y--;continue}if(b=(31&f)<<6|63&g,b<128){y--;continue}d[w++]=b}else if((240&f)==224){if(y>=p)return this.interim[0]=f,w;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[y++],(192&S)!=128){y--;continue}if(b=(15&f)<<12|(63&g)<<6|63&S,b<2048||b>=55296&&b<=57343||b===65279)continue;d[w++]=b}else if((248&f)==240){if(y>=p)return this.interim[0]=f,w;if(g=l[y++],(192&g)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,w;if(S=l[y++],(192&S)!=128){y--;continue}if(y>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=S,w;if(C=l[y++],(192&C)!=128){y--;continue}if(b=(7&f)<<18|(63&g)<<12|(63&S)<<6|63&C,b<65536||b>1114111)continue;d[w++]=b}}return w}}},225:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=l(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let S=0;S<p.length;++S)g.fill(0,p[S][0],p[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?g[S]:(function(C,w){let b,x=0,_=w.length-1;if(C<w[0][0]||C>w[_][1])return!1;for(;_>=x;)if(b=x+_>>1,C>w[b][1])x=b+1;else{if(!(C<w[b][0]))return!0;_=b-1}return!1})(S,f)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,C){let w=this.wcwidth(S),b=w===0&&C!==0;if(b){const x=d.UnicodeService.extractWidth(C);x===0?b=!1:x>w&&(w=x)}return d.UnicodeService.createPropertyValue(0,w,b)}}},5981:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=l(8460),p=l(844);class f extends p.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C)}_innerWrite(S=0,C=!0){const w=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],x=this._action(b,C);if(x){const y=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void x.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=f},5941:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\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})$/,d=/^[\da-f]+$/;function p(f,g){const S=f.toString(16),C=S.length<2?"0"+S:S;switch(g){case 4:return S[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const S=l.exec(g);if(S){const C=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/C*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/C*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const S=g.length/3,C=[0,0,0];for(let w=0;w<3;++w){const b=parseInt(g.slice(S*w,S*w+S),16);C[w]=S===1?b<<4:S===2?b:S===3?b>>4:b>>8}return C}},a.toRgbString=function(f,g=16){const[S,C,w]=f;return`rgb:${p(S,g)}/${p(C,g)}/${p(w,g)}`}},5770:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=l(482),p=l(8742),f=l(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const b=this._handlers[C];return b.push(w),{dispose:()=>{const x=b.indexOf(w);x!==-1&&b.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,b){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,w,b);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,w,b))}unhook(C,w=!0){if(this._active.length){let b=!1,x=this._active.length-1,_=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,b=w,_=this._stack.fallThrough,this._stack.paused=!1),!_&&b===!1){for(;x>=0&&(b=this._active[x].unhook(C),b!==!0);x--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,b;x--}for(;x>=0;x--)if(b=this._active[x].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const S=new p.Params;S.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=S,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():S,this._data="",this._hitLimit=!1}put(C,w,b){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,w,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((b=>(this._params=S,this._data="",this._hitLimit=!1,b)));return this._params=S,this._data="",this._hitLimit=!1,w}}},2015:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=l(844),p=l(8742),f=l(6242),g=l(6351);class S{constructor(x){this.table=new Uint8Array(x)}setDefault(x,_){this.table.fill(x<<4|_)}add(x,_,y,E){this.table[_<<8|x]=y<<4|E}addMany(x,_,y,E){for(let T=0;T<x.length;T++)this.table[_<<8|x[T]]=y<<4|E}}a.TransitionTable=S;const C=160;a.VT500_TRANSITION_TABLE=(function(){const b=new S(4095),x=Array.apply(null,Array(256)).map(((M,L)=>L)),_=(M,L)=>x.slice(M,L),y=_(32,127),E=_(0,24);E.push(25),E.push.apply(E,_(28,32));const T=_(0,14);let A;for(A in b.setDefault(1,0),b.addMany(y,0,2,0),T)b.addMany([24,26,153,154],A,3,0),b.addMany(_(128,144),A,3,0),b.addMany(_(144,152),A,3,0),b.add(156,A,0,0),b.add(27,A,11,1),b.add(157,A,4,8),b.addMany([152,158,159],A,0,7),b.add(155,A,11,3),b.add(144,A,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(_(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(_(64,127),3,7,0),b.addMany(_(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(_(48,60),4,8,4),b.addMany(_(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(_(32,64),6,0,6),b.add(127,6,0,6),b.addMany(_(64,127),6,0,0),b.addMany(_(32,48),3,9,5),b.addMany(_(32,48),5,9,5),b.addMany(_(48,64),5,0,6),b.addMany(_(64,127),5,7,0),b.addMany(_(32,48),4,9,5),b.addMany(_(32,48),1,9,2),b.addMany(_(32,48),2,9,2),b.addMany(_(48,127),2,10,0),b.addMany(_(48,80),1,10,0),b.addMany(_(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(_(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(_(28,32),9,0,9),b.addMany(_(32,48),9,9,12),b.addMany(_(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(_(32,128),11,0,11),b.addMany(_(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(_(28,32),10,0,10),b.addMany(_(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(_(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(_(28,32),12,0,12),b.addMany(_(32,48),12,9,12),b.addMany(_(48,64),12,0,11),b.addMany(_(64,127),12,12,13),b.addMany(_(64,127),10,12,13),b.addMany(_(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(C,0,2,0),b.add(C,8,5,8),b.add(C,6,0,6),b.add(C,11,0,11),b.add(C,13,13,13),b})();class w extends d.Disposable{constructor(x=a.VT500_TRANSITION_TABLE){super(),this._transitions=x,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,y,E)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,y)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(x,_=[64,126]){let y=0;if(x.prefix){if(x.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=x.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(x.intermediates){if(x.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<x.intermediates.length;++T){const A=x.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=A}}if(x.final.length!==1)throw new Error("final must be a single byte");const E=x.final.charCodeAt(0);if(_[0]>E||E>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return y<<=8,y|=E,y}identToString(x){const _=[];for(;x;)_.push(String.fromCharCode(255&x)),x>>=8;return _.reverse().join("")}setPrintHandler(x){this._printHandler=x}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(x,_){const y=this._identifier(x,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(_),{dispose:()=>{const T=E.indexOf(_);T!==-1&&E.splice(T,1)}}}clearEscHandler(x){this._escHandlers[this._identifier(x,[48,126])]&&delete this._escHandlers[this._identifier(x,[48,126])]}setEscHandlerFallback(x){this._escHandlerFb=x}setExecuteHandler(x,_){this._executeHandlers[x.charCodeAt(0)]=_}clearExecuteHandler(x){this._executeHandlers[x.charCodeAt(0)]&&delete this._executeHandlers[x.charCodeAt(0)]}setExecuteHandlerFallback(x){this._executeHandlerFb=x}registerCsiHandler(x,_){const y=this._identifier(x);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(_),{dispose:()=>{const T=E.indexOf(_);T!==-1&&E.splice(T,1)}}}clearCsiHandler(x){this._csiHandlers[this._identifier(x)]&&delete this._csiHandlers[this._identifier(x)]}setCsiHandlerFallback(x){this._csiHandlerFb=x}registerDcsHandler(x,_){return this._dcsParser.registerHandler(this._identifier(x),_)}clearDcsHandler(x){this._dcsParser.clearHandler(this._identifier(x))}setDcsHandlerFallback(x){this._dcsParser.setHandlerFallback(x)}registerOscHandler(x,_){return this._oscParser.registerHandler(x,_)}clearOscHandler(x){this._oscParser.clearHandler(x)}setOscHandlerFallback(x){this._oscParser.setHandlerFallback(x)}setErrorHandler(x){this._errorHandler=x}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(x,_,y,E,T){this._parseStack.state=x,this._parseStack.handlers=_,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(x,_,y){let E,T=0,A=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const L=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(E=L[D](this._params),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(E=L[D](),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 6:if(T=x[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=x[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,y),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let L=M;L<_;++L){switch(T=x[L],A=this._transitions.table[this.currentState<<8|(T<160?T:C)],A>>4){case 2:for(let N=L+1;;++N){if(N>=_||(T=x[N])<32||T>126&&T<C){this._printHandler(x,L,N),L=N-1;break}if(++N>=_||(T=x[N])<32||T>126&&T<C){this._printHandler(x,L,N),L=N-1;break}if(++N>=_||(T=x[N])<32||T>126&&T<C){this._printHandler(x,L,N),L=N-1;break}if(++N>=_||(T=x[N])<32||T>126&&T<C){this._printHandler(x,L,N),L=N-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:L,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|T];let z=D?D.length-1:-1;for(;z>=0&&(E=D[z](this._params),E!==!0);z--)if(E instanceof Promise)return this._preserveStack(3,D,z,A,L),E;z<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++L<_&&(T=x[L])>47&&T<60);L--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const H=this._escHandlers[this._collect<<8|T];let $=H?H.length-1:-1;for(;$>=0&&(E=H[$](),E!==!0);$--)if(E instanceof Promise)return this._preserveStack(4,H,$,A,L),E;$<0&&this._escHandlerFb(this._collect<<8|T),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let N=L+1;;++N)if(N>=_||(T=x[N])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(x,L,N),L=N-1;break}break;case 14:if(E=this._dcsParser.unhook(T!==24&&T!==26),E)return this._preserveStack(6,[],0,A,L),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let N=L+1;;N++)if(N>=_||(T=x[N])<32||T>127&&T<C){this._oscParser.put(x,L,N),L=N-1;break}break;case 6:if(E=this._oscParser.end(T!==24&&T!==26),E)return this._preserveStack(5,[],0,A,L),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}a.EscapeSequenceParser=w},6242:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=l(5770),p=l(482),f=[];a.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,S){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(S),{dispose:()=>{const w=C.indexOf(S);w!==-1&&C.splice(w,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,S,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(g,S,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,S,C))}start(){this.reset(),this._state=1}put(g,S,C){if(this._state!==3){if(this._state===1)for(;S<C;){const w=g[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&C-S>0&&this._put(g,S,C)}}end(g,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,b=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=S,b=this._stack.fallThrough,this._stack.paused=!1),!b&&C===!1){for(;w>=0&&(C=this._active[w].end(g),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,S,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,S,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let S=!1;if(this._hitLimit)S=!1;else if(g&&(S=this._handler(this._data),S instanceof Promise))return S.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,S}}},8742:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let S=Array.isArray(f[0])?1:0;S<f.length;++S){const C=f[S];if(Array.isArray(C))for(let w=0;w<C.length;++w)g.addSubParam(C[w]);else g.addParam(C)}return g}constructor(f=32,g=32){if(this.maxLength=f,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g<this.length;++g){f.push(this.params[g]);const S=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-S>0&&f.push(Array.prototype.slice.call(this._subParams,S,C))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>l?l:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>l?l:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];return S-g>0?this._subParams.subarray(g,S):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const S=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-S>0&&(f[g]=this._subParams.slice(S,C))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,C=S[g-1];S[g-1]=~C?Math.min(10*C+f,l):f}}a.Params=d},5741:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===l){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(d,1)}}},8771:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=l(3785),p=l(511);a.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,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(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=l(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new d.CellData)}translateToString(p,f,g){return this._line.translateToString(p,f,g)}}},8285:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=l(8771),p=l(8460),f=l(844);class g extends f.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=g},7975:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,d){return this._core.registerCsiHandler(l,(p=>d(p.toArray())))}addCsiHandler(l,d){return this.registerCsiHandler(l,d)}registerDcsHandler(l,d){return this._core.registerDcsHandler(l,((p,f)=>d(p,f.toArray())))}addDcsHandler(l,d){return this.registerDcsHandler(l,d)}registerEscHandler(l,d){return this._core.registerEscHandler(l,d)}addEscHandler(l,d){return this.registerEscHandler(l,d)}registerOscHandler(l,d){return this._core.registerOscHandler(l,d)}addOscHandler(l,d){return this.registerOscHandler(l,d)}}},7090:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(h,a,l){var d=this&&this.__decorate||function(b,x,_,y){var E,T=arguments.length,A=T<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,x,_,y);else for(var M=b.length-1;M>=0;M--)(E=b[M])&&(A=(T<3?E(A):T>3?E(x,_,A):E(x,_))||A);return T>3&&A&&Object.defineProperty(x,_,A),A},p=this&&this.__param||function(b,x){return function(_,y){x(_,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=l(8460),g=l(844),S=l(5295),C=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(b,this))}resize(b,x){this.cols=b,this.rows=x,this.buffers.resize(b,x),this._onResize.fire({cols:b,rows:x})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,x=!1){const _=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=_.getBlankLine(b,x),this._cachedBlankLine=y),y.isWrapped=x;const E=_.ybase+_.scrollTop,T=_.ybase+_.scrollBottom;if(_.scrollTop===0){const A=_.lines.isFull;T===_.lines.length-1?A?_.lines.recycle().copyFrom(y):_.lines.push(y.clone()):_.lines.splice(T+1,0,y.clone()),A?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const A=T-E+1;_.lines.shiftElements(E+1,A-1,-1),_.lines.set(T,y.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(b,x,_){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(x||this._onScroll.fire(y.ydisp))}};a.BufferService=w=d([p(0,C.IOptionsService)],w)},7994:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,d){this._charsets[l]=d,this.glevel===l&&(this.charset=d)}}},1753:function(h,a,l){var d=this&&this.__decorate||function(y,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,E,T,A);else for(var z=y.length-1;z>=0;z--)(M=y[z])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(y,E){return function(T,A){E(T,A,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=l(2585),g=l(8460),S=l(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function w(y,E){let T=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(T|=64,T|=y.action):(T|=3&y.button,4&y.button&&(T|=64),8&y.button&&(T|=128),y.action===32?T|=32:y.action!==0||E||(T|=3)),T}const b=String.fromCharCode,x={DEFAULT:y=>{const E=[w(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.x};${y.y}${E}`}};let _=a.CoreMouseService=class extends S.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(x))this.addEncoding(T,x[T]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,T){if(T){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};a.CoreMouseService=_=d([p(0,f.IBufferService),p(1,f.ICoreService)],_)},6975:function(h,a,l){var d=this&&this.__decorate||function(_,y,E,T){var A,M=arguments.length,L=M<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(_,y,E,T);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(L=(M<3?A(L):M>3?A(y,E,L):A(y,E))||L);return M>3&&L&&Object.defineProperty(y,E,L),L},p=this&&this.__param||function(_,y){return function(E,T){y(E,T,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=l(1439),g=l(8460),S=l(844),C=l(2585),w=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let x=a.CoreService=class extends S.Disposable{constructor(_,y,E){super(),this._bufferService=_,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(b)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(b)}triggerDataEvent(_,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(_))}};a.CoreService=x=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],x)},9074:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=l(8055),p=l(8460),f=l(844),g=l(6106);let S=0,C=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((_=>_?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const y=new b(_);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,y,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(y))T=M.options.x??0,A=T+(M.options.width??1),_>=T&&_<A&&(!E||(M.options.layer??"bottom")===E)&&(yield M)}forEachDecorationAtCell(_,y,E,T){this._decorations.forEachByKey(y,(A=>{S=A.options.x??0,C=S+(A.options.width??1),_>=S&&_<C&&(!E||(A.options.layer??"bottom")===E)&&T(A)}))}}a.DecorationService=w;class b extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(_){super(),this.options=_,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=l(2585),p=l(8343);class f{constructor(...S){this._entries=new Map;for(const[C,w]of S)this.set(C,w)}set(S,C){const w=this._entries.get(S);return this._entries.set(S,C),w}forEach(S){for(const[C,w]of this._entries.entries())S(C,w)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,S){this._services.set(g,S)}getService(g){return this._services.get(g)}createInstance(g,...S){const C=(0,p.getServiceDependencies)(g).sort(((x,_)=>x.index-_.index)),w=[];for(const x of C){const _=this._services.get(x.id);if(!_)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${x.id}.`);w.push(_)}const b=C.length>0?C[0].index:S.length;if(S.length!==b)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${b+1} conflicts with ${S.length} static arguments`);return new g(...S,...w)}}},7866:function(h,a,l){var d=this&&this.__decorate||function(b,x,_,y){var E,T=arguments.length,A=T<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,x,_,y);else for(var M=b.length-1;M>=0;M--)(E=b[M])&&(A=(T<3?E(A):T>3?E(x,_,A):E(x,_))||A);return T>3&&A&&Object.defineProperty(x,_,A),A},p=this&&this.__param||function(b,x){return function(_,y){x(_,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=l(844),g=l(2585),S={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,w=a.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let x=0;x<b.length;x++)typeof b[x]=="function"&&(b[x]=b[x]())}_log(b,x,_){this._evalLazyOptionalParams(_),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+x,..._)}trace(b,...x){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,b,x)}debug(b,...x){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,b,x)}info(b,...x){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,b,x)}warn(b,...x){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,b,x)}error(b,...x){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,b,x)}};a.LogService=w=d([p(0,g.IOptionsService)],w),a.setTraceLogger=function(b){C=b},a.traceCall=function(b,x,_){if(typeof _.value!="function")throw new Error("not supported");const y=_.value;_.value=function(...E){if(C.logLevel!==g.LogLevelEnum.TRACE)return y.apply(this,E);C.trace(`GlyphRenderer#${y.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=y.apply(this,E);return C.trace(`GlyphRenderer#${y.name} return`,T),T}}},7302:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=l(8460),p=l(844),f=l(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...a.DEFAULT_OPTIONS};for(const x in w)if(x in b)try{const _=w[x];b[x]=this._sanitizeAndValidateOption(x,_)}catch(_){console.error(_)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,b){return this.onOptionChange((x=>{x===w&&b(this.rawOptions[w])}))}onMultipleOptionChange(w,b){return this.onOptionChange((x=>{w.indexOf(x)!==-1&&b()}))}_setupOptions(){const w=x=>{if(!(x in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);return this.rawOptions[x]},b=(x,_)=>{if(!(x in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${x}"`);_=this._sanitizeAndValidateOption(x,_),this.rawOptions[x]!==_&&(this.rawOptions[x]=_,this._onOptionChange.fire(x))};for(const x in this.rawOptions){const _={get:w.bind(this,x),set:b.bind(this,x)};Object.defineProperty(this.options,x,_)}}_sanitizeAndValidateOption(w,b){switch(w){case"cursorStyle":if(b||(b=a.DEFAULT_OPTIONS[w]),!(function(x){return x==="block"||x==="underline"||x==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${w}`);break;case"wordSeparator":b||(b=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=g.includes(b)?b:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${w} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${w} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}a.OptionsService=S},2660:function(h,a,l){var d=this&&this.__decorate||function(S,C,w,b){var x,_=arguments.length,y=_<3?C:b===null?b=Object.getOwnPropertyDescriptor(C,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(S,C,w,b);else for(var E=S.length-1;E>=0;E--)(x=S[E])&&(y=(_<3?x(y):_>3?x(C,w,y):x(C,w))||y);return _>3&&y&&Object.defineProperty(C,w,y),y},p=this&&this.__param||function(S,C){return function(w,b){C(w,b,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=l(2585);let g=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const C=this._bufferService.buffer;if(S.id===void 0){const E=C.addMarker(C.ybase+C.y),T={data:S,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const w=S,b=this._getEntryIdKey(w),x=this._entriesWithId.get(b);if(x)return this.addLineToLink(x.id,C.ybase+C.y),x.id;const _=C.addMarker(C.ybase+C.y),y={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(y,_))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(S,C){const w=this._dataByLinkId.get(S);if(w&&w.lines.every((b=>b.line!==C))){const b=this._bufferService.buffer.addMarker(C);w.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(w,b)))}}getLinkData(S){return this._dataByLinkId.get(S)?.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,C){const w=S.lines.indexOf(C);w!==-1&&(S.lines.splice(w,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=g=d([p(0,f.IBufferService)],g)},8343:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[d]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const f=function(g,S,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,b,x){b[l]===b?b[d].push({id:w,index:x}):(b[d]=[{id:w,index:x}],b[l]=b)})(f,g,C)};return f.toString=()=>p,a.serviceRegistry.set(p,f),f}},2585:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=l(8343);var p;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=l(8460),p=l(225);class f{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,C,w=!1){return(16777215&S)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const S=new p.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let C=0,w=0;const b=S.length;for(let x=0;x<b;++x){let _=S.charCodeAt(x);if(55296<=_&&_<=56319){if(++x>=b)return C+this.wcwidth(_);const T=S.charCodeAt(x);56320<=T&&T<=57343?_=1024*(_-55296)+T-56320+65536:C+=this.wcwidth(T)}const y=this.charProperties(_,w);let E=f.extractWidth(y);f.extractShouldJoin(y)&&(E-=f.extractWidth(w)),C+=E,w=y}return C}charProperties(S,C){return this._activeProvider.charProperties(S,C)}}a.UnicodeService=f}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var l=s[h]={exports:{}};return n[h].call(l.exports,l,l.exports,o),l.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.Terminal=void 0;const a=o(9042),l=o(3236),d=o(844),p=o(5741),f=o(8285),g=o(7975),S=o(7090),C=["cols","rows"];class w extends d.Disposable{constructor(x){super(),this._core=this.register(new l.Terminal(x)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const _=E=>this._core.options[E],y=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:_.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(x){if(C.includes(x))throw new Error(`Option "${x}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const x=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:x.applicationCursorKeys,applicationKeypadMode:x.applicationKeypad,bracketedPasteMode:x.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:x.origin,reverseWraparoundMode:x.reverseWraparound,sendFocusMode:x.sendFocus,wraparoundMode:x.wraparound}}get options(){return this._publicOptions}set options(x){for(const _ in x)this._publicOptions[_]=x[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(x,_=!0){this._core.input(x,_)}resize(x,_){this._verifyIntegers(x,_),this._core.resize(x,_)}open(x){this._core.open(x)}attachCustomKeyEventHandler(x){this._core.attachCustomKeyEventHandler(x)}attachCustomWheelEventHandler(x){this._core.attachCustomWheelEventHandler(x)}registerLinkProvider(x){return this._core.registerLinkProvider(x)}registerCharacterJoiner(x){return this._checkProposedApi(),this._core.registerCharacterJoiner(x)}deregisterCharacterJoiner(x){this._checkProposedApi(),this._core.deregisterCharacterJoiner(x)}registerMarker(x=0){return this._verifyIntegers(x),this._core.registerMarker(x)}registerDecoration(x){return this._checkProposedApi(),this._verifyPositiveIntegers(x.x??0,x.width??0,x.height??0),this._core.registerDecoration(x)}hasSelection(){return this._core.hasSelection()}select(x,_,y){this._verifyIntegers(x,_,y),this._core.select(x,_,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(x,_){this._verifyIntegers(x,_),this._core.selectLines(x,_)}dispose(){super.dispose()}scrollLines(x){this._verifyIntegers(x),this._core.scrollLines(x)}scrollPages(x){this._verifyIntegers(x),this._core.scrollPages(x)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(x){this._verifyIntegers(x),this._core.scrollToLine(x)}clear(){this._core.clear()}write(x,_){this._core.write(x,_)}writeln(x,_){this._core.write(x),this._core.write(`\r
34
+ `,_)}paste(x){this._core.paste(x)}refresh(x,_){this._verifyIntegers(x,_),this._core.refresh(x,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(x){this._addonManager.loadAddon(this,x)}static get strings(){return a}_verifyIntegers(...x){for(const _ of x)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...x){for(const _ of x)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}h.Terminal=w})(),u})()))})(Lv)),Lv.exports}var Zk=QN(),Av={exports:{}},lw;function ZN(){return lw||(lw=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const h=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=l-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-h;return{cols:Math.max(2,Math.floor(g/u.css.cell.width)),rows:Math.max(1,Math.floor(f/u.css.cell.height))}}}})(),n})()))})(Av)),Av.exports}var Jk=ZN(),Ov={exports:{}},cw;function JN(){return cw||(cw=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={6:(h,a)=>{function l(p){try{const f=new URL(p),g=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return p.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,f,g,S={}){this._terminal=p,this._regex=f,this._handler=g,this._options=S}provideLinks(p,f){const g=d.computeLink(p,this._regex,this._terminal,this._handler);f(this._addCallbacks(g))}_addCallbacks(p){return p.map((f=>(f.leave=this._options.leave,f.hover=(g,S)=>{if(this._options.hover){const{range:C}=f;this._options.hover(g,S,C)}},f)))}};class d{static computeLink(f,g,S,C){const w=new RegExp(g.source,(g.flags||"")+"g"),[b,x]=d._getWindowedLineStrings(f-1,S),_=b.join("");let y;const E=[];for(;y=w.exec(_);){const T=y[0];if(!l(T))continue;const[A,M]=d._mapStrIdx(S,x,0,y.index),[L,D]=d._mapStrIdx(S,A,M,T.length);if(A===-1||M===-1||L===-1||D===-1)continue;const z={start:{x:M+1,y:A+1},end:{x:D,y:L+1}};E.push({range:z,text:T,activate:C})}return E}static _getWindowedLineStrings(f,g){let S,C=f,w=f,b=0,x="";const _=[];if(S=g.buffer.active.getLine(f)){const y=S.translateToString(!0);if(S.isWrapped&&y[0]!==" "){for(b=0;(S=g.buffer.active.getLine(--C))&&b<2048&&(x=S.translateToString(!0),b+=x.length,_.push(x),S.isWrapped&&x.indexOf(" ")===-1););_.reverse()}for(_.push(y),b=0;(S=g.buffer.active.getLine(++w))&&S.isWrapped&&b<2048&&(x=S.translateToString(!0),b+=x.length,_.push(x),x.indexOf(" ")===-1););}return[_,C]}static _mapStrIdx(f,g,S,C){const w=f.buffer.active,b=w.getNullCell();let x=S;for(;C;){const _=w.getLine(g);if(!_)return[-1,-1];for(let y=x;y<_.length;++y){_.getCell(y,b);const E=b.getChars();if(b.getWidth()&&(C-=E.length||1,y===_.length-1&&E==="")){const T=w.getLine(g+1);T&&T.isWrapped&&(T.getCell(0,b),b.getWidth()===2&&(C+=1))}if(C<0)return[g,y]}g++,x=0}return[g,x]}}a.LinkComputer=d}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var l=s[h]={exports:{}};return n[h](l,l.exports,o),l.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.WebLinksAddon=void 0;const a=o(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(p,f){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}h.WebLinksAddon=class{constructor(p=d,f={}){this._handler=p,this._options=f}activate(p){this._terminal=p;const f=this._options,g=f.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,f))}dispose(){this._linkProvider?.dispose()}}})(),u})()))})(Ov)),Ov.exports}var eT=JN();function Pp(){const[e,t]=R.useState(!1);return R.useEffect(()=>{const n=window.matchMedia("(max-width: 639px)");t(n.matches);const s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}const e7=[{label:"Esc",icon:Si,data:"\x1B"},{label:"Up",icon:u0,data:"\x1B[A"},{label:"Down",icon:pp,data:"\x1B[B"},{label:"Left",icon:cE,data:"\x1B[D"},{label:"Right",icon:mp,data:"\x1B[C"},{label:"Enter",icon:null,data:"\r"}];function ly({onSend:e}){return Pp()?v.jsx("div",{className:"flex shrink-0 items-center justify-center gap-2 border-t border-border bg-card px-3 py-2",children:e7.map(n=>v.jsxs(Ne,{variant:"outline",className:"h-11 min-w-11 touch-manipulation",onClick:()=>e(n.data),children:[n.icon?v.jsx(ve,{icon:n.icon,size:20,strokeWidth:2}):v.jsx("span",{className:"text-xs font-medium",children:n.label}),v.jsx("span",{className:"sr-only",children:n.label})]},n.label))}):null}function t7({className:e,onReady:t,onResize:n,onContainerReady:s,terminalId:o,setupImagePaste:u,onSend:h,onFocus:a}){const l=R.useRef(null),d=R.useRef(null),p=R.useRef(null),f=R.useRef(n),g=R.useRef(a),{setTerminalFocused:S}=ny();R.useEffect(()=>{f.current=n},[n]),R.useEffect(()=>{g.current=a},[a]);const C=R.useCallback(()=>{if(!p.current||!d.current)return;p.current.fit();const{cols:b,rows:x}=d.current;f.current?.(b,x)},[]);R.useEffect(()=>{if(!l.current||d.current)return;const b=new Zk.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),x=new Jk.FitAddon,_=new eT.WebLinksAddon;b.loadAddon(x),b.loadAddon(_),b.open(l.current),d.current=b,p.current=x,requestAnimationFrame(()=>{C(),t?.(b),l.current&&s?.(l.current)});const y=()=>{S(!0),g.current?.()},E=()=>S(!1);b.textarea&&(b.textarea.addEventListener("focus",y),b.textarea.addEventListener("blur",E));const T=setTimeout(()=>{C(),b.refresh(0,b.rows-1)},100),A=()=>{requestAnimationFrame(C)};window.addEventListener("resize",A);const M=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{C(),b.refresh(0,b.rows-1)})};document.addEventListener("visibilitychange",M);const L=new ResizeObserver(A);L.observe(l.current);const D=new IntersectionObserver(z=>{z[0]?.isIntersecting&&requestAnimationFrame(()=>{C(),b.refresh(0,b.rows-1)})},{threshold:.1});return D.observe(l.current),()=>{clearTimeout(T),window.removeEventListener("resize",A),document.removeEventListener("visibilitychange",M),L.disconnect(),D.disconnect(),b.textarea&&(b.textarea.removeEventListener("focus",y),b.textarea.removeEventListener("blur",E)),S(!1),b.dispose(),d.current=null,p.current=null}},[C,t,s,S]),R.useEffect(()=>!l.current||!o||!u?void 0:u(l.current,o),[o,u]);const w=R.useCallback(()=>{d.current?.scrollToBottom()},[]);return v.jsxs("div",{className:"flex h-full w-full max-w-full flex-col",children:[v.jsxs("div",{className:"relative min-h-0 flex-1",children:[v.jsx("div",{ref:l,className:Be("h-full w-full max-w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),v.jsx("button",{onClick:w,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:v.jsx(ve,{icon:lE,size:20,strokeWidth:2})})]}),h&&v.jsx(ly,{onSend:h})]})}function n7({name:e,status:t,exitCode:n,className:s,onRename:o}){const[u,h]=R.useState(!1),[a,l]=R.useState(e),d=R.useRef(null);R.useEffect(()=>{u&&d.current&&(d.current.focus(),d.current.select())},[u]);const p=()=>{o&&(l(e),h(!0))},f=()=>{const S=a.trim();S&&S!==e&&o&&o(S),h(!1)},g=S=>{S.key==="Enter"?f():S.key==="Escape"&&h(!1)};return v.jsxs("div",{className:Be("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[v.jsx("span",{className:Be("h-2 w-2 shrink-0 rounded-full",{"bg-green-500":t==="running","bg-zinc-500":t==="exited"&&n===0,"bg-red-500":t==="exited"&&n!==0,"bg-yellow-500":t==="error"})}),u?v.jsx("input",{ref:d,type:"text",value:a,onChange:S=>l(S.target.value),onBlur:f,onKeyDown:g,className:"h-4 w-24 rounded border border-border bg-background px-1 text-xs font-medium text-foreground outline-none focus:border-primary"}):v.jsx("span",{className:Be("font-medium text-foreground",o&&"cursor-pointer hover:text-primary"),onDoubleClick:p,title:o?"Double-click to rename":void 0,children:e}),t==="exited"&&n!==void 0&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),v.jsxs("span",{className:Be({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}function tT({...e}){return v.jsx(L9,{"data-slot":"dropdown-menu",...e})}function nT({...e}){return v.jsx(O9,{"data-slot":"dropdown-menu-trigger",...e})}function rT({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return v.jsx(v9,{children:v.jsx(_9,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:v.jsx(m9,{"data-slot":"dropdown-menu-content",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open: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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...u})})})}function Mv({className:e,inset:t,variant:n="default",...s}){return v.jsx(h9,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Be("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s})}function r7({...e}){return v.jsx(b9,{"data-slot":"dropdown-menu-radio-group",...e})}function s7({className:e,children:t,...n}){return v.jsxs(S9,{"data-slot":"dropdown-menu-radio-item",className:Be("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-radio-item-indicator",children:v.jsx(C9,{children:v.jsx(ve,{icon:Ma,strokeWidth:2})})}),t]})}const i7="";function sT(){return jn({mutationFn:async e=>{const t=await fetch(`${i7}/api/git/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync failed")}return t.json()}})}const o7="";function iT(){return jn({mutationFn:async e=>{const t=await fetch(`${o7}/api/git/merge-to-main`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Merge failed")}return t.json()}})}const a7="";function oT(){return jn({mutationFn:async e=>{const t=await fetch(`${a7}/api/git/sync-parent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync parent failed")}return t.json()}})}const l7="";function aT(){return jn({mutationFn:async e=>{const t=await fetch(`${l7}/api/tasks/${e}/kill-claude`,{method:"POST"});if(!t.ok){const n=await t.json();throw new Error(n.error||"Failed to kill Claude")}return t.json()}})}function c7({repoPath:e,worktreePath:t,baseBranch:n,taskId:s,isMobile:o}){const u=sT(),h=iT(),a=oT(),l=Z0(),d=aT(),p=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),yr.success("Synced from main")}catch(C){const w=C instanceof Error?C.message:"Sync failed";yr.error(w)}},f=async()=>{try{await h.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),yr.success("Merged to main"),d.mutate(s),l.mutate({taskId:s,updates:{status:"DONE"}})}catch(C){const w=C instanceof Error?C.message:"Merge failed";yr.error(w)}},g=async()=>{try{await a.mutateAsync({repoPath:e,baseBranch:n}),yr.success("Parent synced with origin")}catch(C){const w=C instanceof Error?C.message:"Sync parent failed";yr.error(w)}},S=u.isPending||h.isPending||a.isPending;return o?v.jsxs(tT,{children:[v.jsx(nT,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:v.jsx(ve,{icon:H4,size:12,strokeWidth:2,className:S?"animate-pulse":""})}),v.jsxs(rT,{align:"end",children:[v.jsxs(Mv,{onClick:p,disabled:u.isPending,children:[v.jsx(ve,{icon:l_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""}),"Pull from main"]}),v.jsxs(Mv,{onClick:f,disabled:h.isPending,children:[v.jsx(ve,{icon:c_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""}),"Merge to main"]}),v.jsxs(Mv,{onClick:g,disabled:a.isPending,children:[v.jsx(ve,{icon:h_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""}),"Sync parent with origin"]})]})]}):v.jsxs(v.Fragment,{children:[v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:p,disabled:u.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:v.jsx(ve,{icon:l_,size:12,strokeWidth:2,className:u.isPending?"animate-spin":""})}),v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:f,disabled:h.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:v.jsx(ve,{icon:c_,size:12,strokeWidth:2,className:h.isPending?"animate-pulse":""})}),v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:g,disabled:a.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:v.jsx(ve,{icon:h_,size:12,strokeWidth:2,className:a.isPending?"animate-spin":""})})]})}function u7({terminal:e,taskInfo:t,isMobile:n,onClose:s,onReady:o,onResize:u,onRename:h,onContainerReady:a,setupImagePaste:l,onFocus:d}){return v.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[v.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:t?v.jsxs("div",{className:"flex flex-1 items-center gap-2 px-2 py-1",children:[v.jsxs(qn,{to:"/tasks/$taskId",params:{taskId:t.taskId},className:"flex items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 truncate",children:[v.jsx(ve,{icon:h0,size:14,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{className:"truncate",children:t.title})]}),!n&&v.jsxs(v.Fragment,{children:[v.jsx(qn,{to:t.repoId?"/repositories/$repoId":"/repositories",params:t.repoId?{repoId:t.repoId}:void 0,className:"text-xs font-medium text-foreground shrink-0 cursor-pointer hover:underline",children:t.repoName}),e.cwd&&v.jsx("span",{className:"text-xs text-muted-foreground truncate",children:e.cwd.split("/").pop()})]}),v.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:v.jsx(c7,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId,isMobile:n})})]}):v.jsxs(v.Fragment,{children:[v.jsx(n7,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:h}),s&&v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:s,className:"mr-1 h-5 w-5 text-muted-foreground hover:text-foreground",children:v.jsx(ve,{icon:Si,size:12,strokeWidth:2})})]})}),v.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:v.jsx(t7,{onReady:o,onResize:u,onContainerReady:a,terminalId:e.id,setupImagePaste:l,onFocus:d})})]})}function d7({onAdd:e}){return v.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?v.jsxs(Ne,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[v.jsx(ve,{icon:rc,size:14,strokeWidth:2}),"New Terminal"]}):v.jsx("p",{className:"text-xs text-muted-foreground",children:"No terminals"})})}function f7(e){return e<=1?{rows:1,cols:1}:e<=2?{rows:1,cols:2}:e<=4?{rows:2,cols:2}:e<=6?{rows:2,cols:3}:e<=9?{rows:3,cols:3}:{rows:3,cols:4}}function h7({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,setupImagePaste:a,writeToTerminal:l,taskInfoByCwd:d}){const p=Pp(),[f,g]=R.useState(e.length>0?e[0].id:null);if(e.length===0)return v.jsx(d7,{onAdd:n});const{rows:S,cols:C}=f7(e.length),w=[];for(let y=0;y<S;y++){const E=y*C,T=Math.min(E+C,e.length);E<e.length&&w.push(e.slice(E,T))}const b=y=>{f&&l&&l(f,y)},x=y=>v.jsx(u7,{terminal:y,taskInfo:y.cwd?d?.get(y.cwd):void 0,isMobile:p,onClose:t?()=>t(y.id):void 0,onReady:s?E=>s(y.id,E):void 0,onResize:o?(E,T)=>o(y.id,E,T):void 0,onRename:u?E=>u(y.id,E):void 0,onContainerReady:h?E=>h(y.id,E):void 0,setupImagePaste:a,onFocus:()=>g(y.id)}),_=y=>v.jsxs("div",{className:"flex h-full w-full flex-col",children:[v.jsx("div",{className:"min-h-0 flex-1",children:y}),p&&l&&v.jsx(ly,{onSend:b})]});return e.length===1?_(v.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:x(e[0])})):e.length===2?_(v.jsxs(ta,{direction:p?"vertical":"horizontal",className:"h-full max-w-full",children:[v.jsx(ts,{defaultSize:50,minSize:15,children:x(e[0])},e[0].id),v.jsx(na,{}),v.jsx(ts,{defaultSize:50,minSize:15,children:x(e[1])},e[1].id)]})):e.length===3?_(v.jsxs(ta,{direction:"horizontal",className:"h-full max-w-full",children:[v.jsx(ts,{defaultSize:50,minSize:15,children:x(e[0])},e[0].id),v.jsx(na,{}),v.jsx(ts,{defaultSize:50,minSize:15,children:v.jsxs(ta,{direction:"vertical",className:"h-full max-w-full",children:[v.jsx(ts,{defaultSize:50,minSize:15,children:x(e[1])},e[1].id),v.jsx(na,{}),v.jsx(ts,{defaultSize:50,minSize:15,children:x(e[2])},e[2].id)]})})]})):_(v.jsx(ta,{direction:"vertical",className:"h-full max-w-full",children:w.map((y,E)=>v.jsxs(R.Fragment,{children:[E>0&&v.jsx(na,{}),v.jsx(ts,{defaultSize:100/w.length,minSize:15,children:y.length===1?x(y[0]):v.jsx(ta,{direction:"horizontal",className:"h-full max-w-full",children:y.map((T,A)=>v.jsxs(R.Fragment,{children:[A>0&&v.jsx(na,{}),v.jsx(ts,{defaultSize:100/C,minSize:15,children:x(T)})]},T.id))})})]},`row-${E}`))}))}function p7({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:s,onTabCreate:o,onTabRename:u}){const[h,a]=R.useState(null),[l,d]=R.useState(""),p=R.useRef(null);R.useEffect(()=>{h&&p.current&&(p.current.focus(),p.current.select())},[h]);const f=C=>{a(C.id),d(C.name)},g=()=>{h&&l.trim()&&u(h,l.trim()),a(null)},S=C=>{C.key==="Enter"?g():C.key==="Escape"&&a(null)};return v.jsxs("div",{className:"flex items-center gap-1",children:[e.map(C=>v.jsx("button",{onClick:()=>n(C.id),onDoubleClick:()=>f(C),className:Be("group relative flex items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs transition-colors max-sm:px-2 max-sm:py-1",C.id===t?"border-border bg-background text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:h===C.id?v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Wt,{ref:p,value:l,onChange:w=>d(w.target.value),onBlur:g,onKeyDown:S,className:"h-5 w-20 px-1 text-xs"}),v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:v.jsx(ve,{icon:W4,size:12,strokeWidth:2})})]}):v.jsxs(v.Fragment,{children:[C.name,e.length>1&&v.jsx("button",{onClick:w=>{w.stopPropagation(),s(C.id)},className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:v.jsx(ve,{icon:Si,size:12,strokeWidth:2})})]})},C.id)),v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:v.jsx(ve,{icon:rc,size:14,strokeWidth:2})})]})}function m7(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function cy(e={}){const{url:t=m7(),reconnectInterval:n=2e3,maxReconnectAttempts:s=10}=e,[o,u]=R.useState([]),[h,a]=R.useState(!1),[l,d]=R.useState([]),[p,f]=R.useState(!1),g=R.useRef(null),S=R.useRef(0),C=R.useRef(void 0),w=R.useRef(new Map),b=R.useRef(new Set),x=R.useRef(new Map),_=R.useRef(()=>{}),y=R.useRef(null),E=R.useRef(!1),T=R.useCallback(P=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(P))},[]),A=R.useCallback(P=>{try{const I=JSON.parse(P.data);switch(I.type){case"terminals:list":u(I.payload.terminals),a(!0);break;case"terminal:created":u(F=>[...F,I.payload.terminal]),I.payload.isNew&&b.current.add(I.payload.terminal.id);break;case"terminal:output":{const F=w.current.get(I.payload.terminalId);F&&F.write(I.payload.data);break}case"terminal:attached":{const F=w.current.get(I.payload.terminalId);F&&(F.reset(),I.payload.buffer&&F.write(I.payload.buffer));const X=x.current.get(I.payload.terminalId);X&&(x.current.delete(I.payload.terminalId),X());break}case"terminal:bufferCleared":{const F=w.current.get(I.payload.terminalId);F&&F.reset();break}case"terminal:exit":u(F=>F.map(X=>X.id===I.payload.terminalId?{...X,status:"exited",exitCode:I.payload.exitCode}:X));break;case"terminal:error":console.error("Terminal error:",I.payload.error);break;case"terminal:renamed":u(F=>F.map(X=>X.id===I.payload.terminalId?{...X,name:I.payload.name}:X));break;case"terminal:destroyed":w.current.delete(I.payload.terminalId),u(F=>F.filter(X=>X.id!==I.payload.terminalId));break;case"terminal:tabAssigned":u(F=>F.map(X=>X.id===I.payload.terminalId?{...X,tabId:I.payload.tabId??void 0,positionInTab:I.payload.positionInTab}:X));break;case"tabs:list":d(I.payload.tabs);break;case"tab:created":d(F=>[...F,I.payload.tab].sort((X,te)=>X.position-te.position));break;case"tab:renamed":d(F=>F.map(X=>X.id===I.payload.tabId?{...X,name:I.payload.name}:X));break;case"tab:deleted":d(F=>F.filter(X=>X.id!==I.payload.tabId));break;case"tab:reordered":d(F=>F.map(X=>X.id===I.payload.tabId?{...X,position:I.payload.position}:X).sort((X,te)=>X.position-te.position));break}}catch(I){console.error("Failed to parse WebSocket message:",I)}},[]),M=R.useCallback(()=>{const P=g.current;if(P&&(P.readyState===WebSocket.CONNECTING||P.readyState===WebSocket.OPEN))return;const I=new WebSocket(t);g.current=I,I.onopen=()=>{f(!0),S.current=0},I.onmessage=A,I.onclose=()=>{f(!1),a(!1),g.current===I&&(g.current=null),S.current<s&&(S.current++,C.current=setTimeout(()=>_.current(),n))},I.onerror=()=>{}},[t,n,s,A]);_.current=M,R.useEffect(()=>(M(),()=>{C.current&&clearTimeout(C.current),g.current&&(g.current.close(),g.current=null)}),[M]),R.useEffect(()=>{if(p&&!E.current){const P=setTimeout(()=>{y.current&&document.hasFocus()&&document.visibilityState==="visible"&&w.current.get(y.current)?.focus()},150);return()=>clearTimeout(P)}E.current=p},[p]);const L=R.useCallback(P=>{T({type:"terminal:create",payload:P})},[T]),D=R.useCallback(P=>{T({type:"terminal:destroy",payload:{terminalId:P}}),w.current.delete(P),u(I=>I.filter(F=>F.id!==P))},[T]),z=R.useCallback((P,I)=>{T({type:"terminal:input",payload:{terminalId:P,data:I}})},[T]),H=R.useCallback((P,I,F)=>{T({type:"terminal:resize",payload:{terminalId:P,cols:I,rows:F}})},[T]),$=R.useCallback((P,I)=>{T({type:"terminal:rename",payload:{terminalId:P,name:I}})},[T]),N=R.useCallback(P=>{T({type:"terminal:clearBuffer",payload:{terminalId:P}})},[T]),q=R.useCallback((P,I,F)=>{T({type:"terminal:assignTab",payload:{terminalId:P,tabId:I,positionInTab:F}})},[T]),K=R.useCallback((P,I)=>{T({type:"tab:create",payload:{name:P,position:I}})},[T]),V=R.useCallback((P,I)=>{T({type:"tab:rename",payload:{tabId:P,name:I}})},[T]),Y=R.useCallback(P=>{T({type:"tab:delete",payload:{tabId:P}})},[T]),G=R.useCallback((P,I)=>{T({type:"tab:reorder",payload:{tabId:P,position:I}})},[T]),j=R.useCallback((P,I,F)=>{w.current.set(P,I),I.attachCustomKeyEventHandler(ee=>ee.type==="keydown"&&ee.shiftKey&&ee.key==="Enter"?(ee.preventDefault(),ee.stopPropagation(),z(P,`
35
+ `),!1):!0);const X=I.onData(ee=>{z(P,ee)}),te=()=>{y.current=P};return I.textarea?.addEventListener("focus",te),F?.onAttached&&x.current.set(P,F.onAttached),T({type:"terminal:attach",payload:{terminalId:P}}),()=>{X.dispose(),w.current.delete(P),x.current.delete(P),I.textarea?.removeEventListener("focus",te)}},[T,z]),W=R.useCallback((P,I)=>{const F=async X=>{const te=X.clipboardData?.items;if(te){for(const ee of te)if(ee.type.startsWith("image/")){X.preventDefault(),X.stopPropagation();const Q=ee.getAsFile();if(!Q)return;try{const U=await TR(Q);z(I,U)}catch(U){console.error("Failed to upload image:",U)}return}}};return P.addEventListener("paste",F,!0),()=>{P.removeEventListener("paste",F,!0)}},[z]);return{terminals:o,terminalsLoaded:h,tabs:l,connected:p,newTerminalIds:b.current,createTerminal:L,destroyTerminal:D,writeToTerminal:z,resizeTerminal:H,renameTerminal:$,clearTerminalBuffer:N,assignTerminalToTab:q,createTab:K,renameTab:V,deleteTab:Y,reorderTab:G,attachXterm:j,setupImagePaste:W}}const Ps="all-tasks",uw=["IN_PROGRESS","IN_REVIEW"],g7=ws("/terminals/")({component:v7});function v7(){const{terminals:e,tabs:t,connected:n,createTerminal:s,destroyTerminal:o,renameTerminal:u,assignTerminalToTab:h,createTab:a,renameTab:l,deleteTab:d,attachXterm:p,resizeTerminal:f,setupImagePaste:g,writeToTerminal:S}=cy(),{activeTabId:C,setActiveTab:w,isLoading:b}=Dk();R.useEffect(()=>{if(t.length>0&&!b){const I=t.map(F=>F.id);(!C||!I.includes(C)&&C!==Ps)&&w(t[0].id)}},[t,C,b,w]);const{data:x=[]}=Q0(),{data:_=[]}=ey(),{data:y}=Rk(),[E,T]=R.useState(null),A=R.useMemo(()=>{const I=new Map;for(const F of _)I.set(F.path,F.id);return I},[_]),M=R.useMemo(()=>new Set(x.filter(I=>uw.includes(I.status)&&I.worktreePath).map(I=>I.worktreePath)),[x]),L=R.useMemo(()=>new Set(x.filter(I=>I.worktreePath).map(I=>I.worktreePath)),[x]),D=R.useMemo(()=>{const I=new Map;for(const F of x)F.worktreePath&&I.set(F.worktreePath,{taskId:F.id,repoId:A.get(F.repoPath),repoName:F.repoName,title:F.title,repoPath:F.repoPath,worktreePath:F.worktreePath,baseBranch:F.baseBranch,branch:F.branch});return I},[x,A]),z=R.useMemo(()=>{const I=new Set(x.filter(F=>uw.includes(F.status)).map(F=>F.repoName));return Array.from(I).sort()},[x]),H=R.useRef(new Map),$=R.useRef(0);R.useEffect(()=>{if(y)for(const I of e){const F=I.cwd?.startsWith(y),X=I.cwd&&L.has(I.cwd);F&&!X&&o(I.id)}},[e,L,y,o]);const N=R.useMemo(()=>C===Ps?e.filter(I=>I.cwd&&M.has(I.cwd)).filter(I=>E?x.find(X=>X.worktreePath===I.cwd)?.repoName===E:!0).sort((I,F)=>{const X=x.find(ee=>ee.worktreePath===I.cwd),te=x.find(ee=>ee.worktreePath===F.cwd);return!X||!te?0:new Date(te.createdAt).getTime()-new Date(X.createdAt).getTime()}):e.filter(I=>I.tabId===C).sort((I,F)=>(I.positionInTab??0)-(F.positionInTab??0)),[C,e,M,E,x]),q=R.useCallback(()=>{$.current++;const F=e.filter(X=>X.tabId===C).length;s({name:`Terminal ${$.current}`,cols:80,rows:24,tabId:C??void 0,positionInTab:F})},[s,C,e]);R.useEffect(()=>{for(const I of e)I.cwd&&L.has(I.cwd)&&I.tabId&&h(I.id,null)},[e,L,h]);const K=R.useCallback(I=>{const F=H.current.get(I);F&&(F(),H.current.delete(I)),o(I)},[o]),V=R.useCallback((I,F)=>{const X=p(I,F);H.current.set(I,X)},[p]),Y=R.useCallback((I,F,X)=>{f(I,F,X)},[f]),G=R.useCallback((I,F)=>{u(I,F)},[u]),j=R.useCallback(()=>{const I=t.length;a(`Tab ${I+1}`)},[a,t.length]),W=R.useCallback(I=>{const F=e.filter(X=>X.tabId===I);for(const X of F)K(X.id);d(I)},[e,d,K]),P=t.map((I,F)=>({id:I.id,name:I.name,layout:"single",position:F}));return v.jsxs("div",{className:"flex h-full max-w-full flex-col overflow-hidden",children:[v.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-2 py-1",children:[v.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto",children:v.jsx(p7,{tabs:P,activeTabId:C??"",onTabSelect:w,onTabClose:W,onTabCreate:j,onTabRename:l})}),v.jsxs("div",{className:"flex shrink-0 items-center gap-3 max-sm:gap-1",children:[C===Ps&&z.length>1&&v.jsxs(jl,{value:E??"",onValueChange:I=>T(I||null),children:[v.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[v.jsx(ve,{icon:dE,size:12,strokeWidth:2,className:"text-muted-foreground"}),v.jsx(Il,{children:E||"All Repos"})]}),v.jsxs(Bl,{children:[v.jsx(vr,{value:"",children:"All Repos"}),z.map(I=>v.jsx(vr,{value:I,children:I},I))]})]}),v.jsxs("button",{onClick:()=>w(Ps),className:Be("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors max-sm:px-2",C===Ps?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[v.jsx(ve,{icon:Mh,size:12,strokeWidth:2}),v.jsx("span",{className:"max-sm:hidden",children:"Task Terminals"})]}),v.jsxs(Ne,{variant:"outline",size:"sm",onClick:q,disabled:!n||e.length>=12||C===Ps,className:"max-sm:px-2",children:[v.jsx(ve,{icon:rc,size:14,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"New Terminal"})]})]})]}),v.jsx("div",{className:"pixel-grid min-w-0 flex-1 overflow-hidden",children:v.jsx(h7,{terminals:N,onTerminalClose:C===Ps?void 0:K,onTerminalAdd:n&&C!==Ps?q:void 0,onTerminalReady:V,onTerminalResize:Y,onTerminalRename:C===Ps?void 0:G,setupImagePaste:g,writeToTerminal:S,taskInfoByCwd:C===Ps?D:void 0})})]})}function _7(e){if(Array.isArray(e))return e}function y7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,o,u,h,a=[],l=!0,d=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(l=(s=u.call(n)).done)&&(a.push(s.value),a.length!==t);l=!0);}catch(p){d=!0,o=p}finally{try{if(!l&&n.return!=null&&(h=n.return(),Object(h)!==h))return}finally{if(d)throw o}}return a}}function k_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function lT(e,t){if(e){if(typeof e=="string")return k_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k_(e,t):void 0}}function b7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cT(e,t){return _7(e)||y7(e,t)||lT(e,t)||b7()}var Dv={},xu={},dw;function uT(){if(dw)return xu;dw=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.bind=void 0;function e(t,n){var s=n.type,o=n.listener,u=n.options;return t.addEventListener(s,o,u),function(){t.removeEventListener(s,o,u)}}return xu.bind=e,xu}var Xo={},fw;function x7(){if(fw)return Xo;fw=1;var e=Xo&&Xo.__assign||function(){return e=Object.assign||function(u){for(var h,a=1,l=arguments.length;a<l;a++){h=arguments[a];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(u[d]=h[d])}return u},e.apply(this,arguments)};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.bindAll=void 0;var t=uT();function n(u){if(!(typeof u>"u"))return typeof u=="boolean"?{capture:u}:u}function s(u,h){if(h==null)return u;var a=e(e({},u),{options:e(e({},n(h)),n(u.options))});return a}function o(u,h,a){var l=h.map(function(d){var p=s(d,a);return(0,t.bind)(u,p)});return function(){l.forEach(function(p){return p()})}}return Xo.bindAll=o,Xo}var hw;function S7(){return hw||(hw=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=uT();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=x7();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(Dv)),Dv}var Ql=S7(),dT="data-pdnd-honey-pot";function fT(e){return e instanceof Element&&e.hasAttribute(dT)}function hT(e){var t=document.elementsFromPoint(e.x,e.y),n=cT(t,2),s=n[0],o=n[1];return s?fT(s)?o??null:s:null}function $u(e){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$u(e)}function C7(e,t){if($u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if($u(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w7(e){var t=C7(e,"string");return $u(t)=="symbol"?t:t+""}function md(e,t,n){return(t=w7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pT=2147483647;function pw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function mw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pw(Object(n),!0).forEach(function(s){md(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var Ku=2,gw=Ku/2;function E7(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function R7(e){return{x:e.x-gw,y:e.y-gw}}function k7(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function T7(e){return{x:Math.min(e.x,window.innerWidth-Ku),y:Math.min(e.y,window.innerHeight-Ku)}}function vw(e){var t=e.client,n=T7(k7(R7(E7(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Ku,height:Ku})}function _w(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function L7(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function A7(e){var t=e.initial,n=document.createElement("div");n.setAttribute(dT,"true");var s=vw({client:t});Object.assign(n.style,mw(mw({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},_w({clientRect:s})),{},{pointerEvents:"auto",zIndex:pT})),document.body.appendChild(n);var o=Ql.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=vw({client:a}),Object.assign(n.style,_w({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),L7({client:a,clientRect:s})){n.remove();return}function l(){d(),n.remove()}var d=Ql.bindAll(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}function O7(){var e=null;function t(){return e=null,Ql.bind(window,{type:"pointermove",listener:function(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function n(){var s=null;return function(u){var h=u.eventName,a=u.payload;if(h==="onDragStart"){var l=a.location.initial.input,d=e??{x:l.clientX,y:l.clientY};s=A7({initial:d})}if(h==="onDrop"){var p,f=a.location.current.input;(p=s)===null||p===void 0||p({current:{x:f.clientX,y:f.clientY}}),s=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function M7(e){if(Array.isArray(e))return k_(e)}function D7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
37
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mT(e){return M7(e)||D7(e)||lT(e)||P7()}function Ha(e){var t=null;return function(){if(!t){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];var h=e.apply(this,o);t={result:h}}return t.result}}var j7=Ha(function(){return navigator.userAgent.includes("Firefox")}),gd=Ha(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),T_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function I7(e){var t=e.dragLeave;return gd()?t.hasOwnProperty(T_.isLeavingWindow):!1}(function(){if(typeof window>"u"||!gd())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function s(){n=t()}Ql.bindAll(window,[{type:"dragstart",listener:function(){n.enterCount=0,n.isOverWindow=!0}},{type:"drop",listener:s},{type:"dragend",listener:s},{type:"dragenter",listener:function(u){!n.isOverWindow&&n.enterCount===0&&(u[T_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[T_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function N7(e){return"nodeName"in e}function B7(e){return N7(e)&&e.ownerDocument!==document}function z7(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:gd()?I7({dragLeave:t}):s==null?!0:j7()?B7(s):s instanceof HTMLIFrameElement}function H7(e){var t=e.onDragEnd;return[{type:"pointermove",listener:(function(){var n=0;return function(){if(n<20){n++;return}t()}})()},{type:"pointerdown",listener:t}]}function Pu(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var F7=function(t){var n=[],s=null,o=function(){for(var h=arguments.length,a=new Array(h),l=0;l<h;l++)a[l]=arguments[l];n=a,!s&&(s=requestAnimationFrame(function(){s=null,t.apply(void 0,n)}))};return o.cancel=function(){s&&(cancelAnimationFrame(s),s=null)},o},Pv=F7(function(e){return e()}),sh=(function(){var e=null;function t(s){var o=requestAnimationFrame(function(){e=null,s()});e={frameId:o,fn:s}}function n(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:n}})();function V7(e){var t=e.source,n=e.initial,s=e.dispatchEvent,o={dropTargets:[]};function u(a){s(a),o={dropTargets:a.payload.location.current.dropTargets}}var h={start:function(l){var d=l.nativeSetDragImage,p={current:n,previous:o,initial:n};u({eventName:"onGenerateDragPreview",payload:{source:t,location:p,nativeSetDragImage:d}}),sh.schedule(function(){u({eventName:"onDragStart",payload:{source:t,location:p}})})},dragUpdate:function(l){var d=l.current;sh.flush(),Pv.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(l){var d=l.current;Pv(function(){sh.flush();var p={initial:n,previous:o,current:d};u({eventName:"onDrag",payload:{source:t,location:p}})})},drop:function(l){var d=l.current,p=l.updatedSourcePayload;sh.flush(),Pv.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var L_={isActive:!1};function gT(){return!L_.isActive}function U7(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function W7(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var s=0;s<t.length;s++)if(t[s].element!==n[s].element)return!0;return!1}function q7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!gT())return;var u=G7({event:t,dragType:n,getDropTargetsOver:s});L_.isActive=!0;var h={current:u};jv({event:t,current:u.dropTargets});var a=V7({source:n.payload,dispatchEvent:o,initial:u});function l(S){var C=W7({current:h.current.dropTargets,next:S.dropTargets});h.current=S,C&&a.dragUpdate({current:h.current})}function d(S){var C=Pu(S),w=fT(S.target)?hT({x:C.clientX,y:C.clientY}):S.target,b=s({target:w,input:C,source:n.payload,current:h.current.dropTargets});b.length&&(S.preventDefault(),jv({event:S,current:b})),l({dropTargets:b,input:C})}function p(){h.current.dropTargets.length&&l({dropTargets:[],input:h.current.input}),a.drop({current:h.current,updatedSourcePayload:null}),f()}function f(){L_.isActive=!1,g()}var g=Ql.bindAll(window,[{type:"dragover",listener:function(C){d(C),a.drag({current:h.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(C){z7({dragLeave:C})&&(l({input:h.current.input,dropTargets:[]}),n.startedFrom==="external"&&p())}},{type:"drop",listener:function(C){if(h.current={dropTargets:h.current.dropTargets,input:Pu(C)},!h.current.dropTargets.length){p();return}C.preventDefault(),jv({event:C,current:h.current.dropTargets}),a.drop({current:h.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(C):null}),f()}},{type:"dragend",listener:function(C){h.current={dropTargets:h.current.dropTargets,input:Pu(C)},p()}}].concat(mT(H7({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:U7(t)})}function jv(e){var t,n=e.event,s=e.current,o=(t=s[0])===null||t===void 0?void 0:t.dropEffect;o!=null&&n.dataTransfer&&(n.dataTransfer.dropEffect=o)}function G7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=Pu(t);if(n.startedFrom==="external")return{input:o,dropTargets:[]};var u=s({input:o,source:n.payload,target:t.target,current:[]});return{input:o,dropTargets:u}}var yw={canStart:gT,start:q7},A_=new Map;function $7(e){var t=e.typeKey,n=e.mount,s=A_.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return A_.set(t,o),o}function K7(e){var t=$7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),A_.delete(e.typeKey))}}function jp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(o){return o()})}}function vT(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function bw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bw(Object(n),!0).forEach(function(s){md(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Iv(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Y7(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
38
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function Y7(e,t){if(e){if(typeof e=="string")return xw(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xw(e,t):void 0}}function xw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function Nv(e){return e.slice(0).reverse()}function X7(e){var t=e.typeKey,n=e.defaultDropEffect,s=new WeakMap,o="data-drop-target-for-".concat(t),u="[".concat(o,"]");function h(S){return s.set(S.element,S),function(){return s.delete(S.element)}}function a(S){var C=jp(vT(S.element,{attribute:o,value:"true"}),h(S));return Ha(C)}function l(S){var C,w,b,x,_=S.source,y=S.target,E=S.input,T=S.result,A=T===void 0?[]:T;if(y==null)return A;if(!(y instanceof Element))return y instanceof Node?l({source:_,target:y.parentElement,input:E,result:A}):A;var M=y.closest(u);if(M==null)return A;var L=s.get(M);if(L==null)return A;var D={input:E,source:_,element:L.element};if(L.canDrop&&!L.canDrop(D))return l({source:_,target:L.element.parentElement,input:E,result:A});var z=(C=(w=L.getData)===null||w===void 0?void 0:w.call(L,D))!==null&&C!==void 0?C:{},H=(b=(x=L.getDropEffect)===null||x===void 0?void 0:x.call(L,D))!==null&&b!==void 0?b:n,$={data:z,element:L.element,dropEffect:H,isActiveDueToStickiness:!1};return l({source:_,target:L.element.parentElement,input:E,result:[].concat(mT(A),[$])})}function d(S){var C=S.eventName,w=S.payload,b=Iv(w.location.current.dropTargets),x;try{for(b.s();!(x=b.n()).done;){var _,y=x.value,E=s.get(y.element),T=no(no({},w),{},{self:y});E==null||(_=E[C])===null||_===void 0||_.call(E,T)}}catch(A){b.e(A)}finally{b.f()}}var p={onGenerateDragPreview:d,onDrag:d,onDragStart:d,onDrop:d,onDropTargetChange:function(C){var w=C.payload,b=new Set(w.location.current.dropTargets.map(function(Y){return Y.element})),x=new Set,_=Iv(w.location.previous.dropTargets),y;try{for(_.s();!(y=_.n()).done;){var E,T=y.value;x.add(T.element);var A=s.get(T.element),M=b.has(T.element),L=no(no({},w),{},{self:T});if(A==null||(E=A.onDropTargetChange)===null||E===void 0||E.call(A,L),!M){var D;A==null||(D=A.onDragLeave)===null||D===void 0||D.call(A,L)}}}catch(Y){_.e(Y)}finally{_.f()}var z=Iv(w.location.current.dropTargets),H;try{for(z.s();!(H=z.n()).done;){var $,N,q=H.value;if(!x.has(q.element)){var K=no(no({},w),{},{self:q}),V=s.get(q.element);V==null||($=V.onDropTargetChange)===null||$===void 0||$.call(V,K),V==null||(N=V.onDragEnter)===null||N===void 0||N.call(V,K)}}}catch(Y){z.e(Y)}finally{z.f()}}};function f(S){p[S.eventName](S)}function g(S){var C=S.source,w=S.target,b=S.input,x=S.current,_=l({source:C,target:w,input:b});if(_.length>=x.length)return _;for(var y=Nv(x),E=Nv(_),T=[],A=0;A<y.length;A++){var M,L=y[A],D=E[A];if(D!=null){T.push(D);continue}var z=T[A-1],H=y[A-1];if(z?.element!==H?.element)break;var $=s.get(L.element);if(!$)break;var N={input:b,source:C,element:$.element};if($.canDrop&&!$.canDrop(N)||!((M=$.getIsSticky)!==null&&M!==void 0&&M.call($,N)))break;T.push(no(no({},L),{},{isActiveDueToStickiness:!0}))}return Nv(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function Q7(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Z7(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
39
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function Z7(e,t){if(e){if(typeof e=="string")return Sw(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sw(e,t):void 0}}function Sw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function Cw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function J7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cw(Object(n),!0).forEach(function(s){md(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function eB(){var e=new Set,t=null;function n(u){t&&(!u.canMonitor||u.canMonitor(t.canMonitorArgs))&&t.active.add(u)}function s(u){var h=J7({},u);e.add(h),n(h);function a(){e.delete(h),t&&t.active.delete(h)}return Ha(a)}function o(u){var h=u.eventName,a=u.payload;if(h==="onGenerateDragPreview"){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var l=Q7(e),d;try{for(l.s();!(d=l.n()).done;){var p=d.value;n(p)}}catch(b){l.e(b)}finally{l.f()}}if(t){for(var f=Array.from(t.active),g=0,S=f;g<S.length;g++){var C=S[g];if(t.active.has(C)){var w;(w=C[h])===null||w===void 0||w.call(C,a)}}h==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:o,monitorForConsumers:s}}function tB(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=eB(),a=X7({typeKey:t,defaultDropEffect:u});function l(f){s?.(f),a.dispatchEvent(f),h.dispatchEvent(f),o?.(f)}function d(f){var g=f.event,S=f.dragType;yw.start({event:g,dragType:S,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function p(){function f(){var g={canStart:yw.canStart,start:d};return n(g)}return K7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var _T=Ha(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),nB="pdnd:android-fallback",ww="text/plain",rB="text/uri-list",sB="application/vnd.pdnd",$h=new WeakMap;function iB(e){return $h.set(e.element,e),function(){$h.delete(e.element)}}var Ew=O7(),uy=tB({typeKey:"element",defaultDropEffect:"move",mount:function(t){return jp(Ew.bindEvents(),Ql.bind(document,{type:"dragstart",listener:function(s){var o,u,h,a,l,d;if(t.canStart(s)&&!s.defaultPrevented&&s.dataTransfer){var p=s.target;if(p instanceof HTMLElement){var f=$h.get(p);if(f){var g=Pu(s),S={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:g};if(f.canDrag&&!f.canDrag(S)){s.preventDefault();return}if(f.dragHandle){var C=hT({x:g.clientX,y:g.clientY});if(!f.dragHandle.contains(C)){s.preventDefault();return}}var w=(u=(h=f.getInitialDataForExternal)===null||h===void 0?void 0:h.call(f,S))!==null&&u!==void 0?u:null;if(w)for(var b=0,x=Object.entries(w);b<x.length;b++){var _=cT(x[b],2),y=_[0],E=_[1];s.dataTransfer.setData(y,E??"")}_T()&&!s.dataTransfer.types.includes(ww)&&!s.dataTransfer.types.includes(rB)&&s.dataTransfer.setData(ww,nB),s.dataTransfer.setData(sB,"");var T={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,data:(l=(d=f.getInitialData)===null||d===void 0?void 0:d.call(f,S))!==null&&l!==void 0?l:{}},A={type:"element",payload:T,startedFrom:"internal"};t.start({event:s,dragType:A})}}}}}))},dispatchEventToSource:function(t){var n,s,o=t.eventName,u=t.payload;(n=$h.get(u.source.element))===null||n===void 0||(s=n[o])===null||s===void 0||s.call(n,u)},onPostDispatch:Ew.getOnPostDispatch()}),dy=uy.dropTarget,yT=uy.monitor;function oB(e){var t=jp(uy.registerUsage(),iB(e),vT(e.element,{attribute:"draggable",value:"true"}));return Ha(t)}function Rw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function kw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rw(Object(n),!0).forEach(function(s){md(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var aB={top:function(t,n){return Math.abs(n.y-t.top)},right:function(t,n){return Math.abs(t.right-n.x)},bottom:function(t,n){return Math.abs(t.bottom-n.y)},left:function(t,n){return Math.abs(n.x-t.left)}},bT=Symbol("closestEdge");function lB(e,t){var n,s,o=t.element,u=t.input,h=t.allowedEdges,a={x:u.clientX,y:u.clientY},l=o.getBoundingClientRect(),d=h.map(function(f){return{edge:f,value:aB[f](l,a)}}),p=(n=(s=d.sort(function(f,g){return f.value-g.value})[0])===null||s===void 0?void 0:s.edge)!==null&&n!==void 0?n:null;return kw(kw({},e),{},md({},bT,p))}function O_(e){var t;return(t=e[bT])!==null&&t!==void 0?t:null}function cB(){return{x:0,y:0}}function uB(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?cB:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:pT,pointerEvents:"none"}),document.body.append(u);var h=t({container:u});queueMicrotask(function(){var d=o({container:u});if(gd()){var p=u.getBoundingClientRect();if(p.width===0)return;u.style.left="-".concat(p.width-1e-4,"px")}n?.(u,d.x,d.y)});function a(){l(),h?.(),document.body.removeChild(u)}var l=yT({onDragStart:a,onDrop:a})}var dB=Ha(function(){return gd()&&"ontouchend"in document}),fB=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function hB(e){return function(n){var s=n.container;if(dB()||_T())return fB({container:s});Object.assign(s.style,{borderInlineStart:"".concat(e.x," solid transparent"),borderTop:"".concat(e.y," solid transparent")});var o=window.getComputedStyle(s);if(o.direction==="rtl"){var u=s.getBoundingClientRect();return{x:u.width,y:0}}return{x:0,y:0}}}const xT=R.forwardRef(({className:e,...t},n)=>v.jsx(a9,{ref:n,className:Be("peer size-4 shrink-0 rounded border border-input ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-checked:bg-primary data-checked:border-primary data-checked:text-primary-foreground","flex items-center justify-center transition-colors",e),...t,children:v.jsx(l9,{className:"flex items-center justify-center",children:v.jsx(ve,{icon:Ma,size:12,strokeWidth:3})})}));xT.displayName="Checkbox";const ST=R.createContext(null);function pB({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(new Set),u=R.useCallback(p=>{o(f=>{const g=new Set(f);return g.has(p)?g.delete(p):g.add(p),g})},[]),h=R.useCallback(p=>{o(new Set(p))},[]),a=R.useCallback(()=>{o(new Set)},[]),l=R.useCallback(()=>{n(!1),o(new Set)},[]),d=R.useCallback(p=>s.has(p),[s]);return v.jsx(ST.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:l,selectedCount:s.size},children:e})}function CT(){const e=R.useContext(ST);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const wT=R.createContext(null);function mB({children:e}){const[t,n]=R.useState(null);return v.jsx(wT.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function ET(){const e=R.useContext(wT);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function gB(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function RT({task:e,open:t,onOpenChange:n}){const s=Z0(),[o,u]=R.useState(e.title),[h,a]=R.useState(e.description||""),[l,d]=R.useState(e.prUrl||""),[p,f]=R.useState(e.linearTicketUrl||"");R.useEffect(()=>{t&&(u(e.title),a(e.description||""),d(e.prUrl||""),f(e.linearTicketUrl||""))},[t,e]);const g=()=>{const C={},w=o.trim();if(!w)return;w!==e.title&&(C.title=w);const b=h.trim();b!==(e.description||"")&&(C.description=b);const x=l.trim();x!==(e.prUrl||"")&&(C.prUrl=x||null);const _=p.trim();_!==(e.linearTicketUrl||"")&&(C.linearTicketUrl=_||null,C.linearTicketId=_?gB(_):null),Object.keys(C).length>0&&s.mutate({taskId:e.id,updates:C}),n(!1)},S=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return v.jsx(xs,{open:t,onOpenChange:n,children:v.jsxs(Ss,{className:"sm:max-w-md",onKeyDown:S,children:[v.jsx(Bs,{children:v.jsx(zs,{children:"Task Settings"})}),v.jsxs(ud,{className:"mt-4",children:[v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"config-title",children:"Title"}),v.jsx(Wt,{id:"config-title",value:o,onChange:C=>u(C.target.value),autoFocus:!0})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"config-description",children:"Description"}),v.jsx(LR,{id:"config-description",value:h,onValueChange:a,rows:3})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),v.jsx(Wt,{id:"config-pr-url",value:l,onChange:C=>d(C.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),v.jsx(Wt,{id:"config-linear-url",value:p,onChange:C=>f(C.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]})]}),v.jsxs(vo,{className:"mt-4",children:[v.jsx(Ne,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),v.jsx(Ne,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function kT({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=CT(),{setActiveTask:u}=ET(),h=s(e.id),a=yo(),l=R.useRef(null),[d,p]=R.useState(!1),[f,g]=R.useState(null),[S,C]=R.useState(null),[w,b]=R.useState(!1),x=R.useRef(!1);R.useEffect(()=>{const T=l.current;if(!(!T||n||t))return jp(oB({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{uB({nativeSetDragImage:A,getOffset:hB({x:"16px",y:"8px"}),render:({container:M})=>{C(M)}})},onDragStart:()=>{p(!0),u(e),x.current=!0},onDrop:()=>{p(!1),u(null),C(null)}}),dy({element:T,getData:({input:A,element:M})=>{const L={type:"task",taskId:e.id,status:e.status};return lB(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(O_(A.data))},onDrag:({self:A})=>{g(O_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const _=()=>{x.current=!1},y=T=>{if(n){T.preventDefault(),o(e.id);return}x.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),x.current=!1},E=v.jsxs(hd,{ref:t?void 0:l,onPointerDown:_,onClick:y,className:Be("transition-shadow hover:shadow-md relative",n?"cursor-pointer":"cursor-grab active:cursor-grabbing",d&&"opacity-50",h&&"ring-2 ring-primary"),children:[f&&v.jsx("div",{className:Be("absolute left-0 right-0 h-0.5 bg-primary z-10",f==="top"&&"-top-1",f==="bottom"&&"-bottom-1")}),n&&v.jsx("div",{className:"absolute right-2 top-2 z-10 cursor-pointer",onClick:T=>{T.stopPropagation(),o(e.id)},children:v.jsx(xT,{checked:h,className:"cursor-pointer pointer-events-none"})}),v.jsxs(uN,{className:Be("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[v.jsx(dN,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!n&&!t&&v.jsx("button",{type:"button",className:"shrink-0 p-0.5 -m-0.5 rounded hover:bg-muted transition-colors cursor-pointer",onClick:T=>{T.stopPropagation(),b(!0)},onPointerDown:T=>T.stopPropagation(),children:v.jsx(ve,{icon:mE,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),v.jsxs(pd,{className:"p-3 pt-1",children:[e.description&&v.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),v.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[v.jsx(ve,{icon:os,size:12,strokeWidth:2}),v.jsx("span",{children:e.repoName}),e.prUrl&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-muted-foreground/30",children:"•"}),v.jsx(ve,{icon:f0,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-muted-foreground/30",children:"•"}),v.jsx(ve,{icon:h0,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]});return v.jsxs(v.Fragment,{children:[E,S&&er.createPortal(v.jsx("div",{className:"w-72 max-w-[90vw]",children:v.jsx(kT,{task:e,isDragPreview:!0})}),S),v.jsx(RT,{task:e,open:w,onOpenChange:b})]})}const vB={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},_B={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function Tw({status:e,tasks:t,isMobile:n}){const s=R.useRef(null),[o,u]=R.useState(!1),h=[...t].sort((a,l)=>a.position-l.position);return R.useEffect(()=>{const a=s.current;if(a)return dy({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:l})=>l.data.type==="task",onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:()=>u(!1)})},[e]),v.jsxs("div",{ref:s,className:Be("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 min-w-52 flex-shrink",_B[e],o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[!n&&v.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[v.jsx("h3",{className:"text-sm font-medium",children:vB[e]}),v.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-xs font-medium",children:t.length})]}),v.jsx(Yl,{className:"min-h-0 flex-1",children:v.jsx("div",{className:"flex flex-col gap-2 p-2",children:h.map(a=>v.jsx(kT,{task:a},a.id))})})]})}const Bv=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],TT={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function yB({status:e}){const t=R.useRef(null),[n,s]=R.useState(!1);return R.useEffect(()=>{const o=t.current;if(o)return dy({element:o,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),v.jsx("div",{ref:t,className:Be("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",n?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:TT[e]})}function bB({repoFilter:e}){const{data:t=[],isLoading:n}=Q0(),s=gI(),{activeTask:o}=ET(),[u,h]=R.useState("IN_PROGRESS"),a=R.useMemo(()=>e?t.filter(d=>d.repoName===e):t,[t,e]),l=R.useMemo(()=>{const d={IN_PROGRESS:0,IN_REVIEW:0,DONE:0,CANCELED:0};for(const p of a)d[p.status]++;return d},[a]);return R.useEffect(()=>yT({canMonitor:({source:d})=>d.data.type==="task",onDrop:({source:d,location:p})=>{const f=p.current.dropTargets;if(f.length===0)return;const g=d.data.taskId,S=a.find(b=>b.id===g);if(!S)return;const C=f[0],w=C.data;if(w.type==="column"){const b=w.status;if(b!==S.status){const x=a.filter(_=>_.status===b);s.mutate({taskId:g,status:b,position:x.length})}}else if(w.type==="task"){const b=O_(C.data),x=w.status,_=a.filter(T=>T.status===x).sort((T,A)=>T.position-A.position),y=_.findIndex(T=>T.id===w.taskId);let E=y;b==="bottom"&&(E=y+1),S.status===x&&_.findIndex(A=>A.id===g)<y&&(E=Math.max(0,E-1)),(S.status!==x||E!==S.position)&&s.mutate({taskId:g,status:x,position:E})}}}),[a,s]),n?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"border-b lg:hidden",children:v.jsx(_a,{value:u,onValueChange:d=>h(d),children:v.jsx(ya,{variant:"line",className:"w-full justify-start px-4",children:Bv.map(d=>v.jsxs(ir,{value:d,className:"gap-1.5",children:[v.jsx("span",{className:"truncate",children:TT[d]}),v.jsx("span",{className:"text-muted-foreground",children:l[d]})]},d))})})}),v.jsx("div",{className:"pixel-grid hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:Bv.map(d=>v.jsx(Tw,{status:d,tasks:a.filter(p=>p.status===d)},d))}),v.jsx("div",{className:"pixel-grid flex-1 overflow-y-auto p-4 lg:hidden",children:v.jsx(Tw,{status:u,tasks:a.filter(d=>d.status===u),isMobile:!0})}),o&&v.jsx("div",{className:"fixed inset-x-0 bottom-0 flex gap-2 border-t bg-background/95 p-4 backdrop-blur-sm lg:hidden",children:Bv.filter(d=>d!==u).map(d=>v.jsx(yB,{status:d},d))})]})}function xB(e){return v.jsx(mB,{children:v.jsx(bB,{...e})})}const SB=ws("/tasks/")({component:CB});function CB(){return v.jsx(pB,{children:v.jsx(wB,{})})}function wB(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=CT(),u=_I(),{data:h=[]}=Q0(),[a,l]=R.useState(null),d=R.useMemo(()=>{const f=new Set(h.map(g=>g.repoName));return Array.from(f).sort()},[h]),p=()=>{const f=Array.from(n);u.mutate(f,{onSuccess:()=>{o()}})};return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:e?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm font-medium",children:s>0?`${s} selected`:"Select tasks"}),v.jsxs(Ne,{variant:"ghost",size:"sm",onClick:o,className:"max-sm:px-2",children:[v.jsx(ve,{icon:Si,size:14,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Cancel"})]})]}),v.jsxs(uc,{children:[v.jsxs(dc,{render:v.jsx(Ne,{variant:"destructive",size:"sm",disabled:u.isPending||s===0,className:"max-sm:px-2"}),children:[v.jsx(ve,{icon:td,size:14,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:u.isPending?"Deleting...":"Delete"}),s>0&&v.jsxs("span",{className:"max-sm:hidden",children:[" (",s,")"]})]}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsxs(mc,{children:["Delete ",s," Tasks"]}),v.jsx(gc,{children:"This will permanently delete the selected tasks and remove their worktrees. This action cannot be undone."})]}),v.jsxs(pc,{children:[v.jsx(vc,{children:"Cancel"}),v.jsx(jk,{onClick:p,variant:"destructive",disabled:u.isPending,children:u.isPending?"Deleting...":"Delete All"})]})]})]})]}):v.jsxs(v.Fragment,{children:[v.jsx("h1",{className:"text-sm font-medium max-sm:hidden",children:"Tasks"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs(jl,{value:a??"",onValueChange:f=>l(f||null),children:[v.jsxs(Nl,{size:"sm",className:"max-sm:w-auto",children:[v.jsx(ve,{icon:dE,size:12,strokeWidth:2,className:"text-muted-foreground"}),v.jsx(Il,{children:a||"All Repos"})]}),v.jsxs(Bl,{children:[v.jsx(vr,{value:"",children:"All Repos"}),d.map(f=>v.jsx(vr,{value:f,children:f},f))]})]}),v.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>t(!0),className:"max-sm:px-2",children:[v.jsx(ve,{icon:k4,size:14,strokeWidth:2,"data-slot":"icon"}),v.jsx("span",{className:"max-sm:hidden",children:"Select"})]})]})]})}),v.jsx("div",{className:"flex-1 overflow-hidden",children:v.jsx(xB,{repoFilter:a})})]})}const EB=ws("/settings/")({component:RB});function Su({title:e,children:t}){return v.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-4 pt-6",children:[v.jsx("span",{className:"absolute -top-2.5 left-3 bg-card px-2 text-xs font-medium text-muted-foreground",children:e}),t]})}function RB(){const{data:e,isLoading:t}=kI(),{data:n,isLoading:s}=J0(),{data:o,isLoading:u}=kk(),{data:h,isLoading:a}=Mp(),{data:l,isLoading:d}=Dp(),{data:p,isLoading:f}=TI(),{data:g,isLoading:S}=LI(),{data:C,isLoading:w}=MI(),b=AI(),x=OI(),_=DI(),y=PI(),[E,T]=R.useState(""),[A,M]=R.useState(""),[L,D]=R.useState(""),[z,H]=R.useState(""),[$,N]=R.useState(""),[q,K]=R.useState(""),[V,Y]=R.useState(""),[G,j]=R.useState(!1),[W,P]=R.useState(!1),[I,F]=R.useState(!1),[X,te]=R.useState(!1),[ee,Q]=R.useState(!1),[U,se]=R.useState(""),[ne,re]=R.useState(!1),[oe,le]=R.useState(""),[_e,ge]=R.useState(!1),[ue,de]=R.useState(""),[Ie,De]=R.useState("");R.useEffect(()=>{e!==void 0&&T(String(e)),n!==void 0&&M(n),o!==void 0&&D(o),h!==void 0&&H(h),l!==void 0&&N(String(l)),p!==void 0&&K(p),g!==void 0&&Y(g)},[e,n,o,h,l,p,g]),R.useEffect(()=>{C&&(F(C.enabled),te(C.sound?.enabled??!1),Q(C.slack?.enabled??!1),se(C.slack?.webhookUrl??""),re(C.discord?.enabled??!1),le(C.discord?.webhookUrl??""),ge(C.pushover?.enabled??!1),de(C.pushover?.appToken??""),De(C.pushover?.userKey??""))},[C]);const Oe=t||s||u||a||d||f||S||w,be=C&&(I!==C.enabled||X!==(C.sound?.enabled??!1)||ee!==(C.slack?.enabled??!1)||U!==(C.slack?.webhookUrl??"")||ne!==(C.discord?.enabled??!1)||oe!==(C.discord?.webhookUrl??"")||_e!==(C.pushover?.enabled??!1)||ue!==(C.pushover?.appToken??"")||Ie!==(C.pushover?.userKey??"")),Me=E!==String(e)||A!==n||L!==o||z!==h||$!==String(l)||q!==p||V!==g||be,pe=async()=>{const Se=[];if(E!==String(e)){const He=parseInt(E,10);!isNaN(He)&&He>=1&&He<=65535&&Se.push(new Promise(Re=>{b.mutate({key:sn.PORT,value:He},{onSettled:Re})}))}if(A!==n&&Se.push(new Promise(He=>{b.mutate({key:sn.DEFAULT_GIT_REPOS_DIR,value:A},{onSettled:He})})),L!==o&&Se.push(new Promise(He=>{b.mutate({key:sn.TASK_CREATION_COMMAND,value:L},{onSettled:He})})),z!==h&&Se.push(new Promise(He=>{b.mutate({key:sn.HOSTNAME,value:z},{onSettled:He})})),$!==String(l)){const He=parseInt($,10);!isNaN(He)&&He>=1&&He<=65535&&Se.push(new Promise(Re=>{b.mutate({key:sn.SSH_PORT,value:He},{onSettled:Re})}))}q!==p&&Se.push(new Promise(He=>{b.mutate({key:sn.LINEAR_API_KEY,value:q},{onSettled:He})})),V!==g&&Se.push(new Promise(He=>{b.mutate({key:sn.GITHUB_PAT,value:V},{onSettled:He})})),be&&Se.push(new Promise(He=>{_.mutate({enabled:I,sound:{enabled:X},slack:{enabled:ee,webhookUrl:U},discord:{enabled:ne,webhookUrl:oe},pushover:{enabled:_e,appToken:ue,userKey:Ie}},{onSettled:He})})),await Promise.all(Se),P(!0),setTimeout(()=>P(!1),2e3)},ke=()=>{x.mutate(sn.PORT,{onSuccess:Se=>{Se.value!==null&&T(String(Se.value))}})},we=()=>{x.mutate(sn.DEFAULT_GIT_REPOS_DIR,{onSuccess:Se=>{Se.value&&M(String(Se.value))}})},We=()=>{x.mutate(sn.TASK_CREATION_COMMAND,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&D(String(Se.value))}})},et=()=>{x.mutate(sn.HOSTNAME,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&H(String(Se.value))}})},xe=()=>{x.mutate(sn.SSH_PORT,{onSuccess:Se=>{Se.value!==null&&Se.value!==void 0&&N(String(Se.value))}})},Ge=()=>{x.mutate(sn.LINEAR_API_KEY,{onSuccess:Se=>{K(Se.value!==null&&Se.value!==void 0?String(Se.value):"")}})},tt=()=>{x.mutate(sn.GITHUB_PAT,{onSuccess:Se=>{Y(Se.value!==null&&Se.value!==void 0?String(Se.value):"")}})},dt=async Se=>{y.mutate(Se,{onSuccess:He=>{He.success?yr.success(`${Se} test successful`):yr.error(`${Se} test failed: ${He.error}`)},onError:He=>{yr.error(`Test failed: ${He.message}`)}})};return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:v.jsx("h1",{className:"text-sm font-medium",children:"Settings"})}),v.jsx("div",{className:"pixel-grid flex-1 overflow-auto p-6",children:v.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[v.jsx(Su,{title:"Server & Defaults",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Port"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wt,{type:"number",min:1,max:65535,value:E,onChange:Se=>T(Se.target.value),placeholder:"3333",disabled:Oe,className:"w-24 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ke,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Requires restart"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Startup Command"}),v.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v.jsx(Wt,{value:L,onChange:Se=>D(Se.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:Oe,className:"flex-1 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:We,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Command for new task terminals"})]})]})}),v.jsx(Su,{title:"Paths",children:v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-32 sm:shrink-0",children:"Git Repos Directory"}),v.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v.jsx(Wt,{value:A,onChange:Se=>M(Se.target.value),placeholder:"~/projects",disabled:Oe,className:"flex-1 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>j(!0),disabled:Oe,title:"Browse",children:v.jsx(ve,{icon:os,size:14,strokeWidth:2})}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:we,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-32 sm:pl-2",children:"Starting directory for repo picker"})]})}),v.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[v.jsx(Su,{title:"Remote Access",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Hostname"}),v.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v.jsx(Wt,{value:z,onChange:Se=>H(Se.target.value),placeholder:"e.g., citadel",disabled:Oe,className:"flex-1 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:et,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"For VS Code SSH URLs"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"SSH Port"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Wt,{type:"number",min:1,max:65535,value:$,onChange:Se=>N(Se.target.value),placeholder:"22",disabled:Oe,className:"w-20 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:xe,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"Remote connection port"})]})]})}),v.jsx(Su,{title:"Integrations",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"Linear"}),v.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v.jsx(Wt,{type:"password",value:q,onChange:Se=>K(Se.target.value),placeholder:"lin_api_...",disabled:Oe,className:"flex-1 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ge,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"API key for ticket sync"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-20 sm:shrink-0",children:"GitHub"}),v.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v.jsx(Wt,{type:"password",value:V,onChange:Se=>Y(Se.target.value),placeholder:"ghp_...",disabled:Oe,className:"flex-1 font-mono text-sm"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:tt,disabled:Oe||x.isPending,title:"Reset to default",children:v.jsx(ve,{icon:$o,size:14,strokeWidth:2})})]})]}),v.jsx("p",{className:"text-xs text-muted-foreground sm:ml-20 sm:pl-2",children:"PAT for Issues & PRs"})]})]})})]}),v.jsx(Su,{title:"Notifications",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[v.jsx("label",{className:"text-sm text-muted-foreground sm:w-40 sm:shrink-0",children:"Enable Notifications"}),v.jsx(ea,{checked:I,onCheckedChange:F,disabled:Oe})]}),v.jsx("div",{className:"space-y-2 pl-4",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ea,{checked:X,onCheckedChange:te,disabled:Oe||!I}),v.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("sound"),disabled:Oe||!I||!X||y.isPending,title:"Test sound",children:y.isPending?v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):v.jsx(ve,{icon:Hf,size:14,strokeWidth:2})})]})}),v.jsxs("div",{className:"space-y-2 pl-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ea,{checked:ee,onCheckedChange:Q,disabled:Oe||!I}),v.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("slack"),disabled:Oe||!I||!ee||!U||y.isPending,title:"Test Slack",children:y.isPending?v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):v.jsx(ve,{icon:Hf,size:14,strokeWidth:2})})]}),ee&&v.jsx(Wt,{type:"password",value:U,onChange:Se=>se(Se.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Oe||!I,className:"ml-6 flex-1 font-mono text-sm"})]}),v.jsxs("div",{className:"space-y-2 pl-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ea,{checked:ne,onCheckedChange:re,disabled:Oe||!I}),v.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("discord"),disabled:Oe||!I||!ne||!oe||y.isPending,title:"Test Discord",children:y.isPending?v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):v.jsx(ve,{icon:Hf,size:14,strokeWidth:2})})]}),ne&&v.jsx(Wt,{type:"password",value:oe,onChange:Se=>le(Se.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Oe||!I,className:"ml-6 flex-1 font-mono text-sm"})]}),v.jsxs("div",{className:"space-y-2 pl-4",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ea,{checked:_e,onCheckedChange:ge,disabled:Oe||!I}),v.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),v.jsx(Ne,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("pushover"),disabled:Oe||!I||!_e||!ue||!Ie||y.isPending,title:"Test Pushover",children:y.isPending?v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}):v.jsx(ve,{icon:Hf,size:14,strokeWidth:2})})]}),_e&&v.jsxs("div",{className:"ml-6 space-y-2",children:[v.jsx(Wt,{type:"password",value:ue,onChange:Se=>de(Se.target.value),placeholder:"App Token",disabled:Oe||!I,className:"flex-1 font-mono text-sm"}),v.jsx(Wt,{type:"password",value:Ie,onChange:Se=>De(Se.target.value),placeholder:"User Key",disabled:Oe||!I,className:"flex-1 font-mono text-sm"})]})]})]})}),v.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[W&&v.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[v.jsx(ve,{icon:Ma,size:12,strokeWidth:2}),"Saved"]}),v.jsx(Ne,{size:"sm",onClick:pe,disabled:!Me||Oe||b.isPending,children:"Save Changes"})]})]})}),v.jsx(ty,{open:G,onOpenChange:j,onSelect:Se=>M(Se),initialPath:A||void 0})]})}const Ip="";function kB(){return Kn({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${Ip}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function TB(){return Kn({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${Ip}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function LB(e,t,n){return Kn({queryKey:["github-issues",e,t,n],queryFn:async()=>{const s=new URLSearchParams({filter:e});t&&s.set("viboraReposOnly","true"),n&&s.set("org",n);const o=await fetch(`${Ip}/api/github/issues?${s}`);if(!o.ok)throw new Error("Failed to fetch issues");return o.json()},staleTime:300*1e3})}function AB(e,t,n){return Kn({queryKey:["github-prs",e,t,n],queryFn:async()=>{const s=new URLSearchParams({filter:e});t&&s.set("viboraReposOnly","true"),n&&s.set("org",n);const o=await fetch(`${Ip}/api/github/prs?${s}`);if(!o.ok)throw new Error("Failed to fetch PRs");return o.json()},staleTime:300*1e3})}function OB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=LB(e,t,n);if(o)return v.jsx("div",{className:"flex h-48 items-center justify-center",children:v.jsx(ve,{icon:zr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[v.jsx(ve,{icon:nc,size:24}),v.jsx("p",{className:"text-sm",children:"Failed to load issues"}),v.jsx("p",{className:"text-xs",children:u.message})]});const h={assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"};return s?.length?v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:s.map(a=>v.jsx(MB,{issue:a},a.id))})]}):v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[v.jsx(ve,{icon:Ma,size:24}),v.jsx("p",{className:"text-sm",children:h[e]})]})}function MB({issue:e}){return v.jsx(hd,{className:"transition-colors hover:border-border/80",children:v.jsx(pd,{className:"py-4",children:v.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[v.jsx("div",{className:"flex items-start gap-2",children:v.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),v.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:v.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>v.jsx(ba,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&v.jsxs(ba,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function DB({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=AB(e,t,n);if(o)return v.jsx("div",{className:"flex h-48 items-center justify-center",children:v.jsx(ve,{icon:zr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[v.jsx(ve,{icon:nc,size:24}),v.jsx("p",{className:"text-sm",children:"Failed to load pull requests"}),v.jsx("p",{className:"text-xs",children:u.message})]});const h={all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",review_requested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"};return s?.length?v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),v.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:s.map(a=>v.jsx(PB,{pr:a},a.id))})]}):v.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[v.jsx(ve,{icon:Ma,size:24}),v.jsx("p",{className:"text-sm",children:h[e]})]})}function PB({pr:e}){return v.jsx(hd,{className:"transition-colors hover:border-border/80",children:v.jsx(pd,{className:"py-4",children:v.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[v.jsx("div",{className:"flex items-start gap-2",children:v.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&v.jsx(ba,{variant:"secondary",className:Be("text-xs","bg-amber-400/20 text-amber-600 dark:text-amber-400"),children:"Draft"})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&v.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),v.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>v.jsx(ba,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&v.jsxs(ba,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const jB=ws("/review/")({component:IB});function IB(){const[e,t]=R.useState("prs"),[n,s]=R.useState("review_requested"),[o,u]=R.useState("assigned"),[h,a]=R.useState(!1),[l,d]=R.useState(""),{data:p,isLoading:f}=kB(),{data:g=[]}=TB();return!f&&!p?v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"flex shrink-0 items-center border-b border-border px-4 py-2",children:v.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),v.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:v.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[v.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:v.jsx(ve,{icon:B4,size:24,className:"text-muted-foreground"})}),v.jsx("h2",{className:"text-lg font-medium",children:"GitHub Token Required"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings."}),v.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[v.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Required scopes:"}),v.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[v.jsxs("li",{children:["• ",v.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," (for private repositories)"]}),v.jsxs("li",{children:["• ",v.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," (for user info)"]}),v.jsxs("li",{children:["• ",v.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," (for organization list)"]})]})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:v.jsxs(Ne,{variant:"outline",size:"sm",className:"w-full",children:[v.jsx(ve,{icon:z4,size:14,"data-slot":"icon"}),"Generate Token"]})}),v.jsx(qn,{to:"/settings",children:v.jsx(Ne,{size:"sm",className:"w-full",children:"Go to Settings"})})]})]})})]}):v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2 max-sm:px-2",children:[v.jsx("div",{className:"flex items-center gap-4 max-sm:gap-2",children:v.jsx("h1",{className:"text-sm font-medium max-sm:hidden",children:"Review"})}),v.jsxs("div",{className:"flex items-center gap-4 max-sm:gap-2",children:[e==="prs"?v.jsxs(jl,{value:n,onValueChange:S=>s(S),children:[v.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:v.jsx(Il,{})}),v.jsxs(Bl,{children:[v.jsx(vr,{value:"created",children:"Created by me"}),v.jsx(vr,{value:"assigned",children:"Assigned to me"}),v.jsx(vr,{value:"review_requested",children:"Review requests"}),v.jsx(vr,{value:"mentioned",children:"Mentioned"})]})]}):v.jsxs(jl,{value:o,onValueChange:S=>u(S),children:[v.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:v.jsx(Il,{})}),v.jsxs(Bl,{children:[v.jsx(vr,{value:"assigned",children:"Assigned to me"}),v.jsx(vr,{value:"created",children:"Created by me"}),v.jsx(vr,{value:"mentioned",children:"Mentioned"})]})]}),v.jsxs(jl,{value:l,onValueChange:S=>d(S||""),children:[v.jsx(Nl,{size:"sm",className:"max-sm:w-auto",children:v.jsx(Il,{children:l||"All Orgs"})}),v.jsxs(Bl,{children:[v.jsx(vr,{value:"",children:"All Organizations"}),g.map(S=>v.jsx(vr,{value:S.login,children:S.login},S.login))]})]}),v.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs",title:"Vibora repos only",children:[v.jsx(ea,{checked:h,onCheckedChange:a,disabled:!!l}),v.jsx("span",{className:"text-muted-foreground max-sm:hidden",children:"Vibora repos only"})]})]})]}),v.jsxs(_a,{value:e,onValueChange:S=>t(S),className:"flex flex-1 flex-col overflow-hidden",children:[v.jsx("div",{className:"shrink-0 border-b border-border px-4",children:v.jsxs(ya,{variant:"line",children:[v.jsx(ir,{value:"prs",children:"Pull Requests"}),v.jsx(ir,{value:"issues",children:"Issues"})]})}),v.jsx(_r,{value:"prs",className:"flex-1 overflow-auto p-4",children:v.jsx(DB,{filter:n,viboraReposOnly:h,org:l||void 0})}),v.jsx(_r,{value:"issues",className:"flex-1 overflow-auto p-4",children:v.jsx(OB,{filter:o,viboraReposOnly:h,org:l||void 0})})]})]})}function Kh(e,t,n){return t?`vscode://vscode-remote/ssh-remote+${n!==22?`${t}:${n}`:t}${e}`:`vscode://file${e}`}const NB=ws("/repositories/")({component:HB});function BB({repository:e,onDelete:t}){const[n,s]=R.useState(!1),[o,u]=R.useState(!1),{data:h}=Mp(),{data:a}=Dp(),l=p=>{p.preventDefault(),p.stopPropagation();const f=Kh(e.path,h,a);window.open(f,"_blank")},d=async p=>{p.preventDefault(),p.stopPropagation(),u(!0);try{await t(),s(!1)}catch{}finally{u(!1)}};return v.jsxs("div",{className:"relative h-full",children:[v.jsx(qn,{to:"/repositories/$repoId",params:{repoId:e.id},className:"block h-full",children:v.jsx(hd,{className:"h-full transition-colors hover:border-border/80 cursor-pointer",children:v.jsxs(pd,{className:"flex flex-col gap-2 py-4",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:e.displayName}),v.jsxs("div",{className:"flex shrink-0 gap-1",children:[v.jsx("div",{className:"size-6"}),v.jsx("div",{className:"size-6"})]})]}),v.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:os,size:12,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{className:"truncate font-mono",children:e.path})]}),e.startupScript&&v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:d0,size:12,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{className:"truncate font-mono",children:e.startupScript})]}),e.copyFiles&&v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(ve,{icon:A4,size:12,strokeWidth:2,className:"shrink-0"}),v.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]})})}),v.jsxs("div",{className:"absolute right-3 top-3 flex gap-1",children:[v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:l,className:"shrink-0 text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:v.jsx(ve,{icon:p0,size:14,strokeWidth:2})}),v.jsxs(uc,{open:n,onOpenChange:s,children:[v.jsx(dc,{render:v.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive"}),children:v.jsx(ve,{icon:td,size:14,strokeWidth:2})}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsx(mc,{children:"Delete Repository"}),v.jsxs(gc,{children:['This will remove "',e.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),v.jsxs(pc,{children:[v.jsx(vc,{disabled:o,children:"Cancel"}),v.jsxs(Ne,{variant:"destructive",onClick:d,disabled:o,className:"gap-2",children:[o&&v.jsx(ve,{icon:zr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})]})}function zB(){const[e,t]=R.useState(!1),[n,s]=R.useState(!1),[o,u]=R.useState(""),[h,a]=R.useState(""),[l,d]=R.useState(""),[p,f]=R.useState(""),g=Tk(),{data:S}=J0(),C=x=>{u(x),h||a(x.split("/").pop()||"")},w=x=>{x.preventDefault(),o.trim()&&g.mutate({path:o.trim(),displayName:h.trim()||o.split("/").pop()||"repo",startupScript:l.trim()||null,copyFiles:p.trim()||null},{onSuccess:()=>{t(!1),u(""),a(""),d(""),f("")}})},b=o?o.split("/").pop():"";return v.jsxs(v.Fragment,{children:[v.jsxs(xs,{open:e,onOpenChange:t,children:[v.jsxs(kR,{render:v.jsx(Ne,{size:"sm"}),children:[v.jsx(ve,{icon:rc,size:16,strokeWidth:2,"data-slot":"icon"}),"Add Repository"]}),v.jsx(Ss,{className:"sm:max-w-md",children:v.jsxs("form",{onSubmit:w,children:[v.jsxs(Bs,{children:[v.jsx(zs,{children:"Add Repository"}),v.jsx(aa,{children:"Add a git repository for quick access when creating tasks."})]}),v.jsxs(ud,{className:"mt-4",children:[v.jsxs(Cn,{children:[v.jsx(wn,{children:"Repository Path"}),v.jsxs(Ne,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>s(!0),children:[v.jsx(ve,{icon:os,size:14,strokeWidth:2,className:"mr-2"}),b?v.jsx("span",{className:"truncate",children:o}):v.jsx("span",{className:"text-muted-foreground",children:"Select repository..."})]})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),v.jsx(Wt,{id:"displayName",value:h,onChange:x=>a(x.target.value),placeholder:b||"My Project"})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),v.jsx(I0,{id:"startupScript",value:l,onChange:x=>d(x.target.value),placeholder:"npm install && npm run dev",rows:2}),v.jsx(ao,{children:"Command to run in the terminal when creating a worktree."})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),v.jsx(Wt,{id:"copyFiles",value:p,onChange:x=>f(x.target.value),placeholder:".env, config.local.json"}),v.jsx(ao,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]}),v.jsxs(vo,{className:"mt-4",children:[v.jsx(j0,{render:v.jsx(Ne,{variant:"outline",type:"button"}),children:"Cancel"}),v.jsx(Ne,{type:"submit",disabled:g.isPending||!o.trim(),children:g.isPending?"Adding...":"Add Repository"})]})]})})]}),v.jsx(ty,{open:n,onOpenChange:s,onSelect:C,initialPath:S||void 0})]})}function HB(){const{data:e,isLoading:t,error:n}=ey(),s=Lk(),o=async u=>{await s.mutateAsync(u)};return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("h1",{className:"text-sm font-medium",children:"Repositories"}),e&&v.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.length," total"]})]}),v.jsx(zB,{})]}),v.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[t&&v.jsx("div",{className:"flex items-center justify-center py-12",children:v.jsx(ve,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),n&&v.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[v.jsx(ve,{icon:nc,size:20,strokeWidth:2}),v.jsxs("span",{className:"text-sm",children:["Failed to load repositories: ",n.message]})]}),!t&&!n&&e?.length===0&&v.jsx("div",{className:"py-12 text-muted-foreground",children:v.jsx("p",{className:"text-sm",children:"No repositories added yet. Add a repository for quick access when creating tasks."})}),v.jsx("div",{className:"grid auto-rows-fr grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e?.map(u=>v.jsx(BB,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const FB=()=>`http://${window.location.hostname}:3000`,Cu={activeTab:"diff",browserUrl:FB(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1,collapsedFiles:[]},filesViewState:{selectedFile:null,expandedDirs:[]}};function Np(e){const t=$n(),n=R.useRef(void 0),s=R.useRef({}),{data:o}=Ek(e),u=R.useMemo(()=>{const g=o?.viewState;return g?{activeTab:g.activeTab??Cu.activeTab,browserUrl:g.browserUrl??Cu.browserUrl,diffOptions:{...Cu.diffOptions,...g.diffOptions},filesViewState:{...Cu.filesViewState,...g.filesViewState}}:Cu},[o?.viewState]),h=jn({mutationFn:async g=>{const S=await fetch(`/api/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({viewState:g})});if(!S.ok)throw new Error("Failed to update view state");return S.json()},onSuccess:g=>{t.setQueryData(["tasks",e],g),t.setQueryData(["tasks"],S=>S&&S.map(C=>C.id===e?g:C))}}),a=R.useCallback(g=>{const S=s.current;s.current={...S,...g,diffOptions:g.diffOptions||S.diffOptions?{...S.diffOptions,...g.diffOptions}:void 0,filesViewState:g.filesViewState||S.filesViewState?{...S.filesViewState,...g.filesViewState}:void 0};const C=s.current,w={activeTab:C.activeTab??u.activeTab,browserUrl:C.browserUrl??u.browserUrl,diffOptions:{...u.diffOptions,...C.diffOptions},filesViewState:{...u.filesViewState,...C.filesViewState}};t.setQueryData(["tasks",e],b=>b&&{...b,viewState:w}),t.setQueryData(["tasks"],b=>b&&b.map(x=>x.id===e?{...x,viewState:w}:x)),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{h.mutate(w),s.current={}},500)},[t,e,u,h]),l=R.useCallback(g=>{a({activeTab:g})},[a]),d=R.useCallback(g=>{a({browserUrl:g})},[a]),p=R.useCallback(g=>{a({diffOptions:g})},[a]),f=R.useCallback(g=>{a({filesViewState:g})},[a]);return{viewState:u,setActiveTab:l,setBrowserUrl:d,setDiffOptions:p,setFilesViewState:f}}function VB(e){const{viewState:t,setActiveTab:n}=Np(e);return{tab:t.activeTab,setTab:n}}function UB(e){return Kn({queryKey:["linear-ticket",e],queryFn:async()=>{if(!e)return null;const t=await fetch(`/api/linear/ticket/${e}`);return t.ok?t.json():null},enabled:!!e,staleTime:300*1e3})}function Lw({taskName:e,cwd:t,className:n,aiMode:s,description:o,startupScript:u}){const h=R.useRef(null),a=R.useRef(null),l=R.useRef(null),d=R.useRef(!1),p=R.useRef(!1),[f,g]=R.useState(null),[S,C]=R.useState(!1),{data:w}=kk(),{setTerminalFocused:b}=ny(),{terminals:x,terminalsLoaded:_,connected:y,newTerminalIds:E,createTerminal:T,attachXterm:A,resizeTerminal:M,setupImagePaste:L,writeToTerminal:D}=cy(),z=f?x.find(q=>q.id===f):null,H=z?.status;R.useEffect(()=>{if(!h.current||a.current)return;const q=new Zk.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),K=new Jk.FitAddon,V=new eT.WebLinksAddon;q.loadAddon(K),q.loadAddon(V),q.open(h.current),a.current=q,l.current=K,requestAnimationFrame(()=>{K.fit(),C(!0)});const Y=setTimeout(()=>{K.fit(),q.refresh(0,q.rows-1)},100),G=()=>b(!0),j=()=>b(!1);return q.textarea&&(q.textarea.addEventListener("focus",G),q.textarea.addEventListener("blur",j)),()=>{clearTimeout(Y),q.textarea&&(q.textarea.removeEventListener("focus",G),q.textarea.removeEventListener("blur",j)),b(!1),q.dispose(),a.current=null,l.current=null,C(!1)}},[b]);const $=R.useCallback(()=>{if(!l.current||!a.current)return;l.current.fit();const{cols:q,rows:K}=a.current;f&&M(f,q,K)},[f,M]);R.useEffect(()=>{if(!h.current)return;const q=()=>{requestAnimationFrame($)};window.addEventListener("resize",q);const K=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{$(),a.current&&a.current.refresh(0,a.current.rows-1)})};document.addEventListener("visibilitychange",K);const V=new ResizeObserver(q);V.observe(h.current);const Y=new IntersectionObserver(G=>{G[0]?.isIntersecting&&requestAnimationFrame(()=>{$(),a.current&&a.current.refresh(0,a.current.rows-1)})},{threshold:.1});return Y.observe(h.current),()=>{window.removeEventListener("resize",q),document.removeEventListener("visibilitychange",K),V.disconnect(),Y.disconnect()}},[$]),R.useEffect(()=>{if(!y||!t||!S||!_)return;const q=x.find(K=>K.cwd===t);if(q){g(q.id);return}if(!d.current&&a.current){d.current=!0;const{cols:K,rows:V}=a.current;T({name:e,cols:K,rows:V,cwd:t})}},[y,t,S,_,x,e,T]),R.useEffect(()=>{if(!t||f)return;const q=x.find(K=>K.cwd===t);q&&g(q.id)},[x,t,f]),R.useEffect(()=>{if(!f||!a.current||!h.current||p.current)return;const q=E.has(f);q&&E.delete(f);const K=()=>{if(requestAnimationFrame($),q){u&&setTimeout(()=>{D(f,u+"\r")},100);let G=w;s==="plan"&&o?G=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --allow-dangerously-skip-permissions --permission-mode plan`:s==="default"&&o&&(G=`claude "${`${e}: ${o}`.replace(/"/g,'\\"')}" --dangerously-skip-permissions`),G&&setTimeout(()=>{D(f,G+"\r")},u?300:100)}},V=A(f,a.current,{onAttached:K}),Y=L(h.current,f);return p.current=!0,()=>{V(),Y(),p.current=!1}},[f,A,L,t,$,w,D,s,o,e,u,E]);const N=R.useCallback(q=>{f&&D(f,q)},[f,D]);return t?v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!y&&v.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),H==="error"&&v.jsx("div",{className:"shrink-0 px-2 py-1 bg-red-500/20 text-red-500 text-xs",children:"Terminal failed to start. The worktree directory may not exist."}),H==="exited"&&v.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",z?.exitCode,")"]}),v.jsxs("div",{className:"relative min-h-0 flex-1",children:[v.jsx("div",{ref:h,className:Be("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",n)}),v.jsx("button",{onClick:()=>a.current?.scrollToBottom(),className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:v.jsx(ve,{icon:lE,size:20,strokeWidth:2})})]}),v.jsx(ly,{onSend:N})]}):v.jsx("div",{className:Be("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function WB(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function qB(e,t=[]){let n=[];function s(u,h){const a=R.createContext(h),l=n.length;n=[...n,h];const d=f=>{const{scope:g,children:S,...C}=f,w=g?.[e]?.[l]||a,b=R.useMemo(()=>C,Object.values(C));return v.jsx(w.Provider,{value:b,children:S})};d.displayName=u+"Provider";function p(f,g){const S=g?.[e]?.[l]||a,C=R.useContext(S);if(C)return C;if(h!==void 0)return h;throw new Error(`\`${f}\` must be used within \`${u}\``)}return[d,p]}const o=()=>{const u=n.map(h=>R.createContext(h));return function(a){const l=a?.[e]||u;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[s,GB(o,...t)]}function GB(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const h=s.reduce((a,{useScope:l,scopeName:d})=>{const f=l(u)[`__scope${d}`];return{...a,...f}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:h}),[h])}};return n.scopeName=t.scopeName,n}var Yu=globalThis?.document?R.useLayoutEffect:()=>{},$B=ip[" useInsertionEffect ".trim().toString()]||Yu;function KB({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[o,u,h]=YB({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const p=R.useRef(e!==void 0);R.useEffect(()=>{const f=p.current;f!==a&&console.warn(`${s} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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=a},[a,s])}const d=R.useCallback(p=>{if(a){const f=XB(p)?p(e):p;f!==e&&h.current?.(f)}else u(p)},[a,e,u,h]);return[l,d]}function YB({defaultProp:e,onChange:t}){const[n,s]=R.useState(e),o=R.useRef(n),u=R.useRef(t);return $B(()=>{u.current=t},[t]),R.useEffect(()=>{o.current!==n&&(u.current?.(n),o.current=n)},[n,o]),[n,s,u]}function XB(e){return typeof e=="function"}function Aw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function LT(...e){return t=>{let n=!1;const s=e.map(o=>{const u=Aw(o,t);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let o=0;o<s.length;o++){const u=s[o];typeof u=="function"?u():Aw(e[o],null)}}}}function AT(...e){return R.useCallback(LT(...e),e)}function QB(e){const t=ZB(e),n=R.forwardRef((s,o)=>{const{children:u,...h}=s,a=R.Children.toArray(u),l=a.find(ez);if(l){const d=l.props.children,p=a.map(f=>f===l?R.Children.count(d)>1?R.Children.only(null):R.isValidElement(d)?d.props.children:null:f);return v.jsx(t,{...h,ref:o,children:R.isValidElement(d)?R.cloneElement(d,void 0,p):null})}return v.jsx(t,{...h,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function ZB(e){const t=R.forwardRef((n,s)=>{const{children:o,...u}=n;if(R.isValidElement(o)){const h=nz(o),a=tz(u,o.props);return o.type!==R.Fragment&&(a.ref=s?LT(s,h):h),R.cloneElement(o,a)}return R.Children.count(o)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JB=Symbol("radix.slottable");function ez(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JB}function tz(e,t){const n={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...a)=>{const l=u(...a);return o(...a),l}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function nz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fy=rz.reduce((e,t)=>{const n=QB(`Primitive.${t}`),s=R.forwardRef((o,u)=>{const{asChild:h,...a}=o,l=h?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...a,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function sz(e,t){return R.useReducer((n,s)=>t[n][s]??n,e)}var OT=e=>{const{present:t,children:n}=e,s=iz(t),o=typeof n=="function"?n({present:s.isPresent}):R.Children.only(n),u=AT(s.ref,oz(o));return typeof n=="function"||s.isPresent?R.cloneElement(o,{ref:u}):null};OT.displayName="Presence";function iz(e){const[t,n]=R.useState(),s=R.useRef(null),o=R.useRef(e),u=R.useRef("none"),h=e?"mounted":"unmounted",[a,l]=sz(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const d=ih(s.current);u.current=a==="mounted"?d:"none"},[a]),Yu(()=>{const d=s.current,p=o.current;if(p!==e){const g=u.current,S=ih(d);e?l("MOUNT"):S==="none"||d?.display==="none"?l("UNMOUNT"):l(p&&g!==S?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Yu(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=S=>{const w=ih(s.current).includes(CSS.escape(S.animationName));if(S.target===t&&w&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},g=S=>{S.target===t&&(u.current=ih(s.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(d=>{s.current=d?getComputedStyle(d):null,n(d)},[])}}function ih(e){return e?.animationName||"none"}function oz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var az=ip[" useId ".trim().toString()]||(()=>{}),lz=0;function cz(e){const[t,n]=R.useState(az());return Yu(()=>{n(s=>s??String(lz++))},[e]),e||(t?`radix-${t}`:"")}var Bp="Collapsible",[uz]=qB(Bp),[dz,hy]=uz(Bp),MT=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:u,onOpenChange:h,...a}=e,[l,d]=KB({prop:s,defaultProp:o??!1,onChange:h,caller:Bp});return v.jsx(dz,{scope:n,disabled:u,contentId:cz(),open:l,onOpenToggle:R.useCallback(()=>d(p=>!p),[d]),children:v.jsx(fy.div,{"data-state":my(l),"data-disabled":u?"":void 0,...a,ref:t})})});MT.displayName=Bp;var DT="CollapsibleTrigger",PT=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,...s}=e,o=hy(DT,n);return v.jsx(fy.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":my(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:t,onClick:WB(e.onClick,o.onOpenToggle)})});PT.displayName=DT;var py="CollapsibleContent",jT=R.forwardRef((e,t)=>{const{forceMount:n,...s}=e,o=hy(py,e.__scopeCollapsible);return v.jsx(OT,{present:n||o.open,children:({present:u})=>v.jsx(fz,{...s,ref:t,present:u})})});jT.displayName=py;var fz=R.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:s,children:o,...u}=e,h=hy(py,n),[a,l]=R.useState(s),d=R.useRef(null),p=AT(t,d),f=R.useRef(0),g=f.current,S=R.useRef(0),C=S.current,w=h.open||a,b=R.useRef(w),x=R.useRef(void 0);return R.useEffect(()=>{const _=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(_)},[]),Yu(()=>{const _=d.current;if(_){x.current=x.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const y=_.getBoundingClientRect();f.current=y.height,S.current=y.width,b.current||(_.style.transitionDuration=x.current.transitionDuration,_.style.animationName=x.current.animationName),l(s)}},[h.open,s]),v.jsx(fy.div,{"data-state":my(h.open),"data-disabled":h.disabled?"":void 0,id:h.contentId,hidden:!w,...u,ref:p,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:w&&o})});function my(e){return e?"open":"closed"}var hz=MT;const pz=hz,mz=PT,gz=jT;function vz(e){const{viewState:t,setDiffOptions:n}=Np(e),{collapsedFiles:s}=t.diffOptions,o=R.useCallback(l=>{const d=s.includes(l);n({collapsedFiles:d?s.filter(p=>p!==l):[...s,l]})},[s,n]),u=R.useCallback(l=>{n({collapsedFiles:l})},[n]),h=R.useCallback(()=>{n({collapsedFiles:[]})},[n]),a=R.useCallback(l=>s.includes(l),[s]);return{options:t.diffOptions,setOption:(l,d)=>{n({[l]:d})},setOptions:n,toggleFileCollapse:o,collapseAll:u,expandAll:h,isFileCollapsed:a}}function _z(e){const t=[];let n=null,s=0,o=0;for(const u of e.split(`
40
+ `))if(u.startsWith("diff --git"))n={path:u.match(/diff --git a\/(.+?) b\//)?.[1]??"unknown",lines:[],additions:0,deletions:0},t.push(n),n.lines.push({type:"header",content:u});else if(u.startsWith("index ")||u.startsWith("---")||u.startsWith("+++"))n?.lines.push({type:"header",content:u});else if(u.startsWith("@@")){const h=u.match(/@@ -(\d+),?\d* \+(\d+),?\d* @@/);h&&(s=parseInt(h[1],10),o=parseInt(h[2],10)),n?.lines.push({type:"hunk",content:u})}else u.startsWith("+")?n&&(n.additions++,n.lines.push({type:"added",content:u.slice(1),newLineNumber:o++})):u.startsWith("-")?n&&(n.deletions++,n.lines.push({type:"removed",content:u.slice(1),oldLineNumber:s++})):u.startsWith(" ")&&n?.lines.push({type:"context",content:u.slice(1),oldLineNumber:s++,newLineNumber:o++});return t}function yz({file:e,wrap:t,isCollapsed:n,onToggle:s}){return v.jsxs(pz,{open:!n,onOpenChange:()=>s(),children:[v.jsx(mz,{asChild:!0,children:v.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-muted/30 border-b border-border cursor-pointer hover:bg-muted/50 select-none",children:[v.jsx(ve,{icon:n?mp:pp,size:12,strokeWidth:2,className:"text-muted-foreground shrink-0"}),v.jsx("span",{className:"font-mono text-xs text-foreground truncate flex-1",children:e.path}),v.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[e.additions>0&&v.jsxs("span",{className:"text-green-500",children:["+",e.additions]}),e.additions>0&&e.deletions>0&&" ",e.deletions>0&&v.jsxs("span",{className:"text-red-500",children:["-",e.deletions]})]})]})}),v.jsx(gz,{children:v.jsx("div",{className:"font-mono text-xs",children:e.lines.slice(1).map((o,u)=>v.jsxs("div",{className:Be("flex px-2 py-0.5",o.type==="added"&&"bg-green-500/10",o.type==="removed"&&"bg-red-500/10",o.type==="header"&&"bg-muted/50 text-muted-foreground",o.type==="hunk"&&"bg-blue-500/10 text-blue-400"),children:[(o.type==="added"||o.type==="removed"||o.type==="context")&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:o.oldLineNumber??""}),v.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:o.newLineNumber??""})]}),v.jsxs("span",{className:Be("w-4 shrink-0 select-none text-center",o.type==="added"&&"text-green-500",o.type==="removed"&&"text-red-500"),children:[o.type==="added"&&"+",o.type==="removed"&&"-"]}),v.jsx("span",{className:Be("flex-1",t?"whitespace-pre-wrap break-all":"whitespace-pre",o.type==="added"&&"text-green-400",o.type==="removed"&&"text-red-400"),children:o.content})]},u))})})]})}function Ow({taskId:e,worktreePath:t}){const{options:n,setOption:s,toggleFileCollapse:o,collapseAll:u,expandAll:h,isFileCollapsed:a}=vz(e),{wrap:l,ignoreWhitespace:d,includeUntracked:p,collapsedFiles:f}=n,{data:g,isLoading:S,error:C}=xI(t,{ignoreWhitespace:d,includeUntracked:p}),w=R.useMemo(()=>g?.diff?_z(g.diff):[],[g?.diff]),b=R.useMemo(()=>w.map(y=>y.path),[w]),x=w.length>0&&f.length===w.length;if(R.useEffect(()=>{const y=E=>{if(E.shiftKey&&E.key==="C"&&!E.ctrlKey&&!E.metaKey&&!E.altKey){const T=E.target;if(T.tagName==="INPUT"||T.tagName==="TEXTAREA"||T.isContentEditable)return;E.preventDefault(),x?h():u(b)}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,b,u,h]),!t)return v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"});if(S)return v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading diff..."});if(C)return v.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:C.message});const _=g?.files?.some(y=>y.status==="untracked")??!1;return w.length===0?v.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[v.jsx("p",{children:"No changes detected"}),g?.files&&g.files.length>0&&v.jsxs("div",{className:"text-xs",children:[v.jsx("p",{className:"text-center mb-2",children:"Modified files:"}),v.jsxs("div",{className:"flex flex-col gap-1",children:[g.files.map(y=>v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("span",{className:Be("w-4 text-center",y.status==="added"&&"text-green-500",y.status==="deleted"&&"text-red-500",y.status==="modified"&&"text-yellow-500",y.status==="untracked"&&"text-gray-500"),children:[y.status==="added"&&"A",y.status==="deleted"&&"D",y.status==="modified"&&"M",y.status==="untracked"&&"?"]}),v.jsx("span",{children:y.path})]},y.path)),_&&v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-muted-foreground hover:text-foreground mt-1",children:[v.jsx("input",{type:"checkbox",checked:p,onChange:y=>s("includeUntracked",y.target.checked),className:"w-4 h-3"}),v.jsx("span",{children:"Show untracked files"})]})]})]})]}):v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[g?.branch&&v.jsxs("span",{className:"text-muted-foreground",children:[g.branch,g.isBranchDiff&&v.jsx("span",{className:"opacity-70",children:" (vs master)"})]}),v.jsx("div",{className:"flex-1"}),v.jsxs("button",{onClick:()=>x?h():u(b),className:"flex items-center gap-1 px-1.5 py-0.5 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:x?"Expand all (Shift+C)":"Collapse all (Shift+C)",children:[v.jsx(ve,{icon:x?gE:hE,size:12,strokeWidth:2}),v.jsx("span",{className:"hidden sm:inline",children:x?"Expand":"Collapse"})]}),v.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[v.jsx("input",{type:"checkbox",checked:l,onChange:y=>s("wrap",y.target.checked),className:"w-3 h-3"}),"Wrap"]}),v.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:y=>s("ignoreWhitespace",y.target.checked),className:"w-3 h-3"}),"Ignore whitespace"]}),v.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[v.jsx("input",{type:"checkbox",checked:p,onChange:y=>s("includeUntracked",y.target.checked),className:"w-3 h-3"}),"Untracked"]})]}),v.jsx(Yl,{className:"flex-1 min-h-0",children:w.map(y=>v.jsx(yz,{file:y,wrap:l,isCollapsed:a(y.path),onToggle:()=>o(y.path)},y.path))})]})}function bz(e){const{viewState:t,setBrowserUrl:n}=Np(e);return{url:t.browserUrl,setUrl:n}}function Mw({taskId:e}){const{url:t,setUrl:n}=bz(e),[s,o]=R.useState(t),[u,h]=R.useState(0);R.useEffect(()=>{o(t)},[t]);const a=R.useCallback(()=>{h(d=>d+1)},[]),l=R.useCallback(d=>{d.preventDefault();let p=s.trim();!p.startsWith("http://")&&!p.startsWith("https://")&&(p=`http://${p}`),n(p),h(f=>f+1)},[s,n]);return v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2 py-1.5",children:[v.jsx(Ne,{variant:"ghost",size:"icon-xs",disabled:!0,children:v.jsx(ve,{icon:cE,size:14,strokeWidth:2})}),v.jsx(Ne,{variant:"ghost",size:"icon-xs",disabled:!0,children:v.jsx(ve,{icon:mp,size:14,strokeWidth:2})}),v.jsx(Ne,{variant:"ghost",size:"icon-xs",onClick:a,children:v.jsx(ve,{icon:V4,size:14,strokeWidth:2})}),v.jsx("form",{onSubmit:l,className:"flex-1",children:v.jsx(Wt,{value:s,onChange:d=>o(d.target.value),className:"h-7 bg-background text-xs",placeholder:"Enter URL..."})})]}),v.jsx("div",{className:"flex-1 overflow-hidden bg-white",children:v.jsx("iframe",{src:t,className:"h-full w-full border-0",title:"Browser Preview",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},u)})]})}function xz(e){const{viewState:t,setFilesViewState:n}=Np(e),s=t.filesViewState??{selectedFile:null,expandedDirs:[]},o=R.useCallback(a=>{n({selectedFile:a})},[n]),u=R.useCallback(a=>{const d=s.expandedDirs.includes(a)?s.expandedDirs.filter(p=>p!==a):[...s.expandedDirs,a];n({expandedDirs:d})},[s.expandedDirs,n]),h=R.useCallback(()=>{n({expandedDirs:[]})},[n]);return{selectedFile:s.selectedFile,expandedDirs:s.expandedDirs,setSelectedFile:o,toggleDir:u,collapseAll:h}}function Sz(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?I4:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?O4:M4}function IT({entry:e,depth:t,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u}){const h=s.includes(e.path),a=n===e.path,l=e.type==="directory",d=R.useCallback(()=>{l?u(e.path):o(e.path)},[l,e.path,o,u]);return v.jsxs("div",{children:[v.jsxs("div",{className:Be("flex items-center gap-1.5 px-2 py-0.5 cursor-pointer text-sm hover:bg-muted/50",a&&"bg-primary/10 text-primary"),style:{paddingLeft:`${t*12+8}px`},onClick:d,children:[v.jsx(ve,{icon:l?h?d_:os:Sz(e.name),size:14,strokeWidth:2,className:Be("shrink-0",l?"text-yellow-500":"text-muted-foreground")}),v.jsx("span",{className:"break-all",children:e.name})]}),l&&h&&e.children&&v.jsx("div",{children:e.children.map(p=>v.jsx(IT,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function Dw({entries:e,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o,onCollapseAll:u}){return e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No files"}):v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1 border-b border-border",children:[v.jsx("span",{className:"text-xs text-muted-foreground",children:"Files"}),v.jsx("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Collapse all",children:v.jsx(ve,{icon:hE,size:14,strokeWidth:2})})]}),v.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>v.jsx(IT,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const Cz="modulepreload",wz=function(e){return"/"+e},Pw={},J=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var h=d;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=d(n.map(p=>{if(p=wz(p),p in Pw)return;Pw[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const S=document.createElement("link");if(S.rel=f?"stylesheet":Cz,f||(S.as="script"),S.crossOrigin="",S.href=p,l&&S.setAttribute("nonce",l),document.head.appendChild(S),f)return new Promise((C,w)=>{S.addEventListener("load",C),S.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return o.then(a=>{for(const l of a||[])l.status==="rejected"&&u(l.reason);return t().catch(u)})};let En=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ez(e){return gy(e)}function gy(e){return Array.isArray(e)?Rz(e):e instanceof RegExp?e:typeof e=="object"?kz(e):e}function Rz(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=gy(e[n]);return t}function kz(e){let t={};for(let n in e)t[n]=gy(e[n]);return t}function NT(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function BT(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?BT(e.substring(0,e.length-1)):e.substr(~t+1)}var zv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,oh=class{static hasCaptures(e){return e===null?!1:(zv.lastIndex=0,zv.test(e))}static replaceCaptures(e,t,n){return e.replace(zv,(s,o,u,h)=>{let a=n[parseInt(o||u,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(h){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return s})}};function zT(e,t){return e<t?-1:e>t?1:0}function HT(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,s=t.length;if(n===s){for(let o=0;o<n;o++){let u=zT(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function jw(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function FT(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var VT=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Yh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Az(e),t)}static createFromParsedTheme(e,t){return Mz(e,t)}_cachedMatchRoot=new VT(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(o=>Tz(e.parent,o.parentScopes));return s?new UT(s.fontStyle,s.foreground,s.background):null}},Hv=class _h{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new _h(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new _h(n,t[s]);return n}push(t){return new _h(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push(s.scopeName),s=s.parent;return s===t?n.reverse():void 0}};function Tz(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let s=t[n],o=!1;if(s===">"){if(n===t.length-1)return!1;s=t[++n],o=!0}for(;e&&!Lz(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lz(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var UT=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Az(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],s=0;for(let o=0,u=t.length;o<u;o++){let h=t[o];if(!h.settings)continue;let a;if(typeof h.scope=="string"){let f=h.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),a=f.split(",")}else Array.isArray(h.scope)?a=h.scope:a=[""];let l=-1;if(typeof h.settings.fontStyle=="string"){l=0;let f=h.settings.fontStyle.split(" ");for(let g=0,S=f.length;g<S;g++)switch(f[g]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let d=null;typeof h.settings.foreground=="string"&&jw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&jw(h.settings.background)&&(p=h.settings.background);for(let f=0,g=a.length;f<g;f++){let C=a[f].trim().split(" "),w=C[C.length-1],b=null;C.length>1&&(b=C.slice(0,C.length-1),b.reverse()),n[s++]=new Oz(w,b,o,l,d,p)}}return n}var Oz=class{constructor(e,t,n,s,o,u){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=s,this.foreground=o,this.background=u}},Zn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Zn||{});function Mz(e,t){e.sort((l,d)=>{let p=zT(l.scope,d.scope);return p!==0||(p=HT(l.parentScopes,d.parentScopes),p!==0)?p:l.index-d.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(s=l.foreground),l.background!==null&&(o=l.background)}let u=new Dz(t),h=new UT(n,u.getId(s),u.getId(o)),a=new jz(new M_(0,null,-1,0,0),[]);for(let l=0,d=e.length;l<d;l++){let p=e[l];a.insert(0,p.scope,p.parentScopes,p.fontStyle,u.getId(p.foreground),u.getId(p.background))}return new Yh(u,h,a)}var Dz=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Pz=Object.freeze([]),M_=class WT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||Pz,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new WT(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let s=0,o=t.length;s<o;s++)n[s]=t[s].clone();return n}acceptOverwrite(t,n,s,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},jz=class D_{constructor(t,n=[],s={}){this._mainRule=t,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let s=0,o=0;for(;t.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=t.parentScopes.length||o>=n.parentScopes.length);){const u=n.parentScopes[o].length-t.parentScopes[s].length;if(u!==0)return u;s++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),o,u;if(s===-1?(o=t,u=""):(o=t.substring(0,s),u=t.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(u)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(D_._cmpBySpecificity),n}insert(t,n,s,o,u,h){if(n===""){this._doInsertHere(t,s,o,u,h);return}let a=n.indexOf("."),l,d;a===-1?(l=n,d=""):(l=n.substring(0,a),d=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new D_(this._mainRule.clone(),M_.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,d,s,o,u,h)}_doInsertHere(t,n,s,o,u){if(n===null){this._mainRule.acceptOverwrite(t,s,o,u);return}for(let h=0,a=this._rulesWithParentScopes.length;h<a;h++){let l=this._rulesWithParentScopes[h];if(HT(l.parentScopes,n)===0){l.acceptOverwrite(t,s,o,u);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),u===0&&(u=this._mainRule.background),this._rulesWithParentScopes.push(new M_(t,n,s,o,u))}},Zl=class Jr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Jr.getLanguageId(t),s=Jr.getTokenType(t),o=Jr.getFontStyle(t),u=Jr.getForeground(t),h=Jr.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:u,background:h})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,s,o,u,h,a){let l=Jr.getLanguageId(t),d=Jr.getTokenType(t),p=Jr.containsBalancedBrackets(t)?1:0,f=Jr.getFontStyle(t),g=Jr.getForeground(t),S=Jr.getBackground(t);return n!==0&&(l=n),s!==8&&(d=s),o!==null&&(p=o?1:0),u!==-1&&(f=u),h!==0&&(g=h),a!==0&&(S=a),(l<<0|d<<8|p<<10|f<<11|g<<15|S<<24)>>>0}};function Xh(e,t){const n=[],s=Iz(e);let o=s.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let d=h();if(n.push({matcher:d,priority:l}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const l=u();return d=>!!l&&!l(d)}if(o==="("){o=s.next();const l=a();return o===")"&&(o=s.next()),l}if(Iw(o)){const l=[];do l.push(o),o=s.next();while(Iw(o));return d=>t(l,d)}return null}function h(){const l=[];let d=u();for(;d;)l.push(d),d=u();return p=>l.every(f=>f(p))}function a(){const l=[];let d=h();for(;d&&(l.push(d),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");d=h()}return p=>l.some(f=>f(p))}}function Iw(e){return!!e&&!!e.match(/[\w\.:]+/)}function Iz(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=t.exec(e),s}}}function qT(e){typeof e.dispose=="function"&&e.dispose()}var Xu=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Nz=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Bz=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},zz=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Xu(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Bz;for(const n of e)Hz(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Xu){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Hz(e,t,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const u=n.lookup(t);e instanceof Xu?yh({baseGrammar:u,selfGrammar:o},s):P_(e.ruleName,{baseGrammar:u,selfGrammar:o,repository:o.repository},s);const h=n.injections(e.scopeName);if(h)for(const a of h)s.add(new Xu(a))}function P_(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];Qh([s],t,n)}}function yh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Qh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Qh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Qh(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?NT({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&Qh(s.patterns,{...t,repository:o},n);const u=s.include;if(!u)continue;const h=GT(u);switch(h.kind){case 0:yh({...t,selfGrammar:t.baseGrammar},n);break;case 1:yh(t,n);break;case 2:P_(h.ruleName,{...t,repository:o},n);break;case 3:case 4:const a=h.scopeName===t.selfGrammar.scopeName?t.selfGrammar:h.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};h.kind===4?P_(h.ruleName,l,n):yh(l,n)}else h.kind===4?n.add(new Nz(h.scopeName,h.ruleName)):n.add(new Xu(h.scopeName));break}}}var Fz=class{kind=0},Vz=class{kind=1},Uz=class{constructor(e){this.ruleName=e}kind=2},Wz=class{constructor(e){this.scopeName=e}kind=3},qz=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function GT(e){if(e==="$base")return new Fz;if(e==="$self")return new Vz;const t=e.indexOf("#");if(t===-1)return new Wz(e);if(t===0)return new Uz(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new qz(n,s)}}var Gz=/\\(\d+)/,Nw=/\\(\d+)/g,$z=-1,$T=-2;var vd=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,s){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=oh.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=oh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${BT(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:oh.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:oh.replaceCaptures(this._contentName,e,t)}},Kz=class extends vd{retokenizeCapturedWithRuleId;constructor(e,t,n,s,o){super(e,t,n,s),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,s){throw new Error("Not supported!")}},Yz=class extends vd{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,null),this._match=new Qu(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Zu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bw=class extends vd{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,s),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Zu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},j_=class extends vd{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o,u,h,a,l,d){super(e,t,n,s),this._begin=new Qu(o,this.id),this.beginCaptures=u,this._end=new Qu(h||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Zu;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Zh=class extends vd{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,s,o,u,h,a,l){super(e,t,n,s),this._begin=new Qu(o,this.id),this.beginCaptures=u,this.whileCaptures=a,this._while=new Qu(h,$T),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Zu;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Zu,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},KT=class Qn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new Kz(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Yz(t.$vscodeTextmateLocation,t.id,t.name,t.match,Qn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=NT({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new Bw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Qn._compilePatterns(u,n,s))}return t.while?new Zh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qn._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,Qn._compileCaptures(t.whileCaptures||t.captures,n,s),Qn._compilePatterns(t.patterns,n,s)):new j_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qn._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,Qn._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,Qn._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let u=0;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);a>u&&(u=a)}for(let h=0;h<=u;h++)o[h]=null;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);let l=0;t[h].patterns&&(l=Qn.getCompiledRuleId(t[h],n,s)),o[a]=Qn.createCaptureRule(n,t[h].$vscodeTextmateLocation,t[h].name,t[h].contentName,l)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let u=0,h=t.length;u<h;u++){const a=t[u];let l=-1;if(a.include){const d=GT(a.include);switch(d.kind){case 0:case 1:l=Qn.getCompiledRuleId(s[a.include],n,s);break;case 2:let p=s[d.ruleName];p&&(l=Qn.getCompiledRuleId(p,n,s));break;case 3:case 4:const f=d.scopeName,g=d.kind===4?d.ruleName:null,S=n.getExternalGrammar(f,s);if(S)if(g){let C=S.repository[g];C&&(l=Qn.getCompiledRuleId(C,n,S.repository))}else l=Qn.getCompiledRuleId(S.repository.$self,n,S.repository);break}}else l=Qn.getCompiledRuleId(a,n,s);if(l!==-1){const d=n.getRule(l);let p=!1;if((d instanceof Bw||d instanceof j_||d instanceof Zh)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Qu=class YT{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const s=t.length;let o=0,u=[],h=!1;for(let a=0;a<s;a++)if(t.charAt(a)==="\\"&&a+1<s){const d=t.charAt(a+1);d==="z"?(u.push(t.substring(o,a)),u.push("$(?!\\n)(?<!\\n)"),o=a+2):(d==="A"||d==="G")&&(h=!0),a++}this.hasAnchor=h,o===0?this.source=t:(u.push(t.substring(o,s)),this.source=u.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Gz.test(this.source):this.hasBackReferences=!1}clone(){return new YT(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>t.substring(o.start,o.end));return Nw.lastIndex=0,this.source.replace(Nw,(o,u)=>FT(s[parseInt(u,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],s=[],o=[],u,h,a,l;for(u=0,h=this.source.length;u<h;u++)a=this.source.charAt(u),t[u]=a,n[u]=a,s[u]=a,o[u]=a,a==="\\"&&u+1<h&&(l=this.source.charAt(u+1),l==="A"?(t[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):l==="G"?(t[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(t[u+1]=l,n[u+1]=l,s[u+1]=l,o[u+1]=l),u++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Zu=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new zw(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let s=this._items.map(o=>o.resolveAnchors(t,n));return new zw(e,s,this._items.map(o=>o.ruleId))}},zw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
41
+ `)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Fv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Xz=class I_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Fv(t,8),this._embeddedLanguagesMatcher=new Qz(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?I_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Fv(0,0);_getBasicScopeAttributes=new VT(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Fv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(I_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Qz=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>FT(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Hw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function XT(e,t,n,s,o,u,h,a){const l=t.content.length;let d=!1,p=-1;if(h){const S=Zz(e,t,n,s,o,u);o=S.stack,s=S.linePos,n=S.isFirstLine,p=S.anchorPosition}const f=Date.now();for(;!d;){if(a!==0&&Date.now()-f>a)return new Hw(o,!0);g()}return new Hw(o,!1);function g(){const S=Jz(e,t,n,s,o,p);if(!S){u.produce(o,l),d=!0;return}const C=S.captureIndices,w=S.matchedRuleId,b=C&&C.length>0?C[0].end>s:!1;if(w===$z){const x=o.getRule(e);u.produce(o,C[0].start),o=o.withContentNameScopesList(o.nameScopesList),Tu(e,t,n,o,u,x.endCaptures,C),u.produce(o,C[0].end);const _=o;if(o=o.parent,p=_.getAnchorPos(),!b&&_.getEnterPos()===s){o=_,u.produce(o,l),d=!0;return}}else{const x=e.getRule(w);u.produce(o,C[0].start);const _=o,y=x.getName(t.content,C),E=o.contentNameScopesList.pushAttributed(y,e);if(o=o.push(w,s,p,C[0].end===l,null,E,E),x instanceof j_){const T=x;Tu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.endHasBackReferences&&(o=o.withEndRule(T.getEndWithResolvedBackReferences(t.content,C))),!b&&_.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(x instanceof Zh){const T=x;Tu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.whileHasBackReferences&&(o=o.withEndRule(T.getWhileWithResolvedBackReferences(t.content,C))),!b&&_.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(Tu(e,t,n,o,u,x.captures,C),u.produce(o,C[0].end),o=o.pop(),!b){o=o.safePop(),u.produce(o,l),d=!0;return}}C[0].end>s&&(s=C[0].end,n=!1)}}function Zz(e,t,n,s,o,u){let h=o.beginRuleCapturedEOL?0:-1;const a=[];for(let l=o;l;l=l.pop()){const d=l.getRule(e);d instanceof Zh&&a.push({rule:d,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:d,findOptions:p}=nH(l.rule,e,l.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==$T){o=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(u.produce(l.stack,f.captureIndices[0].start),Tu(e,t,n,l.stack,u,l.rule.whileCaptures,f.captureIndices),u.produce(l.stack,f.captureIndices[0].end),h=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:h,isFirstLine:n}}function Jz(e,t,n,s,o,u){const h=eH(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const l=tH(a,e,t,n,s,o,u);if(!l)return h;if(!h)return l;const d=h.captureIndices[0].start,p=l.captureIndices[0].start;return p<d||l.priorityMatch&&p===d?l:h}function eH(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:l}=QT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,l);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function tH(e,t,n,s,o,u,h){let a=Number.MAX_VALUE,l=null,d,p=0;const f=u.contentNameScopesList.getScopeNames();for(let g=0,S=e.length;g<S;g++){const C=e[g];if(!C.matcher(f))continue;const w=t.getRule(C.ruleId),{ruleScanner:b,findOptions:x}=QT(w,t,null,s,o===h),_=b.findNextMatchSync(n,o,x);if(!_)continue;const y=_.captureIndices[0].start;if(!(y>=a)&&(a=y,l=_.captureIndices,d=_.ruleId,p=C.priority,a===o))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:d}:null}function QT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function nH(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function Tu(e,t,n,s,o,u,h){if(u.length===0)return;const a=t.content,l=Math.min(u.length,h.length),d=[],p=h[0].end;for(let f=0;f<l;f++){const g=u[f];if(g===null)continue;const S=h[f];if(S.length===0)continue;if(S.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=S.start;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?o.produceFromScopes(d[d.length-1].scopes,S.start):o.produce(s,S.start),g.retokenizeCapturedWithRuleId){const w=g.getName(a,h),b=s.contentNameScopesList.pushAttributed(w,e),x=g.getContentName(a,h),_=b.pushAttributed(x,e),y=s.push(g.retokenizeCapturedWithRuleId,S.start,-1,!1,null,b,_),E=e.createOnigString(a.substring(0,S.end));XT(e,E,n&&S.start===0,S.start,y,o,!1,0),qT(E);continue}const C=g.getName(a,h);if(C!==null){const b=(d.length>0?d[d.length-1].scopes:s.contentNameScopesList).pushAttributed(C,e);d.push(new rH(b,S.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var rH=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function sH(e,t,n,s,o,u,h,a){return new oH(e,t,n,s,o,u,h,a)}function Fw(e,t,n,s,o){const u=Xh(t,Jh),h=KT.getCompiledRuleId(n,s,o.repository);for(const a of u)e.push({debugSelector:t,matcher:a.matcher,ruleId:h,grammar:o,priority:a.priority})}function Jh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<t.length;o++)if(iH(t[o],s))return n=o+1,!0;return!1})}function iH(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var oH=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new Xz(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=Vw(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const l of Object.keys(o)){const d=Xh(l,Jh);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let h in o)Fw(t,h,o[h],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(h=>{const a=this.getExternalGrammar(h);if(a){const l=a.injectionSelector;l&&Fw(t,l,a,this,a)}})}return t.sort((o,u)=>o.priority-u.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Vw(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const s=this._tokenize(e,t,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,n=0){const s=this._tokenize(e,t,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,n,s){this._rootId===-1&&(this._rootId=KT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===N_.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),f=Zl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let S;g?S=ju.createRootAndLookUpScopeName(g,f,this):S=ju.createRoot("unknown",f),t=new N_(null,this._rootId,-1,-1,!1,null,S,S)}else o=!1,t.reset();e=e+`
42
+ `;const u=this.createOnigString(e),h=u.content.length,a=new lH(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=XT(this,u,o,0,t,a,!0,s);return qT(u),{lineLength:h,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Vw(e,t){return e=Ez(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ju=class js{constructor(t,n,s){this.parent=t,this.scopePath=n,this.tokenAttributes=s}static fromExtension(t,n){let s=t,o=t?.scopePath??null;for(const u of n)o=Hv.push(o,u.scopeNames),s=new js(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new js(null,new Hv(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Hv(null,t),h=s.themeProvider.themeMatch(u),a=js.mergeAttributes(n,o,h);return new js(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return js.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,s){let o=-1,u=0,h=0;return s!==null&&(o=s.fontStyle,u=s.foregroundId,h=s.backgroundId),Zl.set(t,n.languageId,n.tokenType,null,o,u,h)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return js._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=js._pushAttributed(o,u,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),u=t.scopePath.push(n),h=s.themeProvider.themeMatch(u),a=js.mergeAttributes(t.tokenAttributes,o,h);return new js(t,u,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===t?n.reverse():void 0}},N_=class Zo{constructor(t,n,s,o,u,h,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=h,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Zo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Zo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?ju.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Zo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,u,h,a){return new Zo(this,t,n,s,o,u,h,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Zo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const s=ju.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Zo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,ju.fromExtension(s,n.contentNameScopesList))}},aH=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Xh(n,Jh).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Xh(n,Jh).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lH=class{constructor(e,t,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const u=e?.getScopeNames()??[];for(const h of this._tokenTypeOverrides)h.matcher(u)&&(s=Zl.set(s,0,h.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(u))}if(o&&(s=Zl.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},cH=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,s,o){if(!this._grammars.has(e)){let u=this._rawGrammars.get(e);if(!u)return null;this._grammars.set(e,sH(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},uH=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new cH(Yh.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Yh.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,s){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,n,s){return this._loadGrammar(t,n,s.embeddedLanguages,s.tokenTypes,new aH(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new zz(this._syncRegistry,t);for(;h.Q.length>0;)h.Q.map(a=>this._loadSingleGrammar(a.scopeName)),h.processQueue();return this._grammarForScopeName(t,n,s,o,u)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(t,n=[],s=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,s,o)}_grammarForScopeName(t,n=0,s=null,o=null,u=null){return this._syncRegistry.grammarForScopeName(t,n,s,o,u)}},B_=N_.NULL;const dH=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class _d{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}_d.prototype.normal={};_d.prototype.property={};_d.prototype.space=void 0;function ZT(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new _d(n,s,t)}function z_(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let fH=0;const yt=Fa(),Sn=Fa(),H_=Fa(),je=Fa(),Kt=Fa(),zl=Fa(),jr=Fa();function Fa(){return 2**++fH}const F_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Sn,commaOrSpaceSeparated:jr,commaSeparated:zl,number:je,overloadedBoolean:H_,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),Vv=Object.keys(F_);class vy extends Cr{constructor(t,n,s,o){let u=-1;if(super(t,n),Uw(this,"space",o),typeof s=="number")for(;++u<Vv.length;){const h=Vv[u];Uw(this,Vv[u],(s&F_[h])===F_[h])}}}vy.prototype.defined=!0;function Uw(e,t,n){n&&(e[t]=n)}function yc(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new vy(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[z_(s)]=s,n[z_(u.attribute)]=s}return new _d(t,n,e.space)}const JT=yc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Kt,ariaCurrent:null,ariaDescribedBy:Kt,ariaDetails:null,ariaDisabled:Sn,ariaDropEffect:Kt,ariaErrorMessage:null,ariaExpanded:Sn,ariaFlowTo:Kt,ariaGrabbed:Sn,ariaHasPopup:null,ariaHidden:Sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kt,ariaLevel:je,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Kt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Sn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function e5(e,t){return t in e?e[t]:t}function t5(e,t){return e5(e,t.toLowerCase())}const hH=yc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zl,acceptCharset:Kt,accessKey:Kt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Kt,autoFocus:yt,autoPlay:yt,blocking:Kt,capture:null,charSet:null,checked:yt,cite:null,className:Kt,cols:je,colSpan:null,content:null,contentEditable:Sn,controls:yt,controlsList:Kt,coords:je|zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:H_,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Kt,height:je,hidden:H_,high:je,href:null,hrefLang:null,htmlFor:Kt,httpEquiv:Kt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Kt,itemRef:Kt,itemScope:yt,itemType:Kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:je,pattern:null,ping:Kt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Kt,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:Kt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Sn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:t5}),pH=yc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:jr,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zl,g2:zl,glyphName:zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jr,rev:jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jr,requiredFeatures:jr,requiredFonts:jr,requiredFormats:jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jr,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:e5}),n5=yc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),r5=yc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:t5}),s5=yc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mH=/[A-Z]/g,Ww=/-[a-z]/g,gH=/^data[-\w.:]+$/i;function vH(e,t){const n=z_(t);let s=t,o=Cr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gH.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Ww,yH);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Ww.test(u)){let h=u.replace(mH,_H);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=vy}return new o(s,t)}function _H(e){return"-"+e.toLowerCase()}function yH(e){return e.charAt(1).toUpperCase()}const bH=ZT([JT,hH,n5,r5,s5],"html"),i5=ZT([JT,pH,n5,r5,s5],"svg"),qw={}.hasOwnProperty;function xH(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&qw.call(o,e)){const l=String(o[e]);h=qw.call(a,l)?a[l]:s.unknown}if(h)return h.call(this,o,...u)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const SH=/["&'<>`]/g,CH=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wH=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,EH=/[|\\{}()[\]^$+*?.]/g,Gw=new WeakMap;function RH(e,t){if(e=e.replace(t.subset?kH(t.subset):SH,s),t.subset||t.escapeOnly)return e;return e.replace(CH,n).replace(wH,s);function n(o,u,h){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,h.charCodeAt(u+2),t)}function s(o,u,h){return t.format(o.charCodeAt(0),h.charCodeAt(u+1),t)}}function kH(e){let t=Gw.get(e);return t||(t=TH(e),Gw.set(e,t)),t}function TH(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(EH,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const LH=/[\dA-Fa-f]/;function AH(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!LH.test(String.fromCharCode(t))?s:s+";"}const OH=/\d/;function MH(e,t,n){const s="&#"+String(e);return n&&t&&!OH.test(String.fromCharCode(t))?s:s+";"}const DH=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Uv={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},PH=["cent","copy","divide","gt","lt","not","para","times"],o5={}.hasOwnProperty,V_={};let ah;for(ah in Uv)o5.call(Uv,ah)&&(V_[Uv[ah]]=ah);const jH=/[^\dA-Za-z]/;function IH(e,t,n,s){const o=String.fromCharCode(e);if(o5.call(V_,o)){const u=V_[o],h="&"+u;return n&&DH.includes(u)&&!PH.includes(u)&&(!s||t&&t!==61&&jH.test(String.fromCharCode(t)))?h:h+";"}return""}function NH(e,t,n){let s=AH(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=IH(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=MH(e,t,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Hl(e,t){return RH(e,Object.assign({format:NH},t))}const BH=/^>|^->|<!--|-->|--!>|<!-$/g,zH=[">"],HH=["<",">"];function FH(e,t,n,s){return s.settings.bogusComments?"<?"+Hl(e.value,Object.assign({},s.settings.characterReferences,{subset:zH}))+">":"<!--"+e.value.replace(BH,o)+"-->";function o(u){return Hl(u,Object.assign({},s.settings.characterReferences,{subset:HH}))}}function VH(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function $w(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(t);for(;o!==-1;)s++,o=n.indexOf(t,o+t.length);return s}function UH(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function WH(e){return e.join(" ").trim()}const qH=/[ \t\n\f\r]/g;function _y(e){return typeof e=="object"?e.type==="text"?Kw(e.value):!1:Kw(e)}function Kw(e){return e.replace(qH,"")===""}const In=l5(1),a5=l5(-1),GH=[];function l5(e){return t;function t(n,s,o){const u=n?n.children:GH;let h=(s||0)+e,a=u[h];if(!o)for(;a&&_y(a);)h+=e,a=u[h];return a}}const $H={}.hasOwnProperty;function c5(e){return t;function t(n,s,o){return $H.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const yy=c5({body:YH,caption:Wv,colgroup:Wv,dd:JH,dt:ZH,head:Wv,html:KH,li:QH,optgroup:eF,option:tF,p:XH,rp:Yw,rt:Yw,tbody:rF,td:Xw,tfoot:sF,th:Xw,thead:nF,tr:iF});function Wv(e,t,n){const s=In(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&_y(s.value.charAt(0)))}function KH(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function YH(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function XH(e,t,n){const s=In(n,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function QH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="li"}function ZH(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function JH(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Yw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function eF(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function tF(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function nF(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function rF(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function sF(e,t,n){return!In(n,t)}function iF(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function Xw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const oF=c5({body:cF,colgroup:uF,head:lF,html:aF,tbody:dF});function aF(e){const t=In(e,-1);return!t||t.type!=="comment"}function lF(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function cF(e){const t=In(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&_y(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function uF(e,t,n){const s=a5(n,t),o=In(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&yy(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function dF(e,t,n){const s=a5(n,t),o=In(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&yy(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const lh={name:[[`
43
+ \f\r &/=>`.split(""),`
44
+ \f\r "&'/=>\``.split("")],[`\0
45
+ \f\r "&'/<=>`.split(""),`\0
46
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
47
+ \f\r &>`.split(""),`\0
48
+ \f\r "&'<=>\``.split("")],[`\0
49
+ \f\r "&'<=>\``.split(""),`\0
50
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function fF(e,t,n,s){const o=s.schema,u=o.space==="svg"?!1:s.settings.omitOptionalTags;let h=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;o.space==="html"&&e.tagName==="svg"&&(s.schema=i5);const d=hF(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!oF(e,t,n))&&(a.push("<",e.tagName,d?" "+d:""),h&&(o.space==="svg"||s.settings.closeSelfClosing)&&(l=d.charAt(d.length-1),(!s.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(p),!h&&(!u||!yy(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function hF(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=pF(e,o,t[o]);u&&n.push(u)}}for(;++s<n.length;){const u=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&u!=='"'&&u!=="'"&&(n[s]+=" ")}return n.join("")}function pF(e,t,n){const s=vH(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,u=e.settings.allowDangerousCharacters?0:1;let h=e.quote,a;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Hl(s.attribute,Object.assign({},e.settings.characterReferences,{subset:lh.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?UH:WH)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=Hl(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:lh.unquoted[o][u]}))),a!==n&&(e.settings.quoteSmart&&$w(n,h)>$w(n,e.alternative)&&(h=e.alternative),a=h+Hl(n,Object.assign({},e.settings.characterReferences,{subset:(h==="'"?lh.single:lh.double)[o][u],attribute:!0}))+h),l+(a&&"="+a))}const mF=["<","&"];function u5(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Hl(e.value,Object.assign({},s.settings.characterReferences,{subset:mF}))}function gF(e,t,n,s){return s.settings.allowDangerousHtml?e.value:u5(e,t,n,s)}function vF(e,t,n,s){return s.all(e)}const _F=xH("type",{invalid:yF,unknown:bF,handlers:{comment:FH,doctype:VH,element:fF,raw:gF,root:vF,text:u5}});function yF(e){throw new Error("Expected node, not `"+e+"`")}function bF(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const xF={},SF={},CF=[];function wF(e,t){const n=t||xF,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:EF,all:RF,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||dH,characterReferences:n.characterReferences||SF,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?i5:bH,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function EF(e,t,n){return _F(e,t,n,this)}function RF(e){const t=[],n=e&&e.children||CF;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function ep(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,u]of Object.entries(t?.colorReplacements||{}))typeof u=="string"?n[o]=u:o===s&&Object.assign(n,u);return n}function _o(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function kF(e){return Array.isArray(e)?e:[e]}async function d5(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function by(e){return!e||["plaintext","txt","text","plain"].includes(e)}function f5(e){return e==="ansi"||by(e)}function xy(e){return e==="none"}function h5(e){return xy(e)}function p5(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const s of n)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function zp(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let u=0;u<n.length;u+=2){const h=t?n[u]+(n[u+1]||""):n[u];o.push([h,s]),s+=n[u].length,s+=n[u+1]?.length||0}return o}function TF(e){const t=zp(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let u=o,h=0;for(const a of t){if(u<a.length)break;u-=a.length,h++}return{line:h,character:u}}function s(o,u){let h=0;for(let a=0;a<o;a++)h+=t[a].length;return h+=u,h}return{lines:t,indexToPos:n,posToIndex:s}}const Sy="light-dark()",LF=["color","background-color"];function AF(e,t){let n=0;const s=[];for(const o of t)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function OF(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const u=n.filter(h=>o.offset<h&&h<o.offset+o.content.length).map(h=>h-o.offset).sort((h,a)=>h-a);return u.length?AF(o,u):o})):e}function MF(e,t,n,s,o="css-vars"){const u={content:e.content,explanation:e.explanation,offset:e.offset},h=t.map(p=>tp(e.variants[p])),a=new Set(h.flatMap(p=>Object.keys(p))),l={},d=(p,f)=>{const g=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+t[p]+(f==="color"?"":g)};return h.forEach((p,f)=>{for(const g of a){const S=p[g]||"inherit";if(f===0&&s&&LF.includes(g))if(s===Sy&&h.length>1){const C=t.findIndex(_=>_==="light"),w=t.findIndex(_=>_==="dark");if(C===-1||w===-1)throw new En('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=h[C][g]||"inherit",x=h[w][g]||"inherit";l[g]=`light-dark(${b}, ${x})`,o==="css-vars"&&(l[d(f,g)]=S)}else l[g]=S;else o==="css-vars"&&(l[d(f,g)]=S)}}),u.htmlStyle=l,u}function tp(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Zn.Italic&&(t["font-style"]="italic"),e.fontStyle&Zn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Zn.Underline&&n.push("underline"),e.fontStyle&Zn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function U_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const m5=new WeakMap;function Hp(e,t){m5.set(e,t)}function Ju(e){return m5.get(e)}class bc{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new bc(Object.fromEntries(kF(n).map(s=>[s,B_])),t)}constructor(...t){if(t.length===2){const[n,s]=t;this.lang=s,this._stacks=n}else{const[n,s,o]=t;this.lang=s,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return DF(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function DF(e){const t=[],n=new Set;function s(o){if(n.has(o))return;n.add(o);const u=o?.nameScopesList?.scopeName;u&&t.push(u),o.parent&&s(o.parent)}return s(e),t}function PF(e,t){if(!(e instanceof bc))throw new En("Invalid grammar state");return e.getInternalStack(t)}function jF(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(h){if(typeof h=="number"){if(h<0||h>n.source.length)throw new En(`Invalid decoration offset: ${h}. Code length: ${n.source.length}`);return{...o.indexToPos(h),offset:h}}else{const a=o.lines[h.line];if(a===void 0)throw new En(`Invalid decoration position ${JSON.stringify(h)}. Lines length: ${o.lines.length}`);let l=h.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new En(`Invalid decoration position ${JSON.stringify(h)}. Line ${h.line} length: ${a.length}`);return{...h,character:l,offset:o.posToIndex(h.line,l)}}};const o=TF(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));IF(u),e.set(n.meta,{decorations:u,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(h=>[h.start.offset,h.end.offset]);return OF(n,o)},code(n){if(!this.options.decorations?.length)return;const s=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==s.converter.lines.length)throw new En(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function u(p,f,g,S){const C=o[p];let w="",b=-1,x=-1;if(f===0&&(b=0),g===0&&(x=0),g===Number.POSITIVE_INFINITY&&(x=C.children.length),b===-1||x===-1)for(let y=0;y<C.children.length;y++)w+=g5(C.children[y]),b===-1&&w.length===f&&(b=y+1),x===-1&&w.length===g&&(x=y+1);if(b===-1)throw new En(`Failed to find start index for decoration ${JSON.stringify(S.start)}`);if(x===-1)throw new En(`Failed to find end index for decoration ${JSON.stringify(S.end)}`);const _=C.children.slice(b,x);if(!S.alwaysWrap&&_.length===C.children.length)a(C,S,"line");else if(!S.alwaysWrap&&_.length===1&&_[0].type==="element")a(_[0],S,"token");else{const y={type:"element",tagName:"span",properties:{},children:_};a(y,S,"wrapper"),C.children.splice(b,_.length,y)}}function h(p,f){o[p]=a(o[p],f,"line")}function a(p,f,g){const S=f.properties||{},C=f.transform||(w=>w);return p.tagName=f.tagName||"span",p.properties={...p.properties,...S,class:p.properties.class},f.properties?.class&&p5(p,f.properties.class),p=C(p,g)||p,p}const l=[],d=s.decorations.sort((p,f)=>f.start.offset-p.start.offset||p.end.offset-f.end.offset);for(const p of d){const{start:f,end:g}=p;if(f.line===g.line)u(f.line,f.character,g.character,p);else if(f.line<g.line){u(f.line,f.character,Number.POSITIVE_INFINITY,p);for(let S=f.line+1;S<g.line;S++)l.unshift(()=>h(S,p));u(g.line,0,g.character,p)}}l.forEach(p=>p())}}}function IF(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new En(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=t+1;s<e.length;s++){const o=e[s],u=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,h=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,a=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,l=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(u||h||a||l){if(u&&h||a&&l||a&&n.start.offset===n.end.offset||h&&o.start.offset===o.end.offset)continue;throw new En(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function g5(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(g5).join(""):""}const NF=[jF()];function np(e){const t=BF(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...NF]}function BF(e){const t=[],n=[],s=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:t,post:n,normal:s}}var ua=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],qv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function zF(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const s=e.indexOf("m",n);if(s!==-1)return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function Qw(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function HF(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)qv[s]&&t.push({type:"setDecoration",value:qv[s]});else if(s<=29){const o=qv[s-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ua[s-30]}});else if(s===38){const o=Qw(e);o&&t.push({type:"setForegroundColor",value:o})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ua[s-40]}});else if(s===48){const o=Qw(e);o&&t.push({type:"setBackgroundColor",value:o})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ua[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ua[s-100+8]}})}return t}function FF(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=zF(s,u),a=h.sequence?s.substring(u,h.startPosition):s.substring(u);if(a.length>0&&o.push({value:a,foreground:e,background:t,decorations:new Set(n)}),h.sequence){const l=HF(h.sequence);for(const d of l)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of l)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}u=h.position}while(u<s.length);return o}}}var VF={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function UF(e=VF){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let d=0;d<ua.length;d++)s.push(t(ua[d]));let a=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let f=0;f<6;f++)s.push(n([a[d],a[p],a[f]]));let l=8;for(let d=0;d<24;d++,l+=10)s.push(n([l,l,l]));return s}function u(a){return o()[a]}function h(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return u(a.index)}}return{value:h}}const WF={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function qF(e,t,n){const s=ep(e,n),o=zp(t),u=Object.fromEntries(ua.map(l=>{const d=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,p=e.colors?.[d];return[l,p||WF[l]]})),h=UF(u),a=FF();return o.map(l=>a.parse(l[0]).map(d=>{let p,f;d.decorations.has("reverse")?(p=d.background?h.value(d.background):e.bg,f=d.foreground?h.value(d.foreground):e.fg):(p=d.foreground?h.value(d.foreground):e.fg,f=d.background?h.value(d.background):void 0),p=_o(p,s),f=_o(f,s),d.decorations.has("dim")&&(p=GF(p));let g=Zn.None;return d.decorations.has("bold")&&(g|=Zn.Bold),d.decorations.has("italic")&&(g|=Zn.Italic),d.decorations.has("underline")&&(g|=Zn.Underline),d.decorations.has("strikethrough")&&(g|=Zn.Strikethrough),{content:d.value,offset:l[1],color:p,bgColor:f,fontStyle:g}}))}function GF(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const o=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${o}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const o=s[0],u=s[1],h=s[2],a=s[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${u}${u}${h}${h}${l}`}else if(s.length===3){const o=s[0],u=s[1],h=s[2];return`#${o}${o}${u}${u}${h}${h}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Cy(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(by(o)||xy(s))return zp(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return qF(u,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new En(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(u.name))throw new En(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return KF(t,a,u,h,n)}function $F(...e){if(e.length===2)return Ju(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:u=t.getLoadedThemes()[0]}=s;if(by(o)||xy(u))throw new En("Plain language does not have grammar state");if(o==="ansi")throw new En("ANSI language does not have grammar state");const{theme:h,colorMap:a}=t.setTheme(u),l=t.getLanguage(o);return new bc(wy(n,l,h,a,s).stateStack,l.name,h.name)}function KF(e,t,n,s,o){const u=wy(e,t,n,s,o),h=new bc(u.stateStack,t.name,n.name);return Hp(u.tokens,h),u.tokens}function wy(e,t,n,s,o){const u=ep(n,o),{tokenizeMaxLineLength:h=0,tokenizeTimeLimit:a=500}=o,l=zp(e);let d=o.grammarState?PF(o.grammarState,n.name)??B_:o.grammarContextCode!=null?wy(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:B_,p=[];const f=[];for(let g=0,S=l.length;g<S;g++){const[C,w]=l[g];if(C===""){p=[],f.push([]);continue}if(h>0&&C.length>=h){p=[],f.push([{content:C,offset:w,color:"",fontStyle:0}]);continue}let b,x,_;o.includeExplanation&&(b=t.tokenizeLine(C,d,a),x=b.tokens,_=0);const y=t.tokenizeLine2(C,d,a),E=y.tokens.length/2;for(let T=0;T<E;T++){const A=y.tokens[2*T],M=T+1<E?y.tokens[2*T+2]:C.length;if(A===M)continue;const L=y.tokens[2*T+1],D=_o(s[Zl.getForeground(L)],u),z=Zl.getFontStyle(L),H={content:C.substring(A,M),offset:w+A,color:D,fontStyle:z};if(o.includeExplanation){const $=[];if(o.includeExplanation!=="scopeName")for(const q of n.settings){let K;switch(typeof q.scope){case"string":K=q.scope.split(/,/).map(V=>V.trim());break;case"object":K=q.scope;break;default:continue}$.push({settings:q,selectors:K.map(V=>V.split(/ /))})}H.explanation=[];let N=0;for(;A+N<M;){const q=x[_],K=C.substring(q.startIndex,q.endIndex);N+=K.length,H.explanation.push({content:K,scopes:o.includeExplanation==="scopeName"?YF(q.scopes):XF($,q.scopes)}),_+=1}}p.push(H)}f.push(p),p=[],d=y.ruleStack}return{tokens:f,stateStack:d}}function YF(e){return e.map(t=>({scopeName:t}))}function XF(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:ZF(e,u,t.slice(0,s))}}return n}function Zw(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function QF(e,t,n){if(!Zw(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Zw(e[s],n[o])&&(s-=1),o-=1;return s===-1}function ZF(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(QF(h,t,n)){s.push(u);break}return s}function v5(e,t,n){const s=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),o=s.map(l=>{const d=Cy(e,t,{...n,theme:l.theme}),p=Ju(d),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:d,state:p,theme:f}}),u=JF(...o.map(l=>l.tokens)),h=u[0].map((l,d)=>l.map((p,f)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),u.forEach((S,C)=>{const{content:w,explanation:b,offset:x,..._}=S[d][f];g.variants[s[C].color]=_}),g})),a=o[0].state?new bc(Object.fromEntries(o.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),o[0].state.lang):void 0;return a&&Hp(h,a),h}function JF(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(l=>l[s]),u=t.map(()=>[]);t.forEach((l,d)=>l.push(u[d]));const h=o.map(()=>0),a=o.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(d=>d.content.length));for(let d=0;d<n;d++){const p=a[d];p.content.length===l?(u[d].push(p),h[d]+=1,a[d]=o[d][h[d]]):(u[d].push({...p,content:p.content.slice(0,l)}),a[d]={...p,content:p.content.slice(l),offset:p.offset+l})}}}return t}function rp(e,t,n){let s,o,u,h,a,l;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:f="css-vars"}=n,g=Object.entries(n.themes).filter(x=>x[1]).map(x=>({color:x[0],theme:x[1]})).sort((x,_)=>x.color===d?-1:_.color===d?1:0);if(g.length===0)throw new En("`themes` option must not be empty");const S=v5(e,t,n);if(l=Ju(S),d&&Sy!==d&&!g.find(x=>x.color===d))throw new En(`\`themes\` option must contain the defaultColor key \`${d}\``);const C=g.map(x=>e.getTheme(x.theme)),w=g.map(x=>x.color);u=S.map(x=>x.map(_=>MF(_,w,p,d,f))),l&&Hp(u,l);const b=g.map(x=>ep(x.theme,n));o=Jw(g,C,b,p,d,"fg",f),s=Jw(g,C,b,p,d,"bg",f),h=`shiki-themes ${C.map(x=>x.name).join(" ")}`,a=d?void 0:[o,s].join(";")}else if("theme"in n){const d=ep(n.theme,n);u=Cy(e,t,n);const p=e.getTheme(n.theme);s=_o(p.bg,d),o=_o(p.fg,d),h=p.name,l=Ju(u)}else throw new En("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:h,rootStyle:a,grammarState:l}}function Jw(e,t,n,s,o,u,h){return e.map((a,l)=>{const d=_o(t[l][u],n[l])||"inherit",p=`${s+a.color}${u==="bg"?"-bg":""}:${d}`;if(l===0&&o){if(o===Sy&&e.length>1){const f=e.findIndex(w=>w.color==="light"),g=e.findIndex(w=>w.color==="dark");if(f===-1||g===-1)throw new En('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=_o(t[f][u],n[f])||"inherit",C=_o(t[g][u],n[g])||"inherit";return`light-dark(${S}, ${C});${p}`}return d}return h==="css-vars"?p:null}).filter(a=>!!a).join(";")}function sp(e,t,n,s={meta:{},options:n,codeToHast:(o,u)=>sp(e,o,u),codeToTokens:(o,u)=>rp(e,o,u)}){let o=t;for(const C of np(n))o=C.preprocess?.call(s,o,n)||o;let{tokens:u,fg:h,bg:a,themeName:l,rootStyle:d,grammarState:p}=rp(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?u=tV(u):f==="never"&&(u=nV(u)),g&&(u=rV(u));const S={...s,get source(){return o}};for(const C of np(n))u=C.tokens?.call(S,u)||u;return eV(u,{...n,fg:h,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},S,p)}function eV(e,t,n,s=Ju(e)){const o=np(t),u=[],h={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(d.tabindex=l.toString());for(const[w,b]of Object.entries(t.meta||{}))w.startsWith("_")||(d[w]=b);let p={type:"element",tagName:"pre",properties:d,children:[]},f={type:"element",tagName:"code",properties:{},children:u};const g=[],S={...n,structure:a,addClassToHast:p5,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return h},get pre(){return p},get code(){return f},get lines(){return g}};if(e.forEach((w,b)=>{b&&(a==="inline"?h.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&u.push({type:"text",value:`
51
+ `}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const y of w){let E={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const T=U_(y.htmlStyle||tp(y));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(S,E,b+1,_,x,y)||E;a==="inline"?h.children.push(E):a==="classic"&&x.children.push(E),_+=y.content.length}if(a==="classic"){for(const y of o)x=y?.line?.call(S,x,b+1)||x;g.push(x),u.push(x)}else a==="inline"&&g.push(x)}),a==="classic"){for(const w of o)f=w?.code?.call(S,f)||f;p.children.push(f);for(const w of o)p=w?.pre?.call(S,p)||p;h.children.push(p)}else if(a==="inline"){const w=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const y of h.children)y.type==="element"&&y.tagName==="br"?(w.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(y.type==="element"||y.type==="text")&&b.children.push(y);w.push(b);let _={type:"element",tagName:"code",properties:{},children:w};for(const y of o)_=y?.code?.call(S,_)||_;h.children=[];for(let y=0;y<_.children.length;y++){y>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=_.children[y];E.type==="element"&&h.children.push(...E.children)}}let C=h;for(const w of o)C=w?.root?.call(S,C)||C;return s&&Hp(C,s),C}function tV(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((u,h)=>{const l=!(u.fontStyle&&(u.fontStyle&Zn.Underline||u.fontStyle&Zn.Strikethrough));l&&u.content.match(/^\s+$/)&&t[h+1]?(o===void 0&&(o=u.offset),s+=u.content):s?(l?n.push({...u,offset:o,content:s+u.content}):n.push({content:s,offset:o},u),o=void 0,s=""):n.push(u)}),n})}function nV(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,u,h]=s;if(!o&&!h)return n;const a=[{...n,offset:n.offset+o.length,content:u}];return o&&a.unshift({content:o,offset:n.offset}),h&&a.push({content:h,offset:n.offset+o.length+u.length}),a}))}function rV(e){return e.map(t=>{const n=[];for(const s of t){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],u=U_(o.htmlStyle||tp(o)),h=U_(s.htmlStyle||tp(s)),a=o.fontStyle&&(o.fontStyle&Zn.Underline||o.fontStyle&Zn.Strikethrough),l=s.fontStyle&&(s.fontStyle&Zn.Underline||s.fontStyle&Zn.Strikethrough);!a&&!l&&u===h?o.content+=s.content:n.push({...s})}return n})}const sV=wF;function iV(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>sp(e,u,h),codeToTokens:(u,h)=>rp(e,u,h)};let o=sV(sp(e,t,n,s));for(const u of np(n))o=u.postprocess?.call(s,o,n)||o;return o}const e2={light:"#333333",dark:"#bbbbbb"},t2={light:"#fffffe",dark:"#1e1e1e"},n2="__shiki_resolved";function Ey(e){if(e?.[n2])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:s}=t;if(!n||!s){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!s&&t?.colors?.["editor.foreground"]&&(s=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),s||(s=t.type==="light"?e2.light:e2.dark),n||(n=t.type==="light"?t2.light:t2.dark),t.fg=s,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const u=new Map;function h(a){if(u.has(a))return u.get(a);o+=1;const l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?h(a):(u.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),d=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!d)return a;const p={...a,settings:{...a.settings}};if(l){const f=h(a.settings.foreground);t.colorReplacements[f]=a.settings.foreground,p.settings.foreground=f}if(d){const f=h(a.settings.background);t.colorReplacements[f]=a.settings.background,p.settings.background=f}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=h(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,n2,{enumerable:!1,writable:!1,value:!0}),t}async function _5(e){return Array.from(new Set((await Promise.all(e.filter(t=>!f5(t)).map(async t=>await d5(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function y5(e){return(await Promise.all(e.map(async n=>h5(n)?null:Ey(await d5(n))))).filter(n=>!!n)}let oV=3;function aV(e,t=3){t>oV||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Tl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function b5(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Tl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class lV extends uH{constructor(t,n,s,o={}){super(t),this._resolver=t,this._themes=n,this._langs=s,this._alias=o,this._themes.map(u=>this.loadTheme(u)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Ey(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=Yh.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=b5(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(u=>u.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const s={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,s);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(u=>{this._alias[u]=t.name}),this._loadedLanguagesCache=null,n.size)for(const u of n)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(u.scopeName),this._syncRegistry?._grammars?.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),s=n.filter(([o,u])=>!u);if(s.length){const o=n.filter(([u,h])=>h?(h.embeddedLanguages||h.embeddedLangs)?.some(l=>s.map(([d])=>d).includes(l)):!1).filter(u=>!s.includes(u));throw new Tl(`Missing languages ${s.map(([u])=>`\`${u}\``).join(", ")}, required by ${o.map(([u])=>`\`${u}\``).join(", ")}`)}for(const[o,u]of n)this._resolver.addLanguage(u);for(const[o,u]of n)this.loadLanguage(u)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const s of n)this._langGraph.set(s,this._langMap.get(s))}}class cV{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:s=>t.createScanner(s),createOnigString:s=>t.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let s=[];for(let o=1;o<=n.length;o++){const u=n.slice(0,o).join(".");s=[...s,...this._injections.get(u)||[]]}return s}}let wu=0;function uV(e){wu+=1,e.warnings!==!1&&wu>=10&&wu%10===0&&console.warn(`[Shiki] ${wu} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Tl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(Ey),o=new cV(e.engine,n),u=new lV(o,s,n,e.langAlias);let h;function a(y){return b5(y,e.langAlias)}function l(y){x();const E=u.getGrammar(typeof y=="string"?y:y.name);if(!E)throw new Tl(`Language \`${y}\` not found, you may need to load it first`);return E}function d(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};x();const E=u.getTheme(y);if(!E)throw new Tl(`Theme \`${y}\` not found, you may need to load it first`);return E}function p(y){x();const E=d(y);h!==y&&(u.setTheme(E),h=y);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return x(),u.getLoadedThemes()}function g(){return x(),u.getLoadedLanguages()}function S(...y){x(),u.loadLanguages(y.flat(1))}async function C(...y){return S(await _5(y))}function w(...y){x();for(const E of y.flat(1))u.loadTheme(E)}async function b(...y){return x(),w(await y5(y))}function x(){if(t)throw new Tl("Shiki instance has been disposed")}function _(){t||(t=!0,u.dispose(),wu-=1)}return{setTheme:p,getTheme:d,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:C,loadLanguageSync:S,loadTheme:b,loadThemeSync:w,dispose:_,[Symbol.dispose]:_}}async function dV(e){e.engine||aV("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([y5(e.themes||[]),_5(e.langs||[]),e.engine]);return uV({...e,themes:t,langs:n,engine:s})}async function fV(e){const t=await dV(e);return{getLastGrammarState:(...n)=>$F(t,...n),codeToTokensBase:(n,s)=>Cy(t,n,s),codeToTokensWithThemes:(n,s)=>v5(t,n,s),codeToTokens:(n,s)=>rp(t,n,s),codeToHast:(n,s)=>sp(t,n,s),codeToHtml:(n,s)=>iV(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function hV(e){const t=e.langs,n=e.themes,s=e.engine;async function o(u){function h(f){if(typeof f=="string"){if(f=u.langAlias?.[f]||f,f5(f))return[];const g=t[f];if(!g)throw new En(`Language \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}function a(f){if(h5(f))return"none";if(typeof f=="string"){const g=n[f];if(!g)throw new En(`Theme \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}const l=(u.themes??[]).map(f=>a(f)),d=(u.langs??[]).map(f=>h(f)),p=await fV({engine:u.engine??s(),...u,themes:l,langs:d});return{...p,loadLanguage(...f){return p.loadLanguage(...f.map(h))},loadTheme(...f){return p.loadTheme(...f.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}const x5=[{id:"abap",name:"ABAP",import:(()=>J(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>J(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>J(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>J(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>J(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>J(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>J(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>J(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>J(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>J(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>J(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>J(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>J(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>J(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>J(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>J(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>J(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>J(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>J(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>J(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>J(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>J(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>J(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>J(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>J(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>J(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>J(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>J(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>J(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>J(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>J(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>J(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>J(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>J(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>J(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>J(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>J(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>J(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>J(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>J(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>J(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>J(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>J(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>J(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>J(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>J(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>J(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>J(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>J(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>J(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>J(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>J(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>J(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>J(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>J(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>J(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>J(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>J(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>J(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>J(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>J(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>J(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>J(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>J(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>J(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>J(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>J(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>J(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>J(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>J(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>J(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>J(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>J(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>J(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>J(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>J(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>J(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>J(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>J(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>J(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>J(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>J(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>J(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>J(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>J(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>J(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>J(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>J(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>J(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>J(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>J(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>J(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>J(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>J(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>J(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>J(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>J(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>J(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>J(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>J(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>J(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>J(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>J(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>J(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>J(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>J(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>J(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>J(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>J(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>J(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>J(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>J(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>J(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>J(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>J(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>J(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>J(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>J(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>J(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>J(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>J(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>J(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>J(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>J(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>J(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>J(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>J(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>J(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>J(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>J(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>J(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>J(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>J(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>J(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>J(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>J(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>J(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>J(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>J(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>J(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>J(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>J(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>J(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>J(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>J(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>J(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>J(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>J(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>J(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>J(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>J(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>J(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>J(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>J(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>J(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>J(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>J(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>J(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>J(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>J(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>J(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>J(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>J(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>J(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>J(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>J(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>J(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>J(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>J(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>J(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>J(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>J(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>J(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>J(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>J(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>J(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>J(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>J(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>J(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>J(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>J(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>J(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>J(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>J(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>J(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>J(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>J(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>J(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>J(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>J(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>J(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>J(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>J(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>J(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>J(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>J(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>J(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>J(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>J(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>J(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>J(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>J(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>J(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>J(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>J(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>J(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>J(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>J(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>J(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>J(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>J(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>J(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>J(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>J(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>J(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>J(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>J(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>J(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>J(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>J(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>J(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>J(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>J(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>J(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>J(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>J(()=>import("./zig-VOosw3JB.js"),[]))}],pV=Object.fromEntries(x5.map(e=>[e.id,e.import])),mV=Object.fromEntries(x5.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),gV={...pV,...mV},vV=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>J(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>J(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>J(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>J(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>J(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>J(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>J(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>J(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>J(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>J(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>J(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>J(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>J(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>J(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>J(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>J(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>J(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>J(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>J(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>J(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>J(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>J(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>J(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>J(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>J(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>J(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>J(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>J(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>J(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>J(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>J(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>J(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>J(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>J(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>J(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>J(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>J(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>J(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>J(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>J(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>J(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>J(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>J(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>J(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>J(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>J(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>J(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>J(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>J(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>J(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>J(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>J(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>J(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>J(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>J(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>J(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>J(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>J(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],_V=Object.fromEntries(vV.map(e=>[e.id,e.import]));class Ry extends Error{constructor(t){super(t),this.name="ShikiError"}}function yV(){return 2147483648}function bV(){return typeof performance<"u"?performance.now():Date.now()}const xV=(e,t)=>e+(t-e%t)%t;async function SV(e){let t,n;const s={};function o(S){n=S,s.HEAPU8=new Uint8Array(S),s.HEAPU32=new Uint32Array(S)}function u(S,C,w){s.HEAPU8.copyWithin(S,C,C+w)}function h(S){try{return t.grow(S-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(S){const C=s.HEAPU8.length;S=S>>>0;const w=yV();if(S>w)return!1;for(let b=1;b<=4;b*=2){let x=C*(1+.2/b);x=Math.min(x,S+100663296);const _=Math.min(w,xV(Math.max(S,x),65536));if(h(_))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(S,C,w=1024){const b=C+w;let x=C;for(;S[x]&&!(x>=b);)++x;if(x-C>16&&S.buffer&&l)return l.decode(S.subarray(C,x));let _="";for(;C<x;){let y=S[C++];if(!(y&128)){_+=String.fromCharCode(y);continue}const E=S[C++]&63;if((y&224)===192){_+=String.fromCharCode((y&31)<<6|E);continue}const T=S[C++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|T:y=(y&7)<<18|E<<12|T<<6|S[C++]&63,y<65536)_+=String.fromCharCode(y);else{const A=y-65536;_+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return _}function p(S,C){return S?d(s.HEAPU8,S,C):""}const f={emscripten_get_now:bV,emscripten_memcpy_big:u,emscripten_resize_heap:a,fd_write:()=>0};async function g(){const C=await e({env:f,wasi_snapshot_preview1:f});t=C.memory,o(t.buffer),Object.assign(s,C),s.UTF8ToString=p}return await g(),s}var CV=Object.defineProperty,wV=(e,t,n)=>t in e?CV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t,n)=>wV(e,typeof t!="symbol"?t+"":t,n);let Bn=null;function EV(e){throw new Ry(e.UTF8ToString(e.getLastOnigError()))}class Fp{constructor(t){On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16Value"),On(this,"utf8Value"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16");const n=t.length,s=Fp._utf8ByteLength(t),o=s!==n,u=o?new Uint32Array(n+1):null;o&&(u[n]=s);const h=o?new Uint32Array(s+1):null;o&&(h[s]=n);const a=new Uint8Array(s);let l=0;for(let d=0;d<n;d++){const p=t.charCodeAt(d);let f=p,g=!1;if(p>=55296&&p<=56319&&d+1<n){const S=t.charCodeAt(d+1);S>=56320&&S<=57343&&(f=(p-55296<<10)+65536|S-56320,g=!0)}o&&(u[d]=l,g&&(u[d+1]=l),f<=127?h[l+0]=d:f<=2047?(h[l+0]=d,h[l+1]=d):f<=65535?(h[l+0]=d,h[l+1]=d,h[l+2]=d):(h[l+0]=d,h[l+1]=d,h[l+2]=d,h[l+3]=d)),f<=127?a[l++]=f:f<=2047?(a[l++]=192|(f&1984)>>>6,a[l++]=128|(f&63)>>>0):f<=65535?(a[l++]=224|(f&61440)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0):(a[l++]=240|(f&1835008)>>>18,a[l++]=128|(f&258048)>>>12,a[l++]=128|(f&4032)>>>6,a[l++]=128|(f&63)>>>0),g&&d++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=u,this.utf8OffsetToUtf16=h}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const u=t.charCodeAt(s);let h=u,a=!1;if(u>=55296&&u<=56319&&s+1<o){const l=t.charCodeAt(s+1);l>=56320&&l<=57343&&(h=(u-55296<<10)+65536|l-56320,a=!0)}h<=127?n+=1:h<=2047?n+=2:h<=65535?n+=3:n+=4,a&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Vp=class Is{constructor(t){if(On(this,"id",++Is.LAST_ID),On(this,"_onigBinding"),On(this,"content"),On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16"),On(this,"ptr"),!Bn)throw new Ry("Must invoke loadWasm first.");this._onigBinding=Bn,this.content=t;const n=new Fp(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Is._sharedPtrInUse?(Is._sharedPtr||(Is._sharedPtr=Bn.omalloc(1e4)),Is._sharedPtrInUse=!0,Bn.HEAPU8.set(n.utf8Value,Is._sharedPtr),this.ptr=Is._sharedPtr):this.ptr=n.createString(Bn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Is._sharedPtr?Is._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};On(Vp,"LAST_ID",0);On(Vp,"_sharedPtr",0);On(Vp,"_sharedPtrInUse",!1);let S5=Vp;class RV{constructor(t){if(On(this,"_onigBinding"),On(this,"_ptr"),!Bn)throw new Ry("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,l=t.length;a<l;a++){const d=new Fp(t[a]);n[a]=d.createString(Bn),s[a]=d.utf8Length}const o=Bn.omalloc(4*t.length);Bn.HEAPU32.set(n,o/4);const u=Bn.omalloc(4*t.length);Bn.HEAPU32.set(s,u/4);const h=Bn.createOnigScanner(o,u,t.length);for(let a=0,l=t.length;a<l;a++)Bn.ofree(n[a]);Bn.ofree(u),Bn.ofree(o),h===0&&EV(Bn),this._onigBinding=Bn,this._ptr=h}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new S5(t);const u=this._findNextMatchSync(t,n,!1,o);return t.dispose(),u}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,s,o){const u=this._onigBinding,h=u.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(h===0)return null;const a=u.HEAPU32;let l=h/4;const d=a[l++],p=a[l++],f=[];for(let g=0;g<p;g++){const S=t.convertUtf8OffsetToUtf16(a[l++]),C=t.convertUtf8OffsetToUtf16(a[l++]);f[g]={start:S,end:C,length:C-S}}return{index:d,captureIndices:f}}}function kV(e){return typeof e.instantiator=="function"}function TV(e){return typeof e.default=="function"}function LV(e){return typeof e.data<"u"}function AV(e){return typeof Response<"u"&&e instanceof Response}function OV(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let ch;function MV(e){if(ch)return ch;async function t(){Bn=await SV(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),kV(s)?s=await s.instantiator(n):TV(s)?s=await s.default(n):(LV(s)&&(s=s.data),AV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await DV(s)(n):s=await PV(s)(n):OV(s)?s=await Gv(s)(n):s instanceof WebAssembly.Module?s=await Gv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Gv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return ch=t(),ch}function Gv(e){return t=>WebAssembly.instantiate(e,t)}function DV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function PV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function jV(e){return e&&await MV(e),{createScanner(t){return new RV(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new S5(t)}}}const IV=hV({langs:gV,themes:_V,engine:()=>jV(J(()=>import("./wasm-CG6Dc4jp.js"),[]))});let uh=null,dh=null;const NV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function BV(){return uh||dh||(dh=IV({themes:["github-dark"],langs:NV}),uh=await dh,uh)}async function zV(e,t){const n=await BV(),s=HV(t);if(!n.getLoadedLanguages().includes(s))try{await n.loadLanguage(s)}catch{return n.codeToHtml(e,{lang:"plaintext",theme:"github-dark"})}return n.codeToHtml(e,{lang:s,theme:"github-dark"})}function HV(e){return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",sh:"bash",yml:"yaml",md:"markdown"}[e]||e}function FV(e){const t=e.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",html:"html",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",py:"python",rs:"rust",go:"go",sql:"sql",diff:"diff",txt:"plaintext"}[t]||"plaintext"}function r2({filePath:e,content:t,isLoading:n,error:s,onClose:o}){const[u,h]=R.useState(null),[a,l]=R.useState(!1),[d,p]=R.useState(!0);if(R.useEffect(()=>{if(!t||!e){h(null);return}if(t.mimeType.startsWith("image/")||t.mimeType==="application/octet-stream"){h(null);return}l(!0);const g=FV(e);zV(t.content,g).then(S=>{h(S),l(!1)}).catch(()=>{h(null),l(!1)})},[t,e]),!e)return v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(n)return v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(s)return v.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s.message});if(!t)return v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Unable to load file"});if(t.mimeType==="application/octet-stream")return v.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[v.jsx("p",{children:"Binary file"}),v.jsxs("p",{className:"text-xs",children:[(t.size/1024).toFixed(1)," KB"]})]});if(t.mimeType.startsWith("image/"))return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[v.jsx("span",{className:"text-muted-foreground truncate",title:e,children:e.split("/").pop()||e}),v.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:v.jsx(ve,{icon:Si,size:14,strokeWidth:2})})]}),v.jsx("div",{className:"flex flex-1 items-center justify-center p-4 bg-[#0d1117]",children:v.jsx("img",{src:t.content,alt:e,className:"max-w-full max-h-full object-contain"})})]});const f=e.split("/").pop()||e;return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[v.jsx("span",{className:"text-muted-foreground truncate flex-1",title:e,children:f}),t.truncated&&v.jsxs("span",{className:"text-yellow-500",children:["Truncated (",t.lineCount.toLocaleString()," lines)"]}),v.jsxs("span",{className:"text-muted-foreground",children:[(t.size/1024).toFixed(1)," KB"]}),v.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[v.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked),className:"w-3 h-3"}),"Wrap"]}),v.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:v.jsx(ve,{icon:Si,size:14,strokeWidth:2})})]}),v.jsx(Yl,{className:"flex-1 min-h-0",children:a?v.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm",children:"Highlighting..."}):u?v.jsx("div",{className:Be("text-xs [&_pre]:!bg-transparent [&_pre]:!m-0 [&_pre]:!p-2 [&_code]:!bg-transparent",d?"[&_pre]:whitespace-pre-wrap [&_pre]:break-all":"[&_pre]:whitespace-pre"),dangerouslySetInnerHTML:{__html:u}}):v.jsx("pre",{className:Be("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function s2({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=xz(e),[a,l]=R.useState("tree"),d=Pp(),{data:p,isLoading:f,error:g}=SI(t),{data:S,isLoading:C,error:w}=CI(t,n),b=R.useCallback(y=>{o(y),window.matchMedia("(max-width: 639px)").matches&&l("content")},[o]),x=R.useCallback(()=>{o(null),window.matchMedia("(max-width: 639px)").matches&&l("tree")},[o]),_=R.useCallback(y=>{u(y)},[u]);return t?f?v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):g?v.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:g.message}):d?v.jsxs(_a,{value:a,onValueChange:y=>l(y),className:"flex h-full flex-col",children:[v.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:v.jsxs(ya,{className:"w-full",children:[v.jsx(ir,{value:"tree",className:"flex-1",children:"Files"}),v.jsx(ir,{value:"content",className:"flex-1",children:"Content"})]})}),v.jsx(_r,{value:"tree",className:"flex-1 min-h-0 overflow-hidden",children:v.jsx(Yl,{className:"h-full",children:v.jsx(Dw,{entries:p?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:b,onToggleDir:_,onCollapseAll:h})})}),v.jsx(_r,{value:"content",className:"flex-1 min-h-0 overflow-hidden",children:v.jsx(r2,{filePath:n,content:S??null,isLoading:C,error:w,onClose:x})})]}):v.jsxs(ta,{direction:"horizontal",className:"h-full",children:[v.jsx(ts,{defaultSize:65,minSize:30,className:"overflow-hidden",children:v.jsx(r2,{filePath:n,content:S??null,isLoading:C,error:w,onClose:x})}),v.jsx(na,{withHandle:!0}),v.jsx(ts,{defaultSize:35,minSize:15,children:v.jsx(Yl,{className:"h-full",children:v.jsx(Dw,{entries:p?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:b,onToggleDir:_,onCollapseAll:h})})})]}):v.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}const C5=ws("/tasks/$taskId")({component:UV}),i2={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},VV={IN_PROGRESS:"bg-blue-500/20 text-blue-500",IN_REVIEW:"bg-yellow-500/20 text-yellow-600",DONE:"bg-green-500/20 text-green-600",CANCELED:"bg-red-500/20 text-red-500"};function UV(){const{taskId:e}=C5.useParams(),t=yo(),n=_O(),{data:s,isLoading:o}=Ek(e),u=Z0(),h=vI(),{tab:a,setTab:l}=VB(e),d=sT(),p=iT(),f=oT(),g=aT(),{data:S}=Mp(),{data:C}=Dp(),{data:w}=UB(s?.linearTicketId??null),b=n.state,x=b?.aiMode&&b?.description?b.aiMode:void 0,_=b?.description,[y,E]=R.useState(!1),[T,A]=R.useState(null),[M,L]=R.useState(!1),[D,z]=R.useState(!1),[H,$]=R.useState(null),[N,q]=R.useState(!1),[K,V]=R.useState(!1),[Y,G]=R.useState(null),[j,W]=R.useState(!1),[P,I]=R.useState(!1),[F,X]=R.useState(!1),[te,ee]=R.useState("terminal"),Q=Pp(),{terminals:U,writeToTerminal:se}=cy();R.useEffect(()=>{if(D){const xe=setTimeout(()=>z(!1),3e3);return()=>clearTimeout(xe)}},[D]),R.useEffect(()=>{if(K){const xe=setTimeout(()=>V(!1),3e3);return()=>clearTimeout(xe)}},[K]),R.useEffect(()=>{if(P){const xe=setTimeout(()=>I(!1),3e3);return()=>clearTimeout(xe)}},[P]);const ne=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){A(null),z(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),z(!0)}catch(xe){const Ge=xe instanceof Error?xe.message:"Sync failed";A(Ge),L(!0)}}},re=()=>{if(!s||!T)return"";const xe=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${xe} | Error: ${T} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${xe} branch`},oe=()=>{if(!s||!H)return"";const xe=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${xe} | Error: ${H} | Steps: 1) Check git status in both worktree and parent 2) Resolve any conflicts 3) Ensure worktree changes are committed 4) Retry merge to ${xe} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},le=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){$(null),V(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),V(!0),g.mutate(s.id),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(xe){const Ge=xe instanceof Error?xe.message:"Merge failed";$(Ge),q(!0)}}},_e=async()=>{if(s?.repoPath){G(null),I(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),I(!0)}catch(xe){const Ge=xe instanceof Error?xe.message:"Sync parent failed";G(Ge),W(!0)}}},ge=()=>{if(!s||!Y)return"";const xe=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${xe} | Error: ${Y} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${xe}`},ue=U.find(xe=>xe.cwd===s?.worktreePath),de=()=>{if(!ue)return;const xe=re();se(ue.id,xe+"\r"),L(!1)},Ie=()=>{if(!ue)return;const Ge=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),L(!1)},De=()=>{if(!ue)return;const xe=oe();se(ue.id,xe+"\r"),q(!1)},Oe=()=>{if(!ue)return;const Ge=`claude -p "${oe().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),q(!1)},be=()=>{if(!ue)return;const xe=ge();se(ue.id,xe+"\r"),W(!1)},Me=()=>{if(!ue)return;const Ge=`claude -p "${ge().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;se(ue.id,Ge),W(!1)},pe=()=>{X(!0)},ke=()=>{if(!s?.worktreePath)return;const xe=Kh(s.worktreePath,S,C);window.open(xe,"_blank"),X(!1)},we=()=>{if(!s?.repoPath)return;const xe=Kh(s.repoPath,S,C);window.open(xe,"_blank"),X(!1)},We=xe=>{s&&u.mutate({taskId:s.id,updates:{status:xe}})},et=()=>{s&&h.mutate(s.id,{onSuccess:()=>{t({to:"/tasks"})}})};return o?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):s?v.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[v.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("h1",{className:"text-sm font-medium",children:s.title}),v.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>E(!0),title:"Task settings",children:v.jsx(ve,{icon:mE,size:14,strokeWidth:2})})]}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx("span",{children:s.repoName}),v.jsx(ve,{icon:f_,size:12,strokeWidth:2}),v.jsx("span",{className:"font-mono",children:s.branch}),s.prUrl&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-muted-foreground/50",children:"•"}),v.jsxs("a",{href:s.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),children:[v.jsx(ve,{icon:f0,size:14,strokeWidth:2}),v.jsxs("span",{children:["#",s.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),s.linearTicketUrl&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-muted-foreground/50",children:"•"}),v.jsxs("a",{href:s.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:xe=>xe.stopPropagation(),title:w?.title,children:[v.jsx(ve,{icon:h0,size:14,strokeWidth:2}),v.jsx("span",{children:s.linearTicketId}),w?.status&&v.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",w.status,")"]})]})]})]})]}),v.jsxs(tT,{children:[v.jsx(nT,{render:v.jsx(Ne,{variant:"ghost",size:"sm",className:VV[s.status]}),children:i2[s.status]}),v.jsx(rT,{align:"end",children:v.jsx(r7,{value:s.status,onValueChange:We,children:Object.entries(i2).map(([xe,Ge])=>v.jsx(s7,{value:xe,children:Ge},xe))})})]}),v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:ne,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:v.jsx(ve,{icon:l_,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:le,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:v.jsx(ve,{icon:c_,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:_e,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:v.jsx(ve,{icon:h_,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:pe,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:v.jsx(ve,{icon:p0,size:16,strokeWidth:2})}),D&&v.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),K&&v.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),P&&v.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),v.jsxs(uc,{children:[v.jsx(dc,{render:v.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:v.jsx(ve,{icon:td,size:16,strokeWidth:2})}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsx(mc,{children:"Delete Task"}),v.jsxs(gc,{children:['This will permanently delete "',s.title,'", close its terminal, and remove its worktree. This action cannot be undone.']})]}),v.jsxs(pc,{children:[v.jsx(vc,{children:"Cancel"}),v.jsx(jk,{onClick:et,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),Q?v.jsxs(_a,{value:te,onValueChange:xe=>ee(xe),className:"flex min-h-0 flex-1 flex-col",children:[v.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:v.jsxs(ya,{className:"w-full",children:[v.jsx(ir,{value:"terminal",className:"flex-1",children:"Terminal"}),v.jsx(ir,{value:"details",className:"flex-1",children:"Details"})]})}),v.jsx(_r,{value:"terminal",className:"flex-1 min-h-0",children:v.jsx(Lw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:x,description:_,startupScript:s.startupScript})}),v.jsx(_r,{value:"details",className:"flex-1 min-h-0",children:v.jsxs(_a,{value:a,onValueChange:l,className:"flex h-full flex-col",children:[v.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:v.jsxs(ya,{variant:"line",children:[v.jsxs(ir,{value:"diff",children:[v.jsx(ve,{icon:tC,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),v.jsxs(ir,{value:"browser",children:[v.jsx(ve,{icon:u_,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),v.jsxs(ir,{value:"files",children:[v.jsx(ve,{icon:os,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),v.jsx(_r,{value:"diff",className:"flex-1 overflow-hidden",children:v.jsx(Ow,{taskId:s.id,worktreePath:s.worktreePath})}),v.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:v.jsx(Mw,{taskId:s.id})}),v.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:v.jsx(s2,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}):v.jsxs(ta,{direction:"horizontal",className:"min-h-0 flex-1",children:[v.jsx(ts,{defaultSize:50,minSize:30,children:v.jsx(Lw,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:x,description:_,startupScript:s.startupScript})}),v.jsx(na,{withHandle:!0}),v.jsx(ts,{defaultSize:50,minSize:30,children:v.jsxs(_a,{value:a,onValueChange:l,className:"flex h-full flex-col",children:[v.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:v.jsxs(ya,{variant:"line",children:[v.jsxs(ir,{value:"diff",children:[v.jsx(ve,{icon:tC,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),v.jsxs(ir,{value:"browser",children:[v.jsx(ve,{icon:u_,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),v.jsxs(ir,{value:"files",children:[v.jsx(ve,{icon:os,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),v.jsx(_r,{value:"diff",className:"flex-1 overflow-hidden",children:v.jsx(Ow,{taskId:s.id,worktreePath:s.worktreePath})}),v.jsx(_r,{value:"browser",className:"flex-1 overflow-hidden",children:v.jsx(Mw,{taskId:s.id})}),v.jsx(_r,{value:"files",className:"flex-1 overflow-hidden",children:v.jsx(s2,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),v.jsx(RT,{task:s,open:y,onOpenChange:E}),v.jsx(xs,{open:F,onOpenChange:X,children:v.jsxs(Ss,{className:"sm:max-w-sm",children:[v.jsxs(Bs,{children:[v.jsx(zs,{children:"Open in VS Code"}),v.jsx(aa,{children:"Choose which folder to open"})]}),v.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[v.jsxs(Ne,{variant:"outline",className:"justify-start font-mono text-sm",onClick:ke,disabled:!s.worktreePath,children:[v.jsx(ve,{icon:f_,size:16,strokeWidth:2,className:"mr-2"}),"Worktree",v.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.branch})]}),v.jsxs(Ne,{variant:"outline",className:"justify-start font-mono text-sm",onClick:we,disabled:!s.repoPath,children:[v.jsx(ve,{icon:os,size:16,strokeWidth:2,className:"mr-2"}),"Repository",v.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.repoName})]})]})]})}),v.jsx(xs,{open:M,onOpenChange:L,children:v.jsxs(Ss,{className:"sm:max-w-md",children:[v.jsxs(Bs,{children:[v.jsx(zs,{className:"text-destructive",children:"Sync Failed"}),v.jsx(aa,{children:"An error occurred while syncing with upstream."})]}),v.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:T}),v.jsxs(vo,{className:"mt-4 gap-2",children:[v.jsx(Ne,{variant:"outline",onClick:()=>L(!1),children:"Close"}),v.jsx(Ne,{variant:"outline",onClick:de,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),v.jsx(Ne,{variant:"destructive",onClick:Ie,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),v.jsx(xs,{open:N,onOpenChange:q,children:v.jsxs(Ss,{className:"sm:max-w-md",children:[v.jsxs(Bs,{children:[v.jsx(zs,{className:"text-destructive",children:"Merge Failed"}),v.jsxs(aa,{children:["An error occurred while merging to ",s?.baseBranch||"main","."]})]}),v.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:H}),v.jsxs(vo,{className:"mt-4 gap-2",children:[v.jsx(Ne,{variant:"outline",onClick:()=>q(!1),children:"Close"}),v.jsx(Ne,{variant:"outline",onClick:De,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),v.jsx(Ne,{variant:"destructive",onClick:Oe,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),v.jsx(xs,{open:j,onOpenChange:W,children:v.jsxs(Ss,{className:"sm:max-w-md",children:[v.jsxs(Bs,{children:[v.jsx(zs,{className:"text-destructive",children:"Sync Parent Failed"}),v.jsx(aa,{children:"An error occurred while syncing the parent repository with origin."})]}),v.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:Y}),v.jsxs(vo,{className:"mt-4 gap-2",children:[v.jsx(Ne,{variant:"outline",onClick:()=>W(!1),children:"Close"}),v.jsx(Ne,{variant:"outline",onClick:be,disabled:!ue,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),v.jsx(Ne,{variant:"destructive",onClick:Me,disabled:!ue,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})})]}):v.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[v.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),v.jsx(qn,{to:"/tasks",children:v.jsx(Ne,{variant:"outline",children:"Back to Tasks"})})]})}const w5=ws("/repositories/$repoId")({component:WV});function WV(){const{repoId:e}=w5.useParams(),t=yo(),{data:n,isLoading:s,error:o}=jI(e),u=II(),h=Lk(),{data:a}=Mp(),{data:l}=Dp(),[d,p]=R.useState(""),[f,g]=R.useState(""),[S,C]=R.useState(""),[w,b]=R.useState(!1);R.useEffect(()=>{n&&(p(n.displayName),g(n.startupScript||""),C(n.copyFiles||""),b(!1))},[n]),R.useEffect(()=>{if(n){const E=d!==n.displayName||f!==(n.startupScript||"")||S!==(n.copyFiles||"");b(E)}},[d,f,S,n]);const x=()=>{n&&u.mutate({id:n.id,updates:{displayName:d.trim()||n.path.split("/").pop()||"repo",startupScript:f.trim()||null,copyFiles:S.trim()||null}})},_=async()=>{n&&(await h.mutateAsync(n.id),t({to:"/repositories"}))},y=()=>{if(!n)return;const E=Kh(n.path,a,l);window.open(E,"_blank")};return s?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx(ve,{icon:zr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):o||!n?v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2",children:v.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[v.jsx(ve,{icon:eC,size:16,strokeWidth:2}),"Repositories"]})}),v.jsx("div",{className:"flex flex-1 items-center justify-center",children:v.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[v.jsx(ve,{icon:nc,size:20,strokeWidth:2}),v.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):v.jsxs("div",{className:"flex h-full flex-col",children:[v.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[v.jsx(ve,{icon:eC,size:16,strokeWidth:2}),"Repositories"]}),v.jsx("span",{className:"text-muted-foreground",children:"/"}),v.jsx("span",{className:"text-sm font-medium",children:n.displayName})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:y,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:v.jsx(ve,{icon:p0,size:14,strokeWidth:2})}),v.jsxs(uc,{children:[v.jsxs(dc,{render:v.jsx(Ne,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive"}),children:[v.jsx(ve,{icon:td,size:14,strokeWidth:2,"data-slot":"icon"}),"Delete"]}),v.jsxs(fc,{children:[v.jsxs(hc,{children:[v.jsx(mc,{children:"Delete Repository"}),v.jsxs(gc,{children:['This will remove "',n.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),v.jsxs(pc,{children:[v.jsx(vc,{children:"Cancel"}),v.jsx(Ne,{variant:"destructive",onClick:_,children:"Delete"})]})]})]}),v.jsx(Ne,{size:"sm",onClick:x,disabled:!w||u.isPending,children:u.isPending?"Saving...":"Save"})]})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:v.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[v.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[v.jsx(ve,{icon:os,size:14,strokeWidth:2}),v.jsx("span",{className:"font-mono",children:n.path})]}),v.jsxs(ud,{children:[v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),v.jsx(Wt,{id:"displayName",value:d,onChange:E=>p(E.target.value),placeholder:n.path.split("/").pop()||"My Project"})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),v.jsx(I0,{id:"startupScript",value:f,onChange:E=>g(E.target.value),placeholder:"npm install && npm run dev",rows:3}),v.jsx(ao,{children:"Command to run in the terminal when creating a worktree."})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),v.jsx(Wt,{id:"copyFiles",value:S,onChange:E=>C(E.target.value),placeholder:".env, config.local.json"}),v.jsx(ao,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]})]})})]})}const qV=oN.update({id:"/",path:"/",getParentRoute:()=>Ks}),GV=pN.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Ks}),$V=g7.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Ks}),KV=SB.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Ks}),YV=EB.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Ks}),XV=jB.update({id:"/review/",path:"/review/",getParentRoute:()=>Ks}),QV=NB.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Ks}),ZV=C5.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Ks}),JV=w5.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Ks}),eU={IndexRoute:qV,RepositoriesRepoIdRoute:JV,TasksTaskIdRoute:ZV,RepositoriesIndexRoute:QV,ReviewIndexRoute:XV,SettingsIndexRoute:YV,TasksIndexRoute:KV,TerminalsIndexRoute:$V,WorktreesIndexRoute:GV},tU=Ks._addFileChildren(eU)._addFileTypes(),E5=R.createContext(null);function nU({children:e}){const[t,n]=R.useState(!1),[s,o]=R.useState(!0),[u,h]=R.useState(!1),[a,l]=R.useState(!1),d=R.useCallback(async()=>{try{const S=await fetch("/api/auth/check");if(S.ok){const C=await S.json();h(C.authRequired),n(C.authenticated),C.authRequired&&!C.authenticated&&l(!0)}}catch{h(!1),n(!0)}finally{o(!1)}},[]);R.useEffect(()=>{d()},[d]),R.useEffect(()=>{const S=()=>{u&&(n(!1),l(!0))};return window.addEventListener("vibora:auth-required",S),()=>window.removeEventListener("vibora:auth-required",S)},[u]);const p=R.useCallback(async(S,C)=>{const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:S,password:C})});if(!w.ok){const b=await w.json();throw new Error(b.error||"Login failed")}n(!0),l(!1)},[]),f=R.useCallback(async()=>{await fetch("/api/auth/logout",{method:"POST"}),n(!1),l(!0)},[]),g=R.useMemo(()=>({isAuthenticated:t,isLoading:s,authRequired:u,showLoginModal:a,setShowLoginModal:l,login:p,logout:f}),[t,s,u,a,p,f]);return v.jsx(E5.Provider,{value:g,children:e})}function rU(){const e=R.useContext(E5);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function sU(){const{showLoginModal:e,login:t}=rU(),[n,s]=R.useState(""),[o,u]=R.useState(""),[h,a]=R.useState(null),[l,d]=R.useState(!1),p=R.useCallback(async g=>{g.preventDefault(),a(null),d(!0);try{await t(n,o)}catch(S){a(S instanceof Error?S.message:"Login failed")}finally{d(!1)}},[n,o,t]),f=g=>{g.key==="Enter"&&!l&&n&&o&&(g.preventDefault(),p(g))};return v.jsx(xs,{open:e,children:v.jsxs(Ss,{showCloseButton:!1,className:"sm:max-w-sm",onKeyDown:f,children:[v.jsx(Bs,{children:v.jsx(zs,{children:"Login to Vibora"})}),v.jsxs("form",{onSubmit:p,children:[v.jsxs(ud,{className:"mt-4",children:[v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"login-username",children:"Username"}),v.jsx(Wt,{id:"login-username",type:"text",value:n,onChange:g=>s(g.target.value),autoComplete:"username",autoFocus:!0,required:!0})]}),v.jsxs(Cn,{children:[v.jsx(wn,{htmlFor:"login-password",children:"Password"}),v.jsx(Wt,{id:"login-password",type:"password",value:o,onChange:g=>u(g.target.value),autoComplete:"current-password",required:!0})]}),h&&v.jsx("p",{className:"text-sm text-red-500",children:h})]}),v.jsx(vo,{className:"mt-4",children:v.jsx(Ne,{type:"submit",disabled:l||!n||!o,children:l?"Logging in...":"Login"})})]})]})})}const iU=new FO({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),oU=pO({routeTree:tU});NA.createRoot(document.getElementById("root")).render(v.jsx(R.StrictMode,{children:v.jsx(VO,{client:iU,children:v.jsxs(nU,{children:[v.jsx(vO,{router:oU}),v.jsx(sU,{})]})})}));