vibora 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-DgP1TgfA.js +45 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
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 qL(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 Ow(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ug={exports:{}},cu={};var zx;function GL(){if(zx)return cu;zx=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 cu.Fragment=t,cu.jsx=n,cu.jsxs=n,cu}var Hx;function $L(){return Hx||(Hx=1,Ug.exports=GL()),Ug.exports}var S=$L(),Wg={exports:{}},pt={};var Vx;function KL(){if(Vx)return pt;Vx=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 x(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function y(I,W,Y){this.props=I,this.context=W,this.refs=_,this.updater=Y||C}y.prototype.isReactComponent={},y.prototype.setState=function(I,W){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,W,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=y.prototype;function b(I,W,Y){this.props=I,this.context=W,this.refs=_,this.updater=Y||C}var E=b.prototype=new v;E.constructor=b,w(E,y.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(I,W,Y){var J=Y.ref;return{$$typeof:e,type:I,key:W,ref:J!==void 0?J:null,props:Y}}function H(I,W){return D(I.type,W,I.props)}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var W={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return W[Y]})}var j=/\/+/g;function K(I,W){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):W.toString(36)}function $(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(W){I.status==="pending"&&(I.status="fulfilled",I.value=W)},function(W){I.status==="pending"&&(I.status="rejected",I.reason=W)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function V(I,W,Y,J,Z){var ee=typeof I;(ee==="undefined"||ee==="boolean")&&(I=null);var X=!1;if(I===null)X=!0;else switch(ee){case"bigint":case"string":case"number":X=!0;break;case"object":switch(I.$$typeof){case e:case t:X=!0;break;case p:return X=I._init,V(X(I._payload),W,Y,J,Z)}}if(X)return Z=Z(I),X=J===""?"."+K(I,0):J,T(Z)?(Y="",X!=null&&(Y=X.replace(j,"$&/")+"/"),V(Z,W,Y,"",function(ne){return ne})):Z!=null&&(z(Z)&&(Z=H(Z,Y+(Z.key==null||I&&I.key===Z.key?"":(""+Z.key).replace(j,"$&/")+"/")+X)),W.push(Z)),1;X=0;var F=J===""?".":J+":";if(T(I))for(var se=0;se<I.length;se++)J=I[se],ee=F+K(J,se),X+=V(J,W,Y,ee,Z);else if(se=x(I),typeof se=="function")for(I=se.call(I),se=0;!(J=I.next()).done;)J=J.value,ee=F+K(J,se++),X+=V(J,W,Y,ee,Z);else if(ee==="object"){if(typeof I.then=="function")return V($(I),W,Y,J,Z);throw W=String(I),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return X}function G(I,W,Y){if(I==null)return I;var J=[],Z=0;return V(I,J,"","",function(ee){return W.call(Y,ee,Z++)}),J}function U(I){if(I._status===-1){var W=I._result;W=W(),W.then(function(Y){(I._status===0||I._status===-1)&&(I._status=1,I._result=Y)},function(Y){(I._status===0||I._status===-1)&&(I._status=2,I._result=Y)}),I._status===-1&&(I._status=0,I._result=W)}if(I._status===1)return I._result.default;throw I._result}var P=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},B={map:G,forEach:function(I,W,Y){G(I,function(){W.apply(this,arguments)},Y)},count:function(I){var W=0;return G(I,function(){W++}),W},toArray:function(I){return G(I,function(W){return W})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return pt.Activity=f,pt.Children=B,pt.Component=y,pt.Fragment=n,pt.Profiler=o,pt.PureComponent=b,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(I){return M.H.useMemoCache(I)}},pt.cache=function(I){return function(){return I.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(I,W,Y){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=w({},I.props),Z=I.key;if(W!=null)for(ee in W.key!==void 0&&(Z=""+W.key),W)!L.call(W,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&W.ref===void 0||(J[ee]=W[ee]);var ee=arguments.length-2;if(ee===1)J.children=Y;else if(1<ee){for(var X=Array(ee),F=0;F<ee;F++)X[F]=arguments[F+2];J.children=X}return D(I.type,Z,J)},pt.createContext=function(I){return I={$$typeof:h,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:u,_context:I},I},pt.createElement=function(I,W,Y){var J,Z={},ee=null;if(W!=null)for(J in W.key!==void 0&&(ee=""+W.key),W)L.call(W,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Z[J]=W[J]);var X=arguments.length-2;if(X===1)Z.children=Y;else if(1<X){for(var F=Array(X),se=0;se<X;se++)F[se]=arguments[se+2];Z.children=F}if(I&&I.defaultProps)for(J in X=I.defaultProps,X)Z[J]===void 0&&(Z[J]=X[J]);return D(I,ee,Z)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(I){return{$$typeof:a,render:I}},pt.isValidElement=z,pt.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:U}},pt.memo=function(I,W){return{$$typeof:d,type:I,compare:W===void 0?null:W}},pt.startTransition=function(I){var W=M.T,Y={};M.T=Y;try{var J=I(),Z=M.S;Z!==null&&Z(Y,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(A,P)}catch(ee){P(ee)}finally{W!==null&&Y.types!==null&&(W.types=Y.types),M.T=W}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(I){return M.H.use(I)},pt.useActionState=function(I,W,Y){return M.H.useActionState(I,W,Y)},pt.useCallback=function(I,W){return M.H.useCallback(I,W)},pt.useContext=function(I){return M.H.useContext(I)},pt.useDebugValue=function(){},pt.useDeferredValue=function(I,W){return M.H.useDeferredValue(I,W)},pt.useEffect=function(I,W){return M.H.useEffect(I,W)},pt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(I,W,Y){return M.H.useImperativeHandle(I,W,Y)},pt.useInsertionEffect=function(I,W){return M.H.useInsertionEffect(I,W)},pt.useLayoutEffect=function(I,W){return M.H.useLayoutEffect(I,W)},pt.useMemo=function(I,W){return M.H.useMemo(I,W)},pt.useOptimistic=function(I,W){return M.H.useOptimistic(I,W)},pt.useReducer=function(I,W,Y){return M.H.useReducer(I,W,Y)},pt.useRef=function(I){return M.H.useRef(I)},pt.useState=function(I){return M.H.useState(I)},pt.useSyncExternalStore=function(I,W,Y){return M.H.useSyncExternalStore(I,W,Y)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var Fx;function Yu(){return Fx||(Fx=1,Wg.exports=KL()),Wg.exports}var k=Yu();const Ne=Ow(k),Mw=qL({__proto__:null,default:Ne},[k]);var qg={exports:{}},uu={},Gg={exports:{}},$g={};var Ux;function YL(){return Ux||(Ux=1,(function(e){function t(V,G){var U=V.length;V.push(G);e:for(;0<U;){var P=U-1>>>1,B=V[P];if(0<o(B,G))V[P]=G,V[U]=B,U=P;else break e}}function n(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var G=V[0],U=V.pop();if(U!==G){V[0]=U;e:for(var P=0,B=V.length,I=B>>>1;P<I;){var W=2*(P+1)-1,Y=V[W],J=W+1,Z=V[J];if(0>o(Y,U))J<B&&0>o(Z,Y)?(V[P]=Z,V[J]=U,P=J):(V[P]=Y,V[W]=U,P=W);else if(J<B&&0>o(Z,U))V[P]=Z,V[J]=U,P=J;else break e}}return G}function o(V,G){var U=V.sortIndex-G.sortIndex;return U!==0?U:V.id-G.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,x=!1,C=!1,w=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var G=n(d);G!==null;){if(G.callback===null)s(d);else if(G.startTime<=V)s(d),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(d)}}function T(V){if(w=!1,E(V),!C)if(n(l)!==null)C=!0,A||(A=!0,q());else{var G=n(d);G!==null&&$(T,G.startTime-V)}}var A=!1,M=-1,L=5,D=-1;function H(){return _?!0:!(e.unstable_now()-D<L)}function z(){if(_=!1,A){var V=e.unstable_now();D=V;var G=!0;try{e:{C=!1,w&&(w=!1,v(M),M=-1),x=!0;var U=g;try{t:{for(E(V),f=n(l);f!==null&&!(f.expirationTime>V&&H());){var P=f.callback;if(typeof P=="function"){f.callback=null,g=f.priorityLevel;var B=P(f.expirationTime<=V);if(V=e.unstable_now(),typeof B=="function"){f.callback=B,E(V),G=!0;break t}f===n(l)&&s(l),E(V)}else s(l);f=n(l)}if(f!==null)G=!0;else{var I=n(d);I!==null&&$(T,I.startTime-V),G=!1}}break e}finally{f=null,g=U,x=!1}G=void 0}}finally{G?q():A=!1}}}var q;if(typeof b=="function")q=function(){b(z)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,K=j.port2;j.port1.onmessage=z,q=function(){K.postMessage(null)}}else q=function(){y(z,0)};function $(V,G){M=y(function(){V(e.unstable_now())},G)}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 G=3;break;default:G=g}var U=g;g=G;try{return V()}finally{g=U}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(V,G){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var U=g;g=V;try{return G()}finally{g=U}},e.unstable_scheduleCallback=function(V,G,U){var P=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?P+U:P):U=P,V){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=U+B,V={id:p++,callback:G,priorityLevel:V,startTime:U,expirationTime:B,sortIndex:-1},U>P?(V.sortIndex=U,t(d,V),n(l)===null&&V===n(d)&&(w?(v(M),M=-1):w=!0,$(T,U-P))):(V.sortIndex=B,t(l,V),C||x||(C=!0,A||(A=!0,q()))),V},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(V){var G=g;return function(){var U=g;g=G;try{return V.apply(this,arguments)}finally{g=U}}}})($g)),$g}var Wx;function XL(){return Wx||(Wx=1,Gg.exports=YL()),Gg.exports}var Kg={exports:{}},Xn={};var qx;function QL(){if(qx)return Xn;qx=1;var e=Yu();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,x=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:x}):p==="script"&&s.d.X(l,{crossOrigin:f,integrity:g,fetchPriority:x,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 Gx;function Dw(){if(Gx)return Kg.exports;Gx=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(),Kg.exports=QL(),Kg.exports}var $x;function ZL(){if($x)return uu;$x=1;var e=XL(),t=Yu(),n=Dw();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 R=c.return;if(R===null)break;var O=R.alternate;if(O===null){if(m=R.return,m!==null){c=m;continue}break}if(R.child===O.child){for(O=R.child;O;){if(O===c)return l(R),r;if(O===m)return l(R),i;O=O.sibling}throw Error(s(188))}if(c.return!==m.return)c=R,m=O;else{for(var N=!1,Q=R.child;Q;){if(Q===c){N=!0,c=R,m=O;break}if(Q===m){N=!0,m=R,c=O;break}Q=Q.sibling}if(!N){for(Q=O.child;Q;){if(Q===c){N=!0,c=O,m=R;break}if(Q===m){N=!0,m=O,c=R;break}Q=Q.sibling}if(!N)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"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=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"),H=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var j=Symbol.for("react.client.reference");function K(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===j?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case y:return"Profiler";case _: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 b:return r.displayName||"Context";case v: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:K(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return K(r(i))}catch{}}return null}var $=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},P=[],B=-1;function I(r){return{current:r}}function W(r){0>B||(r.current=P[B],P[B]=null,B--)}function Y(r,i){B++,P[B]=r.current,r.current=i}var J=I(null),Z=I(null),ee=I(null),X=I(null);function F(r,i){switch(Y(ee,i),Y(Z,r),Y(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?lx(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=lx(i),r=cx(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}W(J),Y(J,r)}function se(){W(J),W(Z),W(ee)}function ne(r){r.memoizedState!==null&&Y(X,r);var i=J.current,c=cx(i,r.type);i!==c&&(Y(Z,r),Y(J,c))}function re(r){Z.current===r&&(W(J),W(Z)),X.current===r&&(W(X),iu._currentValue=U)}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 ve=!1;function he(r,i){if(!r||ve)return"";ve=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ye){var ge=ye}Reflect.construct(r,[],Te)}else{try{Te.call()}catch(ye){ge=ye}r.call(Te.prototype)}}else{try{throw Error()}catch(ye){ge=ye}(Te=r())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ye){if(ye&&ge&&typeof ye.stack=="string")return[ye.stack,ge.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=m.DetermineComponentFrameRoot(),N=O[0],Q=O[1];if(N&&Q){var ie=N.split(`
|
|
5
|
+
`),pe=Q.split(`
|
|
6
|
+
`);for(R=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;R<pe.length&&!pe[R].includes("DetermineComponentFrameRoot");)R++;if(m===ie.length||R===pe.length)for(m=ie.length-1,R=pe.length-1;1<=m&&0<=R&&ie[m]!==pe[R];)R--;for(;1<=m&&0<=R;m--,R--)if(ie[m]!==pe[R]){if(m!==1||R!==1)do if(m--,R--,0>R||ie[m]!==pe[R]){var we=`
|
|
7
|
+
`+ie[m].replace(" at new "," at ");return r.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",r.displayName)),we}while(1<=m&&0<=R);break}}}finally{ve=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?_e(c):""}function ue(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 he(r.type,!1);case 11:return he(r.type.render,!1);case 1:return he(r.type,!0);case 31:return _e("Activity");default:return""}}function Ie(r){try{var i="",c=null;do i+=ue(r,c),c=r,r=r.return;while(r);return i}catch(m){return`
|
|
8
|
+
Error generating stack: `+m.message+`
|
|
9
|
+
`+m.stack}}var Me=Object.prototype.hasOwnProperty,Ae=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,me=e.unstable_requestPaint,de=e.unstable_now,xe=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,nt=e.unstable_UserBlockingPriority,Ve=e.unstable_NormalPriority,rt=e.unstable_LowPriority,Je=e.unstable_IdlePriority,dt=e.log,Ce=e.unstable_setDisableYieldValue,Be=null,Re=null;function et(r){if(typeof dt=="function"&&Ce(r),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(Be,r)}catch{}}var at=Math.clz32?Math.clz32:Ct,Ye=Math.log,st=Math.LN2;function Ct(r){return r>>>=0,r===0?32:31-(Ye(r)/st|0)|0}var lt=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 Ze(r,i,c){var m=r.pendingLanes;if(m===0)return 0;var R=0,O=r.suspendedLanes,N=r.pingedLanes;r=r.warmLanes;var Q=m&134217727;return Q!==0?(m=Q&~O,m!==0?R=vt(m):(N&=Q,N!==0?R=vt(N):c||(c=Q&~r,c!==0&&(R=vt(c))))):(Q=m&~O,Q!==0?R=vt(Q):N!==0?R=vt(N):c||(c=m&~r,c!==0&&(R=vt(c)))),R===0?0:i!==0&&i!==R&&(i&O)===0&&(O=R&-R,c=i&-i,O>=c||O===32&&(c&4194048)!==0)?i:R}function Ot(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function jt(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,R,O){var N=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 Q=r.entanglements,ie=r.expirationTimes,pe=r.hiddenUpdates;for(c=N&~c;0<c;){var we=31-at(c),Te=1<<we;Q[we]=0,ie[we]=-1;var ge=pe[we];if(ge!==null)for(pe[we]=null,we=0;we<ge.length;we++){var ye=ge[we];ye!==null&&(ye.lane&=-536870913)}c&=~Te}m!==0&&Xe(r,m,0),O!==0&&R===0&&r.tag!==0&&(r.suspendedLanes|=O&~(N&~i))}function Xe(r,i,c){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-at(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-at(c),R=1<<m;R&i|r[m]&i&&(r[m]|=i),c&=~R}}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 Cs(){var r=G.p;return r!==0?r:(r=window.event,r===void 0?32:Mx(r.type))}function Ha(r,i){var c=G.p;try{return G.p=r,i()}finally{G.p=c}}var xr=Math.random().toString(36).slice(2),pn="__reactFiber$"+xr,mn="__reactProps$"+xr,ws="__reactContainer$"+xr,Sr="__reactEvents$"+xr,Ks="__reactListeners$"+xr,Np="__reactHandles$"+xr,vc="__reactResources$"+xr,Eo="__reactMarker$"+xr;function Ro(r){delete r[pn],delete r[mn],delete r[Sr],delete r[Ks],delete r[Np]}function Ys(r){var i=r[pn];if(i)return i;for(var c=r.parentNode;c;){if(i=c[ws]||c[pn]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(r=gx(r);r!==null;){if(c=r[pn])return c;r=gx(r)}return i}r=c,c=r.parentNode}return null}function Es(r){if(r=r[pn]||r[ws]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ko(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(s(33))}function ls(r){var i=r[vc];return i||(i=r[vc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gn(r){r[Eo]=!0}var tr=new Set,nr={};function Cr(r,i){cs(r,i),cs(r+"Capture",i)}function cs(r,i){for(nr[r]=i,r=0;r<i.length;r++)tr.add(i[r])}var Bp=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]*$"),Va={},Fa={};function zp(r){return Me.call(Fa,r)?!0:Me.call(Va,r)?!1:Bp.test(r)?Fa[r]=!0:(Va[r]=!0,!1)}function Xs(r,i,c){if(zp(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 Ri(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 wr(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 or(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function gd(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Hp(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 R=m.get,O=m.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return R.call(this)},set:function(N){c=""+N,O.call(this,N)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(N){c=""+N},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function _c(r){if(!r._valueTracker){var i=gd(r)?"checked":"value";r._valueTracker=Hp(r,i,""+r[i])}}function Ua(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var c=i.getValue(),m="";return r&&(m=gd(r)?r.checked?"true":"false":r.value),r=m,r!==c?(i.setValue(r),!0):!1}function ki(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 yc=/[\n"\\]/g;function ar(r){return r.replace(yc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function bc(r,i,c,m,R,O,N,Q){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),i!=null?N==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+or(i)):r.value!==""+or(i)&&(r.value=""+or(i)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),i!=null?xc(r,N,or(i)):c!=null?xc(r,N,or(c)):m!=null&&r.removeAttribute("value"),R==null&&O!=null&&(r.defaultChecked=!!O),R!=null&&(r.checked=R&&typeof R!="function"&&typeof R!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?r.name=""+or(Q):r.removeAttribute("name")}function vd(r,i,c,m,R,O,N,Q){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)){_c(r);return}c=c!=null?""+or(c):"",i=i!=null?""+or(i):c,Q||i===r.value||(r.value=i),r.defaultValue=i}m=m??R,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=Q?r.checked:!!m,r.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N),_c(r)}function xc(r,i,c){i==="number"&&ki(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Ti(r,i,c,m){if(r=r.options,i){i={};for(var R=0;R<c.length;R++)i["$"+c[R]]=!0;for(c=0;c<r.length;c++)R=i.hasOwnProperty("$"+r[c].value),r[c].selected!==R&&(r[c].selected=R),R&&m&&(r[c].defaultSelected=!0)}else{for(c=""+or(c),i=null,R=0;R<r.length;R++){if(r[R].value===c){r[R].selected=!0,m&&(r[R].defaultSelected=!0);return}i!==null||r[R].disabled||(i=r[R])}i!==null&&(i.selected=!0)}}function _d(r,i,c){if(i!=null&&(i=""+or(i),i!==r.value&&(r.value=i),c==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=c!=null?""+or(c):""}function Fe(r,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if($(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),i=c}c=or(i),r.defaultValue=c,m=r.textContent,m===c&&m!==""&&m!==null&&(r.value=m),_c(r)}function tt(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 R in i)m=i[R],i.hasOwnProperty(R)&&c[R]!==m&&$t(r,R,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 Qs=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"]]),Zs=/^[\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 Js(r){return Zs.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function us(){}var yd=null;function Vp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Wa=null,qa=null;function ay(r){var i=Es(r);if(i&&(r=i.stateNode)){var c=r[mn]||null;e:switch(r=i.stateNode,i.type){case"input":if(bc(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="'+ar(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var m=c[i];if(m!==r&&m.form===r.form){var R=m[mn]||null;if(!R)throw Error(s(90));bc(m,R.value,R.defaultValue,R.defaultValue,R.checked,R.defaultChecked,R.type,R.name)}}for(i=0;i<c.length;i++)m=c[i],m.form===r.form&&Ua(m)}break e;case"textarea":_d(r,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Ti(r,!!c.multiple,i,!1)}}}var Fp=!1;function ly(r,i,c){if(Fp)return r(i,c);Fp=!0;try{var m=r(i);return m}finally{if(Fp=!1,(Wa!==null||qa!==null)&&(af(),Wa&&(i=Wa,r=qa,qa=Wa=null,ay(i),r)))for(i=0;i<r.length;i++)ay(r[i])}}function Sc(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 ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Up=!1;if(ei)try{var Cc={};Object.defineProperty(Cc,"passive",{get:function(){Up=!0}}),window.addEventListener("test",Cc,Cc),window.removeEventListener("test",Cc,Cc)}catch{Up=!1}var Li=null,Wp=null,bd=null;function cy(){if(bd)return bd;var r,i=Wp,c=i.length,m,R="value"in Li?Li.value:Li.textContent,O=R.length;for(r=0;r<c&&i[r]===R[r];r++);var N=c-r;for(m=1;m<=N&&i[c-m]===R[O-m];m++);return bd=R.slice(r,1<m?1-m:void 0)}function xd(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 Sd(){return!0}function uy(){return!1}function lr(r){function i(c,m,R,O,N){this._reactName=c,this._targetInst=R,this.type=m,this.nativeEvent=O,this.target=N,this.currentTarget=null;for(var Q in r)r.hasOwnProperty(Q)&&(c=r[Q],this[Q]=c?c(O):O[Q]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Sd:uy,this.isPropagationStopped=uy,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=Sd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Sd)},persist:function(){},isPersistent:Sd}),i}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cd=lr(To),wc=f({},To,{view:0,detail:0}),UT=lr(wc),qp,Gp,Ec,wd=f({},wc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,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!==Ec&&(Ec&&r.type==="mousemove"?(qp=r.screenX-Ec.screenX,Gp=r.screenY-Ec.screenY):Gp=qp=0,Ec=r),qp)},movementY:function(r){return"movementY"in r?r.movementY:Gp}}),dy=lr(wd),WT=f({},wd,{dataTransfer:0}),qT=lr(WT),GT=f({},wc,{relatedTarget:0}),$p=lr(GT),$T=f({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),KT=lr($T),YT=f({},To,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),XT=lr(YT),QT=f({},To,{data:0}),fy=lr(QT),ZT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JT={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"},e5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t5(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=e5[r])?!!i[r]:!1}function Kp(){return t5}var n5=f({},wc,{key:function(r){if(r.key){var i=ZT[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=xd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?JT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(r){return r.type==="keypress"?xd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?xd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),r5=lr(n5),s5=f({},wd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hy=lr(s5),i5=f({},wc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),o5=lr(i5),a5=f({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),l5=lr(a5),c5=f({},wd,{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}),u5=lr(c5),d5=f({},To,{newState:0,oldState:0}),f5=lr(d5),h5=[9,13,27,32],Yp=ei&&"CompositionEvent"in window,Rc=null;ei&&"documentMode"in document&&(Rc=document.documentMode);var p5=ei&&"TextEvent"in window&&!Rc,py=ei&&(!Yp||Rc&&8<Rc&&11>=Rc),my=" ",gy=!1;function vy(r,i){switch(r){case"keyup":return h5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _y(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ga=!1;function m5(r,i){switch(r){case"compositionend":return _y(i);case"keypress":return i.which!==32?null:(gy=!0,my);case"textInput":return r=i.data,r===my&&gy?null:r;default:return null}}function g5(r,i){if(Ga)return r==="compositionend"||!Yp&&vy(r,i)?(r=cy(),bd=Wp=Li=null,Ga=!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 v5={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 yy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!v5[r.type]:i==="textarea"}function by(r,i,c,m){Wa?qa?qa.push(m):qa=[m]:Wa=m,i=pf(i,"onChange"),0<i.length&&(c=new Cd("onChange","change",null,c,m),r.push({event:c,listeners:i}))}var kc=null,Tc=null;function _5(r){nx(r,0)}function Ed(r){var i=ko(r);if(Ua(i))return r}function xy(r,i){if(r==="change")return i}var Sy=!1;if(ei){var Xp;if(ei){var Qp="oninput"in document;if(!Qp){var Cy=document.createElement("div");Cy.setAttribute("oninput","return;"),Qp=typeof Cy.oninput=="function"}Xp=Qp}else Xp=!1;Sy=Xp&&(!document.documentMode||9<document.documentMode)}function wy(){kc&&(kc.detachEvent("onpropertychange",Ey),Tc=kc=null)}function Ey(r){if(r.propertyName==="value"&&Ed(Tc)){var i=[];by(i,Tc,r,Vp(r)),ly(_5,i)}}function y5(r,i,c){r==="focusin"?(wy(),kc=i,Tc=c,kc.attachEvent("onpropertychange",Ey)):r==="focusout"&&wy()}function b5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ed(Tc)}function x5(r,i){if(r==="click")return Ed(i)}function S5(r,i){if(r==="input"||r==="change")return Ed(i)}function C5(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Er=typeof Object.is=="function"?Object.is:C5;function Lc(r,i){if(Er(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 R=c[m];if(!Me.call(i,R)||!Er(r[R],i[R]))return!1}return!0}function Ry(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ky(r,i){var c=Ry(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=Ry(c)}}function Ty(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Ty(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Ly(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ki(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=ki(r.document)}return i}function Zp(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 w5=ei&&"documentMode"in document&&11>=document.documentMode,$a=null,Jp=null,Ac=null,em=!1;function Ay(r,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;em||$a==null||$a!==ki(m)||(m=$a,"selectionStart"in m&&Zp(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}),Ac&&Lc(Ac,m)||(Ac=m,m=pf(Jp,"onSelect"),0<m.length&&(i=new Cd("onSelect","select",null,i,c),r.push({event:i,listeners:m}),i.target=$a)))}function Lo(r,i){var c={};return c[r.toLowerCase()]=i.toLowerCase(),c["Webkit"+r]="webkit"+i,c["Moz"+r]="moz"+i,c}var Ka={animationend:Lo("Animation","AnimationEnd"),animationiteration:Lo("Animation","AnimationIteration"),animationstart:Lo("Animation","AnimationStart"),transitionrun:Lo("Transition","TransitionRun"),transitionstart:Lo("Transition","TransitionStart"),transitioncancel:Lo("Transition","TransitionCancel"),transitionend:Lo("Transition","TransitionEnd")},tm={},Oy={};ei&&(Oy=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);function Ao(r){if(tm[r])return tm[r];if(!Ka[r])return r;var i=Ka[r],c;for(c in i)if(i.hasOwnProperty(c)&&c in Oy)return tm[r]=i[c];return r}var My=Ao("animationend"),Dy=Ao("animationiteration"),Py=Ao("animationstart"),E5=Ao("transitionrun"),R5=Ao("transitionstart"),k5=Ao("transitioncancel"),Iy=Ao("transitionend"),jy=new Map,nm="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(" ");nm.push("scrollEnd");function ds(r,i){jy.set(r,i),Cr(i,[r])}var Rd=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)},Fr=[],Ya=0,rm=0;function kd(){for(var r=Ya,i=rm=Ya=0;i<r;){var c=Fr[i];Fr[i++]=null;var m=Fr[i];Fr[i++]=null;var R=Fr[i];Fr[i++]=null;var O=Fr[i];if(Fr[i++]=null,m!==null&&R!==null){var N=m.pending;N===null?R.next=R:(R.next=N.next,N.next=R),m.pending=R}O!==0&&Ny(c,R,O)}}function Td(r,i,c,m){Fr[Ya++]=r,Fr[Ya++]=i,Fr[Ya++]=c,Fr[Ya++]=m,rm|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function sm(r,i,c,m){return Td(r,i,c,m),Ld(r)}function Oo(r,i){return Td(r,null,null,i),Ld(r)}function Ny(r,i,c){r.lanes|=c;var m=r.alternate;m!==null&&(m.lanes|=c);for(var R=!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||(R=!0)),r=O,O=O.return;return r.tag===3?(O=r.stateNode,R&&i!==null&&(R=31-at(c),r=O.hiddenUpdates,m=r[R],m===null?r[R]=[i]:m.push(i),i.lane=c|536870912),O):null}function Ld(r){if(50<Zc)throw Zc=0,hg=null,Error(s(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Xa={};function T5(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 Rr(r,i,c,m){return new T5(r,i,c,m)}function im(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ti(r,i){var c=r.alternate;return c===null?(c=Rr(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 By(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 Ad(r,i,c,m,R,O){var N=0;if(m=r,typeof r=="function")im(r)&&(N=1);else if(typeof r=="string")N=DL(r,c,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Rr(31,c,i,R),r.elementType=D,r.lanes=O,r;case w:return Mo(c.children,R,O,i);case _:N=8,R|=24;break;case y:return r=Rr(12,c,i,R|2),r.elementType=y,r.lanes=O,r;case T:return r=Rr(13,c,i,R),r.elementType=T,r.lanes=O,r;case A:return r=Rr(19,c,i,R),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case b:N=10;break e;case v:N=9;break e;case E:N=11;break e;case M:N=14;break e;case L:N=16,m=null;break e}N=29,c=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Rr(N,c,i,R),i.elementType=r,i.type=m,i.lanes=O,i}function Mo(r,i,c,m){return r=Rr(7,r,m,i),r.lanes=c,r}function om(r,i,c){return r=Rr(6,r,null,i),r.lanes=c,r}function zy(r){var i=Rr(18,null,null,0);return i.stateNode=r,i}function am(r,i,c){return i=Rr(4,r.children!==null?r.children:[],r.key,i),i.lanes=c,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Hy=new WeakMap;function Ur(r,i){if(typeof r=="object"&&r!==null){var c=Hy.get(r);return c!==void 0?c:(i={value:r,source:i,stack:Ie(i)},Hy.set(r,i),i)}return{value:r,source:i,stack:Ie(i)}}var Qa=[],Za=0,Od=null,Oc=0,Wr=[],qr=0,Ai=null,Rs=1,ks="";function ni(r,i){Qa[Za++]=Oc,Qa[Za++]=Od,Od=r,Oc=i}function Vy(r,i,c){Wr[qr++]=Rs,Wr[qr++]=ks,Wr[qr++]=Ai,Ai=r;var m=Rs;r=ks;var R=32-at(m)-1;m&=~(1<<R),c+=1;var O=32-at(i)+R;if(30<O){var N=R-R%5;O=(m&(1<<N)-1).toString(32),m>>=N,R-=N,Rs=1<<32-at(i)+R|c<<R|m,ks=O+r}else Rs=1<<O|c<<R|m,ks=r}function lm(r){r.return!==null&&(ni(r,1),Vy(r,1,0))}function cm(r){for(;r===Od;)Od=Qa[--Za],Qa[Za]=null,Oc=Qa[--Za],Qa[Za]=null;for(;r===Ai;)Ai=Wr[--qr],Wr[qr]=null,ks=Wr[--qr],Wr[qr]=null,Rs=Wr[--qr],Wr[qr]=null}function Fy(r,i){Wr[qr++]=Rs,Wr[qr++]=ks,Wr[qr++]=Ai,Rs=i.id,ks=i.overflow,Ai=r}var Hn=null,Yt=null,At=!1,Oi=null,Gr=!1,um=Error(s(519));function Mi(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mc(Ur(i,r)),um}function Uy(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<eu.length;c++)Rt(eu[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),vd(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),Fe(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||ox(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=us),i=!0):i=!1,i||Mi(r,!0)}function Wy(r){for(Hn=r.return;Hn;)switch(Hn.tag){case 5:case 31:case 13:Gr=!1;return;case 27:case 3:Gr=!0;return;default:Hn=Hn.return}}function Ja(r){if(r!==Hn)return!1;if(!At)return Wy(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")||Tg(r.type,r.memoizedProps)),c=!c),c&&Yt&&Mi(r),Wy(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=mx(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=mx(r)}else i===27?(i=Yt,Gi(r.type)?(r=Dg,Dg=null,Yt=r):Yt=i):Yt=Hn?Kr(r.stateNode.nextSibling):null;return!0}function Do(){Yt=Hn=null,At=!1}function dm(){var r=Oi;return r!==null&&(fr===null?fr=r:fr.push.apply(fr,r),Oi=null),r}function Mc(r){Oi===null?Oi=[r]:Oi.push(r)}var fm=I(null),Po=null,ri=null;function Di(r,i,c){Y(fm,i._currentValue),i._currentValue=c}function si(r){r._currentValue=fm.current,W(fm)}function hm(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 pm(r,i,c,m){var R=r.child;for(R!==null&&(R.return=r);R!==null;){var O=R.dependencies;if(O!==null){var N=R.child;O=O.firstContext;e:for(;O!==null;){var Q=O;O=R;for(var ie=0;ie<i.length;ie++)if(Q.context===i[ie]){O.lanes|=c,Q=O.alternate,Q!==null&&(Q.lanes|=c),hm(O.return,c,r),m||(N=null);break e}O=Q.next}}else if(R.tag===18){if(N=R.return,N===null)throw Error(s(341));N.lanes|=c,O=N.alternate,O!==null&&(O.lanes|=c),hm(N,c,r),N=null}else N=R.child;if(N!==null)N.return=R;else for(N=R;N!==null;){if(N===r){N=null;break}if(R=N.sibling,R!==null){R.return=N.return,N=R;break}N=N.return}R=N}}function el(r,i,c,m){r=null;for(var R=i,O=!1;R!==null;){if(!O){if((R.flags&524288)!==0)O=!0;else if((R.flags&262144)!==0)break}if(R.tag===10){var N=R.alternate;if(N===null)throw Error(s(387));if(N=N.memoizedProps,N!==null){var Q=R.type;Er(R.pendingProps.value,N.value)||(r!==null?r.push(Q):r=[Q])}}else if(R===X.current){if(N=R.alternate,N===null)throw Error(s(387));N.memoizedState.memoizedState!==R.memoizedState.memoizedState&&(r!==null?r.push(iu):r=[iu])}R=R.return}r!==null&&pm(i,r,c,m),i.flags|=262144}function Md(r){for(r=r.firstContext;r!==null;){if(!Er(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Io(r){Po=r,ri=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Vn(r){return qy(Po,r)}function Dd(r,i){return Po===null&&Io(r),qy(r,i)}function qy(r,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},ri===null){if(r===null)throw Error(s(308));ri=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ri=ri.next=i;return c}var L5=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()})}},A5=e.unstable_scheduleCallback,O5=e.unstable_NormalPriority,_n={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mm(){return{controller:new L5,data:new Map,refCount:0}}function Dc(r){r.refCount--,r.refCount===0&&A5(O5,function(){r.controller.abort()})}var Pc=null,gm=0,tl=0,nl=null;function M5(r,i){if(Pc===null){var c=Pc=[];gm=0,tl=yg(),nl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return gm++,i.then(Gy,Gy),i}function Gy(){if(--gm===0&&Pc!==null){nl!==null&&(nl.status="fulfilled");var r=Pc;Pc=null,tl=0,nl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function D5(r,i){var c=[],m={status:"pending",value:null,reason:null,then:function(R){c.push(R)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var R=0;R<c.length;R++)(0,c[R])(i)},function(R){for(m.status="rejected",m.reason=R,R=0;R<c.length;R++)(0,c[R])(void 0)}),m}var $y=V.S;V.S=function(r,i){Ab=de(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&M5(r,i),$y!==null&&$y(r,i)};var jo=I(null);function vm(){var r=jo.current;return r!==null?r:qt.pooledCache}function Pd(r,i){i===null?Y(jo,jo.current):Y(jo,i.pool)}function Ky(){var r=vm();return r===null?null:{parent:_n._currentValue,pool:r}}var rl=Error(s(460)),_m=Error(s(474)),Id=Error(s(542)),jd={then:function(){}};function Yy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Xy(r,i,c){switch(c=r[c],c===void 0?r.push(i):c!==i&&(i.then(us,us),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Zy(r),r;default:if(typeof i.status=="string")i.then(us,us);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 R=i;R.status="fulfilled",R.value=m}},function(m){if(i.status==="pending"){var R=i;R.status="rejected",R.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Zy(r),r}throw Bo=i,rl}}function No(r){try{var i=r._init;return i(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Bo=c,rl):c}}var Bo=null;function Qy(){if(Bo===null)throw Error(s(459));var r=Bo;return Bo=null,r}function Zy(r){if(r===rl||r===Id)throw Error(s(483))}var sl=null,Ic=0;function Nd(r){var i=Ic;return Ic+=1,sl===null&&(sl=[]),Xy(sl,r,i)}function jc(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Bd(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 Jy(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 R(ce,ae){return ce=ti(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 N(ce){return r&&ce.alternate===null&&(ce.flags|=67108866),ce}function Q(ce,ae,fe,ke){return ae===null||ae.tag!==6?(ae=om(fe,ce.mode,ke),ae.return=ce,ae):(ae=R(ae,fe),ae.return=ce,ae)}function ie(ce,ae,fe,ke){var it=fe.type;return it===w?we(ce,ae,fe.props.children,ke,fe.key):ae!==null&&(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&No(it)===ae.type)?(ae=R(ae,fe.props),jc(ae,fe),ae.return=ce,ae):(ae=Ad(fe.type,fe.key,fe.props,null,ce.mode,ke),jc(ae,fe),ae.return=ce,ae)}function pe(ce,ae,fe,ke){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==fe.containerInfo||ae.stateNode.implementation!==fe.implementation?(ae=am(fe,ce.mode,ke),ae.return=ce,ae):(ae=R(ae,fe.children||[]),ae.return=ce,ae)}function we(ce,ae,fe,ke,it){return ae===null||ae.tag!==7?(ae=Mo(fe,ce.mode,ke,it),ae.return=ce,ae):(ae=R(ae,fe),ae.return=ce,ae)}function Te(ce,ae,fe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=om(""+ae,ce.mode,fe),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return fe=Ad(ae.type,ae.key,ae.props,null,ce.mode,fe),jc(fe,ae),fe.return=ce,fe;case C:return ae=am(ae,ce.mode,fe),ae.return=ce,ae;case L:return ae=No(ae),Te(ce,ae,fe)}if($(ae)||q(ae))return ae=Mo(ae,ce.mode,fe,null),ae.return=ce,ae;if(typeof ae.then=="function")return Te(ce,Nd(ae),fe);if(ae.$$typeof===b)return Te(ce,Dd(ce,ae),fe);Bd(ce,ae)}return null}function ge(ce,ae,fe,ke){var it=ae!==null?ae.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return it!==null?null:Q(ce,ae,""+fe,ke);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return fe.key===it?ie(ce,ae,fe,ke):null;case C:return fe.key===it?pe(ce,ae,fe,ke):null;case L:return fe=No(fe),ge(ce,ae,fe,ke)}if($(fe)||q(fe))return it!==null?null:we(ce,ae,fe,ke,null);if(typeof fe.then=="function")return ge(ce,ae,Nd(fe),ke);if(fe.$$typeof===b)return ge(ce,ae,Dd(ce,fe),ke);Bd(ce,fe)}return null}function ye(ce,ae,fe,ke,it){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return ce=ce.get(fe)||null,Q(ae,ce,""+ke,it);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case x:return ce=ce.get(ke.key===null?fe:ke.key)||null,ie(ae,ce,ke,it);case C:return ce=ce.get(ke.key===null?fe:ke.key)||null,pe(ae,ce,ke,it);case L:return ke=No(ke),ye(ce,ae,fe,ke,it)}if($(ke)||q(ke))return ce=ce.get(fe)||null,we(ae,ce,ke,it,null);if(typeof ke.then=="function")return ye(ce,ae,fe,Nd(ke),it);if(ke.$$typeof===b)return ye(ce,ae,fe,Dd(ae,ke),it);Bd(ae,ke)}return null}function Ge(ce,ae,fe,ke){for(var it=null,Mt=null,Qe=ae,_t=ae=0,Lt=null;Qe!==null&&_t<fe.length;_t++){Qe.index>_t?(Lt=Qe,Qe=null):Lt=Qe.sibling;var Dt=ge(ce,Qe,fe[_t],ke);if(Dt===null){Qe===null&&(Qe=Lt);break}r&&Qe&&Dt.alternate===null&&i(ce,Qe),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt,Qe=Lt}if(_t===fe.length)return c(ce,Qe),At&&ni(ce,_t),it;if(Qe===null){for(;_t<fe.length;_t++)Qe=Te(ce,fe[_t],ke),Qe!==null&&(ae=O(Qe,ae,_t),Mt===null?it=Qe:Mt.sibling=Qe,Mt=Qe);return At&&ni(ce,_t),it}for(Qe=m(Qe);_t<fe.length;_t++)Lt=ye(Qe,ce,_t,fe[_t],ke),Lt!==null&&(r&&Lt.alternate!==null&&Qe.delete(Lt.key===null?_t:Lt.key),ae=O(Lt,ae,_t),Mt===null?it=Lt:Mt.sibling=Lt,Mt=Lt);return r&&Qe.forEach(function(Qi){return i(ce,Qi)}),At&&ni(ce,_t),it}function ut(ce,ae,fe,ke){if(fe==null)throw Error(s(151));for(var it=null,Mt=null,Qe=ae,_t=ae=0,Lt=null,Dt=fe.next();Qe!==null&&!Dt.done;_t++,Dt=fe.next()){Qe.index>_t?(Lt=Qe,Qe=null):Lt=Qe.sibling;var Qi=ge(ce,Qe,Dt.value,ke);if(Qi===null){Qe===null&&(Qe=Lt);break}r&&Qe&&Qi.alternate===null&&i(ce,Qe),ae=O(Qi,ae,_t),Mt===null?it=Qi:Mt.sibling=Qi,Mt=Qi,Qe=Lt}if(Dt.done)return c(ce,Qe),At&&ni(ce,_t),it;if(Qe===null){for(;!Dt.done;_t++,Dt=fe.next())Dt=Te(ce,Dt.value,ke),Dt!==null&&(ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return At&&ni(ce,_t),it}for(Qe=m(Qe);!Dt.done;_t++,Dt=fe.next())Dt=ye(Qe,ce,_t,Dt.value,ke),Dt!==null&&(r&&Dt.alternate!==null&&Qe.delete(Dt.key===null?_t:Dt.key),ae=O(Dt,ae,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return r&&Qe.forEach(function(WL){return i(ce,WL)}),At&&ni(ce,_t),it}function Ut(ce,ae,fe,ke){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 x: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),ke=R(ae,fe.props.children),ke.return=ce,ce=ke;break e}}else if(ae.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&No(it)===ae.type){c(ce,ae.sibling),ke=R(ae,fe.props),jc(ke,fe),ke.return=ce,ce=ke;break e}c(ce,ae);break}else i(ce,ae);ae=ae.sibling}fe.type===w?(ke=Mo(fe.props.children,ce.mode,ke,fe.key),ke.return=ce,ce=ke):(ke=Ad(fe.type,fe.key,fe.props,null,ce.mode,ke),jc(ke,fe),ke.return=ce,ce=ke)}return N(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),ke=R(ae,fe.children||[]),ke.return=ce,ce=ke;break e}else{c(ce,ae);break}else i(ce,ae);ae=ae.sibling}ke=am(fe,ce.mode,ke),ke.return=ce,ce=ke}return N(ce);case L:return fe=No(fe),Ut(ce,ae,fe,ke)}if($(fe))return Ge(ce,ae,fe,ke);if(q(fe)){if(it=q(fe),typeof it!="function")throw Error(s(150));return fe=it.call(fe),ut(ce,ae,fe,ke)}if(typeof fe.then=="function")return Ut(ce,ae,Nd(fe),ke);if(fe.$$typeof===b)return Ut(ce,ae,Dd(ce,fe),ke);Bd(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,ae!==null&&ae.tag===6?(c(ce,ae.sibling),ke=R(ae,fe),ke.return=ce,ce=ke):(c(ce,ae),ke=om(fe,ce.mode,ke),ke.return=ce,ce=ke),N(ce)):c(ce,ae)}return function(ce,ae,fe,ke){try{Ic=0;var it=Ut(ce,ae,fe,ke);return sl=null,it}catch(Qe){if(Qe===rl||Qe===Id)throw Qe;var Mt=Rr(29,Qe,null,ce.mode);return Mt.lanes=ke,Mt.return=ce,Mt}}}var zo=Jy(!0),e1=Jy(!1),Pi=!1;function ym(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bm(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 Ii(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ji(r,i,c){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(It&2)!==0){var R=m.pending;return R===null?i.next=i:(i.next=R.next,R.next=i),m.pending=i,i=Ld(r),Ny(r,null,c),i}return Td(r,m,i,c),Ld(r)}function Nc(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 xm(r,i){var c=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var R=null,O=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};O===null?R=O=N:O=O.next=N,c=c.next}while(c!==null);O===null?R=O=i:O=O.next=i}else R=O=i;c={baseState:m.baseState,firstBaseUpdate:R,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 Sm=!1;function Bc(){if(Sm){var r=nl;if(r!==null)throw r}}function zc(r,i,c,m){Sm=!1;var R=r.updateQueue;Pi=!1;var O=R.firstBaseUpdate,N=R.lastBaseUpdate,Q=R.shared.pending;if(Q!==null){R.shared.pending=null;var ie=Q,pe=ie.next;ie.next=null,N===null?O=pe:N.next=pe,N=ie;var we=r.alternate;we!==null&&(we=we.updateQueue,Q=we.lastBaseUpdate,Q!==N&&(Q===null?we.firstBaseUpdate=pe:Q.next=pe,we.lastBaseUpdate=ie))}if(O!==null){var Te=R.baseState;N=0,we=pe=ie=null,Q=O;do{var ge=Q.lane&-536870913,ye=ge!==Q.lane;if(ye?(Tt&ge)===ge:(m&ge)===ge){ge!==0&&ge===tl&&(Sm=!0),we!==null&&(we=we.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var Ge=r,ut=Q;ge=i;var Ut=c;switch(ut.tag){case 1:if(Ge=ut.payload,typeof Ge=="function"){Te=Ge.call(Ut,Te,ge);break e}Te=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=ut.payload,ge=typeof Ge=="function"?Ge.call(Ut,Te,ge):Ge,ge==null)break e;Te=f({},Te,ge);break e;case 2:Pi=!0}}ge=Q.callback,ge!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=R.callbacks,ye===null?R.callbacks=[ge]:ye.push(ge))}else ye={lane:ge,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},we===null?(pe=we=ye,ie=Te):we=we.next=ye,N|=ge;if(Q=Q.next,Q===null){if(Q=R.shared.pending,Q===null)break;ye=Q,Q=ye.next,ye.next=null,R.lastBaseUpdate=ye,R.shared.pending=null}}while(!0);we===null&&(ie=Te),R.baseState=ie,R.firstBaseUpdate=pe,R.lastBaseUpdate=we,O===null&&(R.shared.lanes=0),Vi|=N,r.lanes=N,r.memoizedState=Te}}function t1(r,i){if(typeof r!="function")throw Error(s(191,r));r.call(i)}function n1(r,i){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)t1(c[r],i)}var il=I(null),zd=I(0);function r1(r,i){r=hi,Y(zd,r),Y(il,i),hi=r|i.baseLanes}function Cm(){Y(zd,hi),Y(il,il.current)}function wm(){hi=zd.current,W(il),W(zd)}var kr=I(null),$r=null;function Ni(r){var i=r.alternate;Y(cn,cn.current&1),Y(kr,r),$r===null&&(i===null||il.current!==null||i.memoizedState!==null)&&($r=r)}function Em(r){Y(cn,cn.current),Y(kr,r),$r===null&&($r=r)}function s1(r){r.tag===22?(Y(cn,cn.current),Y(kr,r),$r===null&&($r=r)):Bi()}function Bi(){Y(cn,cn.current),Y(kr,kr.current)}function Tr(r){W(kr),$r===r&&($r=null),W(cn)}var cn=I(0);function Hd(r){for(var i=r;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Og(c)||Mg(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 ii=0,gt=null,Vt=null,yn=null,Vd=!1,ol=!1,Ho=!1,Fd=0,Hc=0,al=null,P5=0;function on(){throw Error(s(321))}function Rm(r,i){if(i===null)return!1;for(var c=0;c<i.length&&c<r.length;c++)if(!Er(r[c],i[c]))return!1;return!0}function km(r,i,c,m,R,O){return ii=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?V1:Fm,Ho=!1,O=c(m,R),Ho=!1,ol&&(O=o1(i,c,m,R)),i1(r),O}function i1(r){V.H=Uc;var i=Vt!==null&&Vt.next!==null;if(ii=0,yn=Vt=gt=null,Vd=!1,Hc=0,al=null,i)throw Error(s(300));r===null||bn||(r=r.dependencies,r!==null&&Md(r)&&(bn=!0))}function o1(r,i,c,m){gt=r;var R=0;do{if(ol&&(al=null),Hc=0,ol=!1,25<=R)throw Error(s(301));if(R+=1,yn=Vt=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=F1,O=i(c,m)}while(ol);return O}function I5(){var r=V.H,i=r.useState()[0];return i=typeof i.then=="function"?Vc(i):i,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(gt.flags|=1024),i}function Tm(){var r=Fd!==0;return Fd=0,r}function Lm(r,i,c){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~c}function Am(r){if(Vd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Vd=!1}ii=0,yn=Vt=gt=null,ol=!1,Hc=Fd=0,al=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(Vt===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var i=yn===null?gt.memoizedState:yn.next;if(i!==null)yn=i,Vt=r;else{if(r===null)throw gt.alternate===null?Error(s(467)):Error(s(310));Vt=r,r={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},yn===null?gt.memoizedState=yn=r:yn=yn.next=r}return yn}function Ud(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vc(r){var i=Hc;return Hc+=1,al===null&&(al=[]),r=Xy(al,r,i),i=gt,(yn===null?i.memoizedState:yn.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?V1:Fm),r}function Wd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Vc(r);if(r.$$typeof===b)return Vn(r)}throw Error(s(438,String(r)))}function Om(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(R){return R.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=Ud(),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]=H;return i.index++,c}function oi(r,i){return typeof i=="function"?i(r):i}function qd(r){var i=un();return Mm(i,Vt,r)}function Mm(r,i,c){var m=r.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var R=r.baseQueue,O=m.pending;if(O!==null){if(R!==null){var N=R.next;R.next=O.next,O.next=N}i.baseQueue=R=O,m.pending=null}if(O=r.baseState,R===null)r.memoizedState=O;else{i=R.next;var Q=N=null,ie=null,pe=i,we=!1;do{var Te=pe.lane&-536870913;if(Te!==pe.lane?(Tt&Te)===Te:(ii&Te)===Te){var ge=pe.revertLane;if(ge===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),Te===tl&&(we=!0);else if((ii&ge)===ge){pe=pe.next,ge===tl&&(we=!0);continue}else Te={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=Te,N=O):ie=ie.next=Te,gt.lanes|=ge,Vi|=ge;Te=pe.action,Ho&&c(O,Te),O=pe.hasEagerState?pe.eagerState:c(O,Te)}else ge={lane:Te,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=ge,N=O):ie=ie.next=ge,gt.lanes|=Te,Vi|=Te;pe=pe.next}while(pe!==null&&pe!==i);if(ie===null?N=O:ie.next=Q,!Er(O,r.memoizedState)&&(bn=!0,we&&(c=nl,c!==null)))throw c;r.memoizedState=O,r.baseState=N,r.baseQueue=ie,m.lastRenderedState=O}return R===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function Dm(r){var i=un(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var m=c.dispatch,R=c.pending,O=i.memoizedState;if(R!==null){c.pending=null;var N=R=R.next;do O=r(O,N.action),N=N.next;while(N!==R);Er(O,i.memoizedState)||(bn=!0),i.memoizedState=O,i.baseQueue===null&&(i.baseState=O),c.lastRenderedState=O}return[O,m]}function a1(r,i,c){var m=gt,R=un(),O=At;if(O){if(c===void 0)throw Error(s(407));c=c()}else c=i();var N=!Er((Vt||R).memoizedState,c);if(N&&(R.memoizedState=c,bn=!0),R=R.queue,jm(u1.bind(null,m,R,r),[r]),R.getSnapshot!==i||N||yn!==null&&yn.memoizedState.tag&1){if(m.flags|=2048,ll(9,{destroy:void 0},c1.bind(null,m,R,c,i),null),qt===null)throw Error(s(349));O||(ii&127)!==0||l1(m,i,c)}return c}function l1(r,i,c){r.flags|=16384,r={getSnapshot:i,value:c},i=gt.updateQueue,i===null?(i=Ud(),gt.updateQueue=i,i.stores=[r]):(c=i.stores,c===null?i.stores=[r]:c.push(r))}function c1(r,i,c,m){i.value=c,i.getSnapshot=m,d1(i)&&f1(r)}function u1(r,i,c){return c(function(){d1(i)&&f1(r)})}function d1(r){var i=r.getSnapshot;r=r.value;try{var c=i();return!Er(r,c)}catch{return!0}}function f1(r){var i=Oo(r,2);i!==null&&hr(i,r,2)}function Pm(r){var i=rr();if(typeof r=="function"){var c=r;if(r=c(),Ho){et(!0);try{c()}finally{et(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:r},i}function h1(r,i,c,m){return r.baseState=c,Mm(r,Vt,typeof m=="function"?m:oi)}function j5(r,i,c,m,R){if(Kd(r))throw Error(s(485));if(r=i.action,r!==null){var O={payload:R,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){O.listeners.push(N)}};V.T!==null?c(!0):O.isTransition=!1,m(O),c=i.pending,c===null?(O.next=i.pending=O,p1(i,O)):(O.next=c.next,i.pending=c.next=O)}}function p1(r,i){var c=i.action,m=i.payload,R=r.state;if(i.isTransition){var O=V.T,N={};V.T=N;try{var Q=c(R,m),ie=V.S;ie!==null&&ie(N,Q),m1(r,i,Q)}catch(pe){Im(r,i,pe)}finally{O!==null&&N.types!==null&&(O.types=N.types),V.T=O}}else try{O=c(R,m),m1(r,i,O)}catch(pe){Im(r,i,pe)}}function m1(r,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){g1(r,i,m)},function(m){return Im(r,i,m)}):g1(r,i,c)}function g1(r,i,c){i.status="fulfilled",i.value=c,v1(i),r.state=c,i=r.pending,i!==null&&(c=i.next,c===i?r.pending=null:(c=c.next,i.next=c,p1(r,c)))}function Im(r,i,c){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=c,v1(i),i=i.next;while(i!==m)}r.action=null}function v1(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function _1(r,i){return i}function y1(r,i){if(At){var c=qt.formState;if(c!==null){e:{var m=gt;if(At){if(Yt){t:{for(var R=Yt,O=Gr;R.nodeType!==8;){if(!O){R=null;break t}if(R=Kr(R.nextSibling),R===null){R=null;break t}}O=R.data,R=O==="F!"||O==="F"?R:null}if(R){Yt=Kr(R.nextSibling),m=R.data==="F!";break e}}Mi(m)}m=!1}m&&(i=c[0])}}return c=rr(),c.memoizedState=c.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_1,lastRenderedState:i},c.queue=m,c=B1.bind(null,gt,m),m.dispatch=c,m=Pm(!1),O=Vm.bind(null,gt,!1,m.queue),m=rr(),R={state:i,dispatch:null,action:r,pending:null},m.queue=R,c=j5.bind(null,gt,R,O,c),R.dispatch=c,m.memoizedState=r,[i,c,!1]}function b1(r){var i=un();return x1(i,Vt,r)}function x1(r,i,c){if(i=Mm(r,i,_1)[0],r=qd(oi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=Vc(i)}catch(N){throw N===rl?Id:N}else m=i;i=un();var R=i.queue,O=R.dispatch;return c!==i.memoizedState&&(gt.flags|=2048,ll(9,{destroy:void 0},N5.bind(null,R,c),null)),[m,O,r]}function N5(r,i){r.action=i}function S1(r){var i=un(),c=Vt;if(c!==null)return x1(i,c,r);un(),i=i.memoizedState,c=un();var m=c.queue.dispatch;return c.memoizedState=r,[i,m,!1]}function ll(r,i,c,m){return r={tag:r,create:c,deps:m,inst:i,next:null},i=gt.updateQueue,i===null&&(i=Ud(),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 C1(){return un().memoizedState}function Gd(r,i,c,m){var R=rr();gt.flags|=r,R.memoizedState=ll(1|i,{destroy:void 0},c,m===void 0?null:m)}function $d(r,i,c,m){var R=un();m=m===void 0?null:m;var O=R.memoizedState.inst;Vt!==null&&m!==null&&Rm(m,Vt.memoizedState.deps)?R.memoizedState=ll(i,O,c,m):(gt.flags|=r,R.memoizedState=ll(1|i,O,c,m))}function w1(r,i){Gd(8390656,8,r,i)}function jm(r,i){$d(2048,8,r,i)}function B5(r){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=Ud(),gt.updateQueue=i,i.events=[r];else{var c=i.events;c===null?i.events=[r]:c.push(r)}}function E1(r){var i=un().memoizedState;return B5({ref:i,nextImpl:r}),function(){if((It&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function R1(r,i){return $d(4,2,r,i)}function k1(r,i){return $d(4,4,r,i)}function T1(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 L1(r,i,c){c=c!=null?c.concat([r]):null,$d(4,4,T1.bind(null,i,r),c)}function Nm(){}function A1(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&Rm(i,m[1])?m[0]:(c.memoizedState=[r,i],r)}function O1(r,i){var c=un();i=i===void 0?null:i;var m=c.memoizedState;if(i!==null&&Rm(i,m[1]))return m[0];if(m=r(),Ho){et(!0);try{r()}finally{et(!1)}}return c.memoizedState=[m,i],m}function Bm(r,i,c){return c===void 0||(ii&1073741824)!==0&&(Tt&261930)===0?r.memoizedState=i:(r.memoizedState=c,r=Mb(),gt.lanes|=r,Vi|=r,c)}function M1(r,i,c,m){return Er(c,i)?c:il.current!==null?(r=Bm(r,c,m),Er(r,i)||(bn=!0),r):(ii&42)===0||(ii&1073741824)!==0&&(Tt&261930)===0?(bn=!0,r.memoizedState=c):(r=Mb(),gt.lanes|=r,Vi|=r,i)}function D1(r,i,c,m,R){var O=G.p;G.p=O!==0&&8>O?O:8;var N=V.T,Q={};V.T=Q,Vm(r,!1,i,c);try{var ie=R(),pe=V.S;if(pe!==null&&pe(Q,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var we=D5(ie,m);Fc(r,i,we,Or(r))}else Fc(r,i,m,Or(r))}catch(Te){Fc(r,i,{then:function(){},status:"rejected",reason:Te},Or())}finally{G.p=O,N!==null&&Q.types!==null&&(N.types=Q.types),V.T=N}}function z5(){}function zm(r,i,c,m){if(r.tag!==5)throw Error(s(476));var R=P1(r).queue;D1(r,R,i,U,c===null?z5:function(){return I1(r),c(m)})}function P1(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:U},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:c},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function I1(r){var i=P1(r);i.next===null&&(i=r.alternate.memoizedState),Fc(r,i.next.queue,{},Or())}function Hm(){return Vn(iu)}function j1(){return un().memoizedState}function N1(){return un().memoizedState}function H5(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var c=Or();r=Ii(c);var m=ji(i,r,c);m!==null&&(hr(m,i,c),Nc(m,i,c)),i={cache:mm()},r.payload=i;return}i=i.return}}function V5(r,i,c){var m=Or();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Kd(r)?z1(i,c):(c=sm(r,i,c,m),c!==null&&(hr(c,r,m),H1(c,i,m)))}function B1(r,i,c){var m=Or();Fc(r,i,c,m)}function Fc(r,i,c,m){var R={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Kd(r))z1(i,R);else{var O=r.alternate;if(r.lanes===0&&(O===null||O.lanes===0)&&(O=i.lastRenderedReducer,O!==null))try{var N=i.lastRenderedState,Q=O(N,c);if(R.hasEagerState=!0,R.eagerState=Q,Er(Q,N))return Td(r,i,R,0),qt===null&&kd(),!1}catch{}if(c=sm(r,i,R,m),c!==null)return hr(c,r,m),H1(c,i,m),!0}return!1}function Vm(r,i,c,m){if(m={lane:2,revertLane:yg(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Kd(r)){if(i)throw Error(s(479))}else i=sm(r,c,m,2),i!==null&&hr(i,r,2)}function Kd(r){var i=r.alternate;return r===gt||i!==null&&i===gt}function z1(r,i){ol=Vd=!0;var c=r.pending;c===null?i.next=i:(i.next=c.next,c.next=i),r.pending=i}function H1(r,i,c){if((c&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,c|=m,i.lanes=c,Ht(r,c)}}var Uc={readContext:Vn,use:Wd,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useLayoutEffect:on,useInsertionEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useSyncExternalStore:on,useId:on,useHostTransitionStatus:on,useFormState:on,useActionState:on,useOptimistic:on,useMemoCache:on,useCacheRefresh:on};Uc.useEffectEvent=on;var V1={readContext:Vn,use:Wd,useCallback:function(r,i){return rr().memoizedState=[r,i===void 0?null:i],r},useContext:Vn,useEffect:w1,useImperativeHandle:function(r,i,c){c=c!=null?c.concat([r]):null,Gd(4194308,4,T1.bind(null,i,r),c)},useLayoutEffect:function(r,i){return Gd(4194308,4,r,i)},useInsertionEffect:function(r,i){Gd(4,2,r,i)},useMemo:function(r,i){var c=rr();i=i===void 0?null:i;var m=r();if(Ho){et(!0);try{r()}finally{et(!1)}}return c.memoizedState=[m,i],m},useReducer:function(r,i,c){var m=rr();if(c!==void 0){var R=c(i);if(Ho){et(!0);try{c(i)}finally{et(!1)}}}else R=i;return m.memoizedState=m.baseState=R,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:R},m.queue=r,r=r.dispatch=V5.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=Pm(r);var i=r.queue,c=B1.bind(null,gt,i);return i.dispatch=c,[r.memoizedState,c]},useDebugValue:Nm,useDeferredValue:function(r,i){var c=rr();return Bm(c,r,i)},useTransition:function(){var r=Pm(!1);return r=D1.bind(null,gt,r.queue,!0,!1),rr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,c){var m=gt,R=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||l1(m,i,c)}R.memoizedState=c;var O={value:c,getSnapshot:i};return R.queue=O,w1(u1.bind(null,m,O,r),[r]),m.flags|=2048,ll(9,{destroy:void 0},c1.bind(null,m,O,c,i),null),c},useId:function(){var r=rr(),i=qt.identifierPrefix;if(At){var c=ks,m=Rs;c=(m&~(1<<32-at(m)-1)).toString(32)+c,i="_"+i+"R_"+c,c=Fd++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=P5++,i="_"+i+"r_"+c.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Hm,useFormState:y1,useActionState:y1,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=Vm.bind(null,gt,!0,c),c.dispatch=i,[r,i]},useMemoCache:Om,useCacheRefresh:function(){return rr().memoizedState=H5.bind(null,gt)},useEffectEvent:function(r){var i=rr(),c={impl:r};return i.memoizedState=c,function(){if((It&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Fm={readContext:Vn,use:Wd,useCallback:A1,useContext:Vn,useEffect:jm,useImperativeHandle:L1,useInsertionEffect:R1,useLayoutEffect:k1,useMemo:O1,useReducer:qd,useRef:C1,useState:function(){return qd(oi)},useDebugValue:Nm,useDeferredValue:function(r,i){var c=un();return M1(c,Vt.memoizedState,r,i)},useTransition:function(){var r=qd(oi)[0],i=un().memoizedState;return[typeof r=="boolean"?r:Vc(r),i]},useSyncExternalStore:a1,useId:j1,useHostTransitionStatus:Hm,useFormState:b1,useActionState:b1,useOptimistic:function(r,i){var c=un();return h1(c,Vt,r,i)},useMemoCache:Om,useCacheRefresh:N1};Fm.useEffectEvent=E1;var F1={readContext:Vn,use:Wd,useCallback:A1,useContext:Vn,useEffect:jm,useImperativeHandle:L1,useInsertionEffect:R1,useLayoutEffect:k1,useMemo:O1,useReducer:Dm,useRef:C1,useState:function(){return Dm(oi)},useDebugValue:Nm,useDeferredValue:function(r,i){var c=un();return Vt===null?Bm(c,r,i):M1(c,Vt.memoizedState,r,i)},useTransition:function(){var r=Dm(oi)[0],i=un().memoizedState;return[typeof r=="boolean"?r:Vc(r),i]},useSyncExternalStore:a1,useId:j1,useHostTransitionStatus:Hm,useFormState:S1,useActionState:S1,useOptimistic:function(r,i){var c=un();return Vt!==null?h1(c,Vt,r,i):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Om,useCacheRefresh:N1};F1.useEffectEvent=E1;function Um(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 Wm={enqueueSetState:function(r,i,c){r=r._reactInternals;var m=Or(),R=Ii(m);R.payload=i,c!=null&&(R.callback=c),i=ji(r,R,m),i!==null&&(hr(i,r,m),Nc(i,r,m))},enqueueReplaceState:function(r,i,c){r=r._reactInternals;var m=Or(),R=Ii(m);R.tag=1,R.payload=i,c!=null&&(R.callback=c),i=ji(r,R,m),i!==null&&(hr(i,r,m),Nc(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var c=Or(),m=Ii(c);m.tag=2,i!=null&&(m.callback=i),i=ji(r,m,c),i!==null&&(hr(i,r,c),Nc(i,r,c))}};function U1(r,i,c,m,R,O,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,N):i.prototype&&i.prototype.isPureReactComponent?!Lc(c,m)||!Lc(R,O):!0}function W1(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&&Wm.enqueueReplaceState(i,i.state,null)}function Vo(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 R in r)c[R]===void 0&&(c[R]=r[R])}return c}function q1(r){Rd(r)}function G1(r){console.error(r)}function $1(r){Rd(r)}function Yd(r,i){try{var c=r.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function K1(r,i,c){try{var m=r.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(R){setTimeout(function(){throw R})}}function qm(r,i,c){return c=Ii(c),c.tag=3,c.payload={element:null},c.callback=function(){Yd(r,i)},c}function Y1(r){return r=Ii(r),r.tag=3,r}function X1(r,i,c,m){var R=c.type.getDerivedStateFromError;if(typeof R=="function"){var O=m.value;r.payload=function(){return R(O)},r.callback=function(){K1(i,c,m)}}var N=c.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){K1(i,c,m),typeof R!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var Q=m.stack;this.componentDidCatch(m.value,{componentStack:Q!==null?Q:""})})}function F5(r,i,c,m,R){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=c.alternate,i!==null&&el(i,c,R,!0),c=kr.current,c!==null){switch(c.tag){case 31:case 13:return $r===null?lf():c.alternate===null&&an===0&&(an=3),c.flags&=-257,c.flags|=65536,c.lanes=R,m===jd?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([m]):i.add(m),gg(r,m,R)),!1;case 22:return c.flags|=65536,m===jd?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)),gg(r,m,R)),!1}throw Error(s(435,c.tag))}return gg(r,m,R),lf(),!1}if(At)return i=kr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=R,m!==um&&(r=Error(s(422),{cause:m}),Mc(Ur(r,c)))):(m!==um&&(i=Error(s(423),{cause:m}),Mc(Ur(i,c))),r=r.current.alternate,r.flags|=65536,R&=-R,r.lanes|=R,m=Ur(m,c),R=qm(r.stateNode,m,R),xm(r,R),an!==4&&(an=2)),!1;var O=Error(s(520),{cause:m});if(O=Ur(O,c),Qc===null?Qc=[O]:Qc.push(O),an!==4&&(an=2),i===null)return!0;m=Ur(m,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,r=R&-R,c.lanes|=r,r=qm(c.stateNode,m,r),xm(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"&&(Fi===null||!Fi.has(O))))return c.flags|=65536,R&=-R,c.lanes|=R,R=Y1(R),X1(R,r,c,m),xm(c,R),!1}c=c.return}while(c!==null);return!1}var Gm=Error(s(461)),bn=!1;function Fn(r,i,c,m){i.child=r===null?e1(i,null,c,m):zo(i,r.child,c,m)}function Q1(r,i,c,m,R){c=c.render;var O=i.ref;if("ref"in m){var N={};for(var Q in m)Q!=="ref"&&(N[Q]=m[Q])}else N=m;return Io(i),m=km(r,i,c,N,O,R),Q=Tm(),r!==null&&!bn?(Lm(r,i,R),ai(r,i,R)):(At&&Q&&lm(i),i.flags|=1,Fn(r,i,m,R),i.child)}function Z1(r,i,c,m,R){if(r===null){var O=c.type;return typeof O=="function"&&!im(O)&&O.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=O,J1(r,i,O,m,R)):(r=Ad(c.type,null,m,i,i.mode,R),r.ref=i.ref,r.return=i,i.child=r)}if(O=r.child,!eg(r,R)){var N=O.memoizedProps;if(c=c.compare,c=c!==null?c:Lc,c(N,m)&&r.ref===i.ref)return ai(r,i,R)}return i.flags|=1,r=ti(O,m),r.ref=i.ref,r.return=i,i.child=r}function J1(r,i,c,m,R){if(r!==null){var O=r.memoizedProps;if(Lc(O,m)&&r.ref===i.ref)if(bn=!1,i.pendingProps=m=O,eg(r,R))(r.flags&131072)!==0&&(bn=!0);else return i.lanes=r.lanes,ai(r,i,R)}return $m(r,i,c,m,R)}function eb(r,i,c,m){var R=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,R=0;m!==null;)R=R|m.lanes|m.childLanes,m=m.sibling;m=R&~O}else m=0,i.child=null;return tb(r,i,O,c,m)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Pd(i,O!==null?O.cachePool:null),O!==null?r1(i,O):Cm(),s1(i);else return m=i.lanes=536870912,tb(r,i,O!==null?O.baseLanes|c:c,c,m)}else O!==null?(Pd(i,O.cachePool),r1(i,O),Bi(),i.memoizedState=null):(r!==null&&Pd(i,null),Cm(),Bi());return Fn(r,i,R,c),i.child}function Wc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function tb(r,i,c,m,R){var O=vm();return O=O===null?null:{parent:_n._currentValue,pool:O},i.memoizedState={baseLanes:c,cachePool:O},r!==null&&Pd(i,null),Cm(),s1(i),r!==null&&el(r,i,m,!0),i.childLanes=R,null}function Xd(r,i){return i=Zd({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function nb(r,i,c){return zo(i,r.child,null,c),r=Xd(i,i.pendingProps),r.flags|=2,Tr(i),i.memoizedState=null,r}function U5(r,i,c){var m=i.pendingProps,R=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(m.mode==="hidden")return r=Xd(i,m),i.lanes=536870912,Wc(null,r);if(Em(i),(r=Yt)?(r=px(r,Gr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ai!==null?{id:Rs,overflow:ks}:null,retryLane:536870912,hydrationErrors:null},c=zy(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw Mi(i);return i.lanes=536870912,null}return Xd(i,m)}var O=r.memoizedState;if(O!==null){var N=O.dehydrated;if(Em(i),R)if(i.flags&256)i.flags&=-257,i=nb(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||el(r,i,c,!1),R=(c&r.childLanes)!==0,bn||R){if(m=qt,m!==null&&(N=kn(m,c),N!==0&&N!==O.retryLane))throw O.retryLane=N,Oo(r,N),hr(m,r,N),Gm;lf(),i=nb(r,i,c)}else r=O.treeContext,Yt=Kr(N.nextSibling),Hn=i,At=!0,Oi=null,Gr=!1,r!==null&&Fy(i,r),i=Xd(i,m),i.flags|=4096;return i}return r=ti(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Qd(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 $m(r,i,c,m,R){return Io(i),c=km(r,i,c,m,void 0,R),m=Tm(),r!==null&&!bn?(Lm(r,i,R),ai(r,i,R)):(At&&m&&lm(i),i.flags|=1,Fn(r,i,c,R),i.child)}function rb(r,i,c,m,R,O){return Io(i),i.updateQueue=null,c=o1(i,m,c,R),i1(r),m=Tm(),r!==null&&!bn?(Lm(r,i,O),ai(r,i,O)):(At&&m&&lm(i),i.flags|=1,Fn(r,i,c,O),i.child)}function sb(r,i,c,m,R){if(Io(i),i.stateNode===null){var O=Xa,N=c.contextType;typeof N=="object"&&N!==null&&(O=Vn(N)),O=new c(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Wm,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},ym(i),N=c.contextType,O.context=typeof N=="object"&&N!==null?Vn(N):Xa,O.state=i.memoizedState,N=c.getDerivedStateFromProps,typeof N=="function"&&(Um(i,c,N,m),O.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(N=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),N!==O.state&&Wm.enqueueReplaceState(O,O.state,null),zc(i,m,O,R),Bc(),O.state=i.memoizedState),typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(r===null){O=i.stateNode;var Q=i.memoizedProps,ie=Vo(c,Q);O.props=ie;var pe=O.context,we=c.contextType;N=Xa,typeof we=="object"&&we!==null&&(N=Vn(we));var Te=c.getDerivedStateFromProps;we=typeof Te=="function"||typeof O.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,we||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q||pe!==N)&&W1(i,O,m,N),Pi=!1;var ge=i.memoizedState;O.state=ge,zc(i,m,O,R),Bc(),pe=i.memoizedState,Q||ge!==pe||Pi?(typeof Te=="function"&&(Um(i,c,Te,m),pe=i.memoizedState),(ie=Pi||U1(i,c,ie,m,ge,pe,N))?(we||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=pe),O.props=m,O.state=pe,O.context=N,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,bm(r,i),N=i.memoizedProps,we=Vo(c,N),O.props=we,Te=i.pendingProps,ge=O.context,pe=c.contextType,ie=Xa,typeof pe=="object"&&pe!==null&&(ie=Vn(pe)),Q=c.getDerivedStateFromProps,(pe=typeof Q=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(N!==Te||ge!==ie)&&W1(i,O,m,ie),Pi=!1,ge=i.memoizedState,O.state=ge,zc(i,m,O,R),Bc();var ye=i.memoizedState;N!==Te||ge!==ye||Pi||r!==null&&r.dependencies!==null&&Md(r.dependencies)?(typeof Q=="function"&&(Um(i,c,Q,m),ye=i.memoizedState),(we=Pi||U1(i,c,we,m,ge,ye,ie)||r!==null&&r.dependencies!==null&&Md(r.dependencies))?(pe||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"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=ye),O.props=m,O.state=ye,O.context=ie,m=we):(typeof O.componentDidUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&ge===r.memoizedState||(i.flags|=1024),m=!1)}return O=m,Qd(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=zo(i,r.child,null,R),i.child=zo(i,null,c,R)):Fn(r,i,c,R),i.memoizedState=O.state,r=i.child):r=ai(r,i,R),r}function ib(r,i,c,m){return Do(),i.flags|=256,Fn(r,i,c,m),i.child}var Km={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ym(r){return{baseLanes:r,cachePool:Ky()}}function Xm(r,i,c){return r=r!==null?r.childLanes&~c:0,i&&(r|=Ar),r}function ob(r,i,c){var m=i.pendingProps,R=!1,O=(i.flags&128)!==0,N;if((N=O)||(N=r!==null&&r.memoizedState===null?!1:(cn.current&2)!==0),N&&(R=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,r===null){if(At){if(R?Ni(i):Bi(),(r=Yt)?(r=px(r,Gr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ai!==null?{id:Rs,overflow:ks}:null,retryLane:536870912,hydrationErrors:null},c=zy(r),c.return=i,i.child=c,Hn=i,Yt=null)):r=null,r===null)throw Mi(i);return Mg(r)?i.lanes=32:i.lanes=536870912,null}var Q=m.children;return m=m.fallback,R?(Bi(),R=i.mode,Q=Zd({mode:"hidden",children:Q},R),m=Mo(m,R,c,null),Q.return=i,m.return=i,Q.sibling=m,i.child=Q,m=i.child,m.memoizedState=Ym(c),m.childLanes=Xm(r,N,c),i.memoizedState=Km,Wc(null,m)):(Ni(i),Qm(i,Q))}var ie=r.memoizedState;if(ie!==null&&(Q=ie.dehydrated,Q!==null)){if(O)i.flags&256?(Ni(i),i.flags&=-257,i=Zm(r,i,c)):i.memoizedState!==null?(Bi(),i.child=r.child,i.flags|=128,i=null):(Bi(),Q=m.fallback,R=i.mode,m=Zd({mode:"visible",children:m.children},R),Q=Mo(Q,R,c,null),Q.flags|=2,m.return=i,Q.return=i,m.sibling=Q,i.child=m,zo(i,r.child,null,c),m=i.child,m.memoizedState=Ym(c),m.childLanes=Xm(r,N,c),i.memoizedState=Km,i=Wc(null,m));else if(Ni(i),Mg(Q)){if(N=Q.nextSibling&&Q.nextSibling.dataset,N)var pe=N.dgst;N=pe,m=Error(s(419)),m.stack="",m.digest=N,Mc({value:m,source:null,stack:null}),i=Zm(r,i,c)}else if(bn||el(r,i,c,!1),N=(c&r.childLanes)!==0,bn||N){if(N=qt,N!==null&&(m=kn(N,c),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Oo(r,m),hr(N,r,m),Gm;Og(Q)||lf(),i=Zm(r,i,c)}else Og(Q)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,Yt=Kr(Q.nextSibling),Hn=i,At=!0,Oi=null,Gr=!1,r!==null&&Fy(i,r),i=Qm(i,m.children),i.flags|=4096);return i}return R?(Bi(),Q=m.fallback,R=i.mode,ie=r.child,pe=ie.sibling,m=ti(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,pe!==null?Q=ti(pe,Q):(Q=Mo(Q,R,c,null),Q.flags|=2),Q.return=i,m.return=i,m.sibling=Q,i.child=m,Wc(null,m),m=i.child,Q=r.child.memoizedState,Q===null?Q=Ym(c):(R=Q.cachePool,R!==null?(ie=_n._currentValue,R=R.parent!==ie?{parent:ie,pool:ie}:R):R=Ky(),Q={baseLanes:Q.baseLanes|c,cachePool:R}),m.memoizedState=Q,m.childLanes=Xm(r,N,c),i.memoizedState=Km,Wc(r.child,m)):(Ni(i),c=r.child,r=c.sibling,c=ti(c,{mode:"visible",children:m.children}),c.return=i,c.sibling=null,r!==null&&(N=i.deletions,N===null?(i.deletions=[r],i.flags|=16):N.push(r)),i.child=c,i.memoizedState=null,c)}function Qm(r,i){return i=Zd({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Zd(r,i){return r=Rr(22,r,null,i),r.lanes=0,r}function Zm(r,i,c){return zo(i,r.child,null,c),r=Qm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function ab(r,i,c){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),hm(r.return,i,c)}function Jm(r,i,c,m,R,O){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:R,treeForkCount:O}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=c,N.tailMode=R,N.treeForkCount=O)}function lb(r,i,c){var m=i.pendingProps,R=m.revealOrder,O=m.tail;m=m.children;var N=cn.current,Q=(N&2)!==0;if(Q?(N=N&1|2,i.flags|=128):N&=1,Y(cn,N),Fn(r,i,m,c),m=At?Oc:0,!Q&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ab(r,c,i);else if(r.tag===19)ab(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(R){case"forwards":for(c=i.child,R=null;c!==null;)r=c.alternate,r!==null&&Hd(r)===null&&(R=c),c=c.sibling;c=R,c===null?(R=i.child,i.child=null):(R=c.sibling,c.sibling=null),Jm(i,!1,R,c,O,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,R=i.child,i.child=null;R!==null;){if(r=R.alternate,r!==null&&Hd(r)===null){i.child=R;break}r=R.sibling,R.sibling=c,c=R,R=r}Jm(i,!0,c,null,O,m);break;case"together":Jm(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function ai(r,i,c){if(r!==null&&(i.dependencies=r.dependencies),Vi|=i.lanes,(c&i.childLanes)===0)if(r!==null){if(el(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=ti(r,r.pendingProps),i.child=c,c.return=i;r.sibling!==null;)r=r.sibling,c=c.sibling=ti(r,r.pendingProps),c.return=i;c.sibling=null}return i.child}function eg(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Md(r)))}function W5(r,i,c){switch(i.tag){case 3:F(i,i.stateNode.containerInfo),Di(i,_n,r.memoizedState.cache),Do();break;case 27:case 5:ne(i);break;case 4:F(i,i.stateNode.containerInfo);break;case 10:Di(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Em(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(Ni(i),i.flags|=128,null):(c&i.child.childLanes)!==0?ob(r,i,c):(Ni(i),r=ai(r,i,c),r!==null?r.sibling:null);Ni(i);break;case 19:var R=(r.flags&128)!==0;if(m=(c&i.childLanes)!==0,m||(el(r,i,c,!1),m=(c&i.childLanes)!==0),R){if(m)return lb(r,i,c);i.flags|=128}if(R=i.memoizedState,R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),Y(cn,cn.current),m)break;return null;case 22:return i.lanes=0,eb(r,i,c,i.pendingProps);case 24:Di(i,_n,r.memoizedState.cache)}return ai(r,i,c)}function cb(r,i,c){if(r!==null)if(r.memoizedProps!==i.pendingProps)bn=!0;else{if(!eg(r,c)&&(i.flags&128)===0)return bn=!1,W5(r,i,c);bn=(r.flags&131072)!==0}else bn=!1,At&&(i.flags&1048576)!==0&&Vy(i,Oc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=No(i.elementType),i.type=r,typeof r=="function")im(r)?(m=Vo(r,m),i.tag=1,i=sb(null,i,r,m,c)):(i.tag=0,i=$m(null,i,r,m,c));else{if(r!=null){var R=r.$$typeof;if(R===E){i.tag=11,i=Q1(null,i,r,m,c);break e}else if(R===M){i.tag=14,i=Z1(null,i,r,m,c);break e}}throw i=K(r)||r,Error(s(306,i,""))}}return i;case 0:return $m(r,i,i.type,i.pendingProps,c);case 1:return m=i.type,R=Vo(m,i.pendingProps),sb(r,i,m,R,c);case 3:e:{if(F(i,i.stateNode.containerInfo),r===null)throw Error(s(387));m=i.pendingProps;var O=i.memoizedState;R=O.element,bm(r,i),zc(i,m,null,c);var N=i.memoizedState;if(m=N.cache,Di(i,_n,m),m!==O.cache&&pm(i,[_n],c,!0),Bc(),m=N.element,O.isDehydrated)if(O={element:m,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=O,i.memoizedState=O,i.flags&256){i=ib(r,i,m,c);break e}else if(m!==R){R=Ur(Error(s(424)),i),Mc(R),i=ib(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=Kr(r.firstChild),Hn=i,At=!0,Oi=null,Gr=!0,c=e1(i,null,m,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Do(),m===R){i=ai(r,i,c);break e}Fn(r,i,m,c)}i=i.child}return i;case 26:return Qd(r,i),r===null?(c=bx(i.type,null,i.pendingProps,null))?i.memoizedState=c:At||(c=i.type,r=i.pendingProps,m=mf(ee.current).createElement(c),m[pn]=i,m[mn]=r,Un(m,c,r),gn(m),i.stateNode=m):i.memoizedState=bx(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ne(i),r===null&&At&&(m=i.stateNode=vx(i.type,i.pendingProps,ee.current),Hn=i,Gr=!0,R=Yt,Gi(i.type)?(Dg=R,Yt=Kr(m.firstChild)):Yt=R),Fn(r,i,i.pendingProps.children,c),Qd(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((R=m=Yt)&&(m=bL(m,i.type,i.pendingProps,Gr),m!==null?(i.stateNode=m,Hn=i,Yt=Kr(m.firstChild),Gr=!1,R=!0):R=!1),R||Mi(i)),ne(i),R=i.type,O=i.pendingProps,N=r!==null?r.memoizedProps:null,m=O.children,Tg(R,O)?m=null:N!==null&&Tg(R,N)&&(i.flags|=32),i.memoizedState!==null&&(R=km(r,i,I5,null,null,c),iu._currentValue=R),Qd(r,i),Fn(r,i,m,c),i.child;case 6:return r===null&&At&&((r=c=Yt)&&(c=xL(c,i.pendingProps,Gr),c!==null?(i.stateNode=c,Hn=i,Yt=null,r=!0):r=!1),r||Mi(i)),null;case 13:return ob(r,i,c);case 4:return F(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=zo(i,null,m,c):Fn(r,i,m,c),i.child;case 11:return Q1(r,i,i.type,i.pendingProps,c);case 7:return Fn(r,i,i.pendingProps,c),i.child;case 8:return Fn(r,i,i.pendingProps.children,c),i.child;case 12:return Fn(r,i,i.pendingProps.children,c),i.child;case 10:return m=i.pendingProps,Di(i,i.type,m.value),Fn(r,i,m.children,c),i.child;case 9:return R=i.type._context,m=i.pendingProps.children,Io(i),R=Vn(R),m=m(R),i.flags|=1,Fn(r,i,m,c),i.child;case 14:return Z1(r,i,i.type,i.pendingProps,c);case 15:return J1(r,i,i.type,i.pendingProps,c);case 19:return lb(r,i,c);case 31:return U5(r,i,c);case 22:return eb(r,i,c,i.pendingProps);case 24:return Io(i),m=Vn(_n),r===null?(R=vm(),R===null&&(R=qt,O=mm(),R.pooledCache=O,O.refCount++,O!==null&&(R.pooledCacheLanes|=c),R=O),i.memoizedState={parent:m,cache:R},ym(i),Di(i,_n,R)):((r.lanes&c)!==0&&(bm(r,i),zc(i,null,null,c),Bc()),R=r.memoizedState,O=i.memoizedState,R.parent!==m?(R={parent:m,cache:m},i.memoizedState=R,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=R),Di(i,_n,m)):(m=O.cache,Di(i,_n,m),m!==R.cache&&pm(i,[_n],c,!0))),Fn(r,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function li(r){r.flags|=4}function tg(r,i,c,m,R){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(R&335544128)===R)if(r.stateNode.complete)r.flags|=8192;else if(jb())r.flags|=8192;else throw Bo=jd,_m}else r.flags&=-16777217}function ub(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ex(i))if(jb())r.flags|=8192;else throw Bo=jd,_m}function Jd(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ot():536870912,r.lanes|=i,fl|=i)}function qc(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 R=r.child;R!==null;)c|=R.lanes|R.childLanes,m|=R.subtreeFlags&65011712,m|=R.flags&65011712,R.return=r,R=R.sibling;else for(R=r.child;R!==null;)c|=R.lanes|R.childLanes,m|=R.subtreeFlags,m|=R.flags,R.return=r,R=R.sibling;return r.subtreeFlags|=m,r.childLanes=c,i}function q5(r,i,c){var m=i.pendingProps;switch(cm(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),si(_n),se(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Ja(i)?li(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,dm())),Xt(i),null;case 26:var R=i.type,O=i.memoizedState;return r===null?(li(i),O!==null?(Xt(i),ub(i,O)):(Xt(i),tg(i,R,null,m,c))):O?O!==r.memoizedState?(li(i),Xt(i),ub(i,O)):(Xt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&li(i),Xt(i),tg(i,R,r,m,c)),null;case 27:if(re(i),c=ee.current,R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&li(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}r=J.current,Ja(i)?Uy(i):(r=vx(R,m,c),i.stateNode=r,li(i))}return Xt(i),null;case 5:if(re(i),R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&li(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(O=J.current,Ja(i))Uy(i);else{var N=mf(ee.current);switch(O){case 1:O=N.createElementNS("http://www.w3.org/2000/svg",R);break;case 2:O=N.createElementNS("http://www.w3.org/1998/Math/MathML",R);break;default:switch(R){case"svg":O=N.createElementNS("http://www.w3.org/2000/svg",R);break;case"math":O=N.createElementNS("http://www.w3.org/1998/Math/MathML",R);break;case"script":O=N.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?O.multiple=!0:m.size&&(O.size=m.size);break;default:O=typeof m.is=="string"?N.createElement(R,{is:m.is}):N.createElement(R)}}O[pn]=i,O[mn]=m;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)O.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=O;e:switch(Un(O,R,m),R){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&li(i)}}return Xt(i),tg(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,c),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&li(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(r=ee.current,Ja(i)){if(r=i.stateNode,c=i.memoizedProps,m=null,R=Hn,R!==null)switch(R.tag){case 27:case 5:m=R.memoizedProps}r[pn]=i,r=!!(r.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||ox(r.nodeValue,c)),r||Mi(i,!0)}else r=mf(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=Ja(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 Do(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else c=dm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return i.flags&256?(Tr(i),i):(Tr(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(R=Ja(i),m!==null&&m.dehydrated!==null){if(r===null){if(!R)throw Error(s(318));if(R=i.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(s(317));R[pn]=i}else Do(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),R=!1}else R=dm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=R),R=!0;if(!R)return i.flags&256?(Tr(i),i):(Tr(i),null)}return Tr(i),(i.flags&128)!==0?(i.lanes=c,i):(c=m!==null,r=r!==null&&r.memoizedState!==null,c&&(m=i.child,R=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(R=m.alternate.memoizedState.cachePool.pool),O=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(O=m.memoizedState.cachePool.pool),O!==R&&(m.flags|=2048)),c!==r&&c&&(i.child.flags|=8192),Jd(i,i.updateQueue),Xt(i),null);case 4:return se(),r===null&&Cg(i.stateNode.containerInfo),Xt(i),null;case 10:return si(i.type),Xt(i),null;case 19:if(W(cn),m=i.memoizedState,m===null)return Xt(i),null;if(R=(i.flags&128)!==0,O=m.rendering,O===null)if(R)qc(m,!1);else{if(an!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(O=Hd(r),O!==null){for(i.flags|=128,qc(m,!1),r=O.updateQueue,i.updateQueue=r,Jd(i,r),i.subtreeFlags=0,r=c,c=i.child;c!==null;)By(c,r),c=c.sibling;return Y(cn,cn.current&1|2),At&&ni(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&de()>sf&&(i.flags|=128,R=!0,qc(m,!1),i.lanes=4194304)}else{if(!R)if(r=Hd(O),r!==null){if(i.flags|=128,R=!0,r=r.updateQueue,i.updateQueue=r,Jd(i,r),qc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!O.alternate&&!At)return Xt(i),null}else 2*de()-m.renderingStartTime>sf&&c!==536870912&&(i.flags|=128,R=!0,qc(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=de(),r.sibling=null,c=cn.current,Y(cn,R?c&1|2:c&1),At&&ni(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Tr(i),wm(),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&&Jd(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&&W(jo),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),si(_n),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function G5(r,i){switch(cm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return si(_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(Tr(i),i.alternate===null)throw Error(s(340));Do()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Tr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Do()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return W(cn),null;case 4:return se(),null;case 10:return si(i.type),null;case 22:case 23:return Tr(i),wm(),r!==null&&W(jo),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return si(_n),null;case 25:return null;default:return null}}function db(r,i){switch(cm(i),i.tag){case 3:si(_n),se();break;case 26:case 27:case 5:re(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Tr(i);break;case 13:Tr(i);break;case 19:W(cn);break;case 10:si(i.type);break;case 22:case 23:Tr(i),wm(),r!==null&&W(jo);break;case 24:si(_n)}}function Gc(r,i){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var R=m.next;c=R;do{if((c.tag&r)===r){m=void 0;var O=c.create,N=c.inst;m=O(),N.destroy=m}c=c.next}while(c!==R)}}catch(Q){zt(i,i.return,Q)}}function zi(r,i,c){try{var m=i.updateQueue,R=m!==null?m.lastEffect:null;if(R!==null){var O=R.next;m=O;do{if((m.tag&r)===r){var N=m.inst,Q=N.destroy;if(Q!==void 0){N.destroy=void 0,R=i;var ie=c,pe=Q;try{pe()}catch(we){zt(R,ie,we)}}}m=m.next}while(m!==O)}}catch(we){zt(i,i.return,we)}}function fb(r){var i=r.updateQueue;if(i!==null){var c=r.stateNode;try{n1(i,c)}catch(m){zt(r,r.return,m)}}}function hb(r,i,c){c.props=Vo(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(m){zt(r,i,m)}}function $c(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(R){zt(r,i,R)}}function Ts(r,i){var c=r.ref,m=r.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(R){zt(r,i,R)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(R){zt(r,i,R)}else c.current=null}function pb(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(R){zt(r,r.return,R)}}function ng(r,i,c){try{var m=r.stateNode;pL(m,r.type,c,i),m[mn]=i}catch(R){zt(r,r.return,R)}}function mb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Gi(r.type)||r.tag===4}function rg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||mb(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&&Gi(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 sg(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=us));else if(m!==4&&(m===27&&Gi(r.type)&&(c=r.stateNode,i=null),r=r.child,r!==null))for(sg(r,i,c),r=r.sibling;r!==null;)sg(r,i,c),r=r.sibling}function ef(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&&Gi(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(ef(r,i,c),r=r.sibling;r!==null;)ef(r,i,c),r=r.sibling}function gb(r){var i=r.stateNode,c=r.memoizedProps;try{for(var m=r.type,R=i.attributes;R.length;)i.removeAttributeNode(R[0]);Un(i,m,c),i[pn]=r,i[mn]=c}catch(O){zt(r,r.return,O)}}var ci=!1,xn=!1,ig=!1,vb=typeof WeakSet=="function"?WeakSet:Set,jn=null;function $5(r,i){if(r=r.containerInfo,Rg=Sf,r=Ly(r),Zp(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 R=m.anchorOffset,O=m.focusNode;m=m.focusOffset;try{c.nodeType,O.nodeType}catch{c=null;break e}var N=0,Q=-1,ie=-1,pe=0,we=0,Te=r,ge=null;t:for(;;){for(var ye;Te!==c||R!==0&&Te.nodeType!==3||(Q=N+R),Te!==O||m!==0&&Te.nodeType!==3||(ie=N+m),Te.nodeType===3&&(N+=Te.nodeValue.length),(ye=Te.firstChild)!==null;)ge=Te,Te=ye;for(;;){if(Te===r)break t;if(ge===c&&++pe===R&&(Q=N),ge===O&&++we===m&&(ie=N),(ye=Te.nextSibling)!==null)break;Te=ge,ge=Te.parentNode}Te=ye}c=Q===-1||ie===-1?null:{start:Q,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(kg={focusedElem:r,selectionRange:c},Sf=!1,jn=i;jn!==null;)if(i=jn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,jn=r;else for(;jn!==null;){switch(i=jn,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++)R=r[c],R.ref.impl=R.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&O!==null){r=void 0,c=i,R=O.memoizedProps,O=O.memoizedState,m=c.stateNode;try{var Ge=Vo(c.type,R);r=m.getSnapshotBeforeUpdate(Ge,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)Ag(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ag(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,jn=r;break}jn=i.return}}function _b(r,i,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:di(r,c),m&4&&Gc(5,c);break;case 1:if(di(r,c),m&4)if(r=c.stateNode,i===null)try{r.componentDidMount()}catch(N){zt(c,c.return,N)}else{var R=Vo(c.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(R,i,r.__reactInternalSnapshotBeforeUpdate)}catch(N){zt(c,c.return,N)}}m&64&&fb(c),m&512&&$c(c,c.return);break;case 3:if(di(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{n1(r,i)}catch(N){zt(c,c.return,N)}}break;case 27:i===null&&m&4&&gb(c);case 26:case 5:di(r,c),i===null&&m&4&&pb(c),m&512&&$c(c,c.return);break;case 12:di(r,c);break;case 31:di(r,c),m&4&&xb(r,c);break;case 13:di(r,c),m&4&&Sb(r,c),m&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=nL.bind(null,c),SL(r,c))));break;case 22:if(m=c.memoizedState!==null||ci,!m){i=i!==null&&i.memoizedState!==null||xn,R=ci;var O=xn;ci=m,(xn=i)&&!O?fi(r,c,(c.subtreeFlags&8772)!==0):di(r,c),ci=R,xn=O}break;case 30:break;default:di(r,c)}}function yb(r){var i=r.alternate;i!==null&&(r.alternate=null,yb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Ro(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,cr=!1;function ui(r,i,c){for(c=c.child;c!==null;)bb(r,i,c),c=c.sibling}function bb(r,i,c){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(Be,c)}catch{}switch(c.tag){case 26:xn||Ts(c,i),ui(r,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:xn||Ts(c,i);var m=Jt,R=cr;Gi(c.type)&&(Jt=c.stateNode,cr=!1),ui(r,i,c),nu(c.stateNode),Jt=m,cr=R;break;case 5:xn||Ts(c,i);case 6:if(m=Jt,R=cr,Jt=null,ui(r,i,c),Jt=m,cr=R,Jt!==null)if(cr)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&&(cr?(r=Jt,fx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),bl(r)):fx(Jt,c.stateNode));break;case 4:m=Jt,R=cr,Jt=c.stateNode.containerInfo,cr=!0,ui(r,i,c),Jt=m,cr=R;break;case 0:case 11:case 14:case 15:zi(2,c,i),xn||zi(4,c,i),ui(r,i,c);break;case 1:xn||(Ts(c,i),m=c.stateNode,typeof m.componentWillUnmount=="function"&&hb(c,i,m)),ui(r,i,c);break;case 21:ui(r,i,c);break;case 22:xn=(m=xn)||c.memoizedState!==null,ui(r,i,c),xn=m;break;default:ui(r,i,c)}}function xb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{bl(r)}catch(c){zt(i,i.return,c)}}}function Sb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{bl(r)}catch(c){zt(i,i.return,c)}}function K5(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new vb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new vb),i;default:throw Error(s(435,r.tag))}}function tf(r,i){var c=K5(r);i.forEach(function(m){if(!c.has(m)){c.add(m);var R=rL.bind(null,r,m);m.then(R,R)}})}function ur(r,i){var c=i.deletions;if(c!==null)for(var m=0;m<c.length;m++){var R=c[m],O=r,N=i,Q=N;e:for(;Q!==null;){switch(Q.tag){case 27:if(Gi(Q.type)){Jt=Q.stateNode,cr=!1;break e}break;case 5:Jt=Q.stateNode,cr=!1;break e;case 3:case 4:Jt=Q.stateNode.containerInfo,cr=!0;break e}Q=Q.return}if(Jt===null)throw Error(s(160));bb(O,N,R),Jt=null,cr=!1,O=R.alternate,O!==null&&(O.return=null),R.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Cb(i,r),i=i.sibling}var fs=null;function Cb(r,i){var c=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:ur(i,r),dr(r),m&4&&(zi(3,r,r.return),Gc(3,r),zi(5,r,r.return));break;case 1:ur(i,r),dr(r),m&512&&(xn||c===null||Ts(c,c.return)),m&64&&ci&&(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 R=fs;if(ur(i,r),dr(r),m&512&&(xn||c===null||Ts(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,R=R.ownerDocument||R;t:switch(m){case"title":O=R.getElementsByTagName("title")[0],(!O||O[Eo]||O[pn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=R.createElement(m),R.head.insertBefore(O,R.querySelector("head > title"))),Un(O,m,c),O[pn]=r,gn(O),m=O;break e;case"link":var N=Cx("link","href",R).get(m+(c.href||""));if(N){for(var Q=0;Q<N.length;Q++)if(O=N[Q],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)){N.splice(Q,1);break t}}O=R.createElement(m),Un(O,m,c),R.head.appendChild(O);break;case"meta":if(N=Cx("meta","content",R).get(m+(c.content||""))){for(Q=0;Q<N.length;Q++)if(O=N[Q],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)){N.splice(Q,1);break t}}O=R.createElement(m),Un(O,m,c),R.head.appendChild(O);break;default:throw Error(s(468,m))}O[pn]=r,gn(O),m=O}r.stateNode=m}else wx(R,r.type,r.stateNode);else r.stateNode=Sx(R,m,r.memoizedProps);else O!==m?(O===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):O.count--,m===null?wx(R,r.type,r.stateNode):Sx(R,m,r.memoizedProps)):m===null&&r.stateNode!==null&&ng(r,r.memoizedProps,c.memoizedProps)}break;case 27:ur(i,r),dr(r),m&512&&(xn||c===null||Ts(c,c.return)),c!==null&&m&4&&ng(r,r.memoizedProps,c.memoizedProps);break;case 5:if(ur(i,r),dr(r),m&512&&(xn||c===null||Ts(c,c.return)),r.flags&32){R=r.stateNode;try{tt(R,"")}catch(Ge){zt(r,r.return,Ge)}}m&4&&r.stateNode!=null&&(R=r.memoizedProps,ng(r,R,c!==null?c.memoizedProps:R)),m&1024&&(ig=!0);break;case 6:if(ur(i,r),dr(r),m&4){if(r.stateNode===null)throw Error(s(162));m=r.memoizedProps,c=r.stateNode;try{c.nodeValue=m}catch(Ge){zt(r,r.return,Ge)}}break;case 3:if(_f=null,R=fs,fs=gf(i.containerInfo),ur(i,r),fs=R,dr(r),m&4&&c!==null&&c.memoizedState.isDehydrated)try{bl(i.containerInfo)}catch(Ge){zt(r,r.return,Ge)}ig&&(ig=!1,wb(r));break;case 4:m=fs,fs=gf(r.stateNode.containerInfo),ur(i,r),dr(r),fs=m;break;case 12:ur(i,r),dr(r);break;case 31:ur(i,r),dr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,tf(r,m)));break;case 13:ur(i,r),dr(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(rf=de()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,tf(r,m)));break;case 22:R=r.memoizedState!==null;var ie=c!==null&&c.memoizedState!==null,pe=ci,we=xn;if(ci=pe||R,xn=we||ie,ur(i,r),xn=we,ci=pe,dr(r),m&8192)e:for(i=r.stateNode,i._visibility=R?i._visibility&-2:i._visibility|1,R&&(c===null||ie||ci||xn||Fo(r)),c=null,i=r;;){if(i.tag===5||i.tag===26){if(c===null){ie=c=i;try{if(O=ie.stateNode,R)N=O.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{Q=ie.stateNode;var Te=ie.memoizedProps.style,ge=Te!=null&&Te.hasOwnProperty("display")?Te.display:null;Q.style.display=ge==null||typeof ge=="boolean"?"":(""+ge).trim()}}catch(Ge){zt(ie,ie.return,Ge)}}}else if(i.tag===6){if(c===null){ie=i;try{ie.stateNode.nodeValue=R?"":ie.memoizedProps}catch(Ge){zt(ie,ie.return,Ge)}}}else if(i.tag===18){if(c===null){ie=i;try{var ye=ie.stateNode;R?hx(ye,!0):hx(ie.stateNode,!1)}catch(Ge){zt(ie,ie.return,Ge)}}}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,tf(r,c))));break;case 19:ur(i,r),dr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,tf(r,m)));break;case 30:break;case 21:break;default:ur(i,r),dr(r)}}function dr(r){var i=r.flags;if(i&2){try{for(var c,m=r.return;m!==null;){if(mb(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var R=c.stateNode,O=rg(r);ef(r,O,R);break;case 5:var N=c.stateNode;c.flags&32&&(tt(N,""),c.flags&=-33);var Q=rg(r);ef(r,Q,N);break;case 3:case 4:var ie=c.stateNode.containerInfo,pe=rg(r);sg(r,pe,ie);break;default:throw Error(s(161))}}catch(we){zt(r,r.return,we)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function wb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;wb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function di(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_b(r,i.alternate,i),i=i.sibling}function Fo(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:zi(4,i,i.return),Fo(i);break;case 1:Ts(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&hb(i,i.return,c),Fo(i);break;case 27:nu(i.stateNode);case 26:case 5:Ts(i,i.return),Fo(i);break;case 22:i.memoizedState===null&&Fo(i);break;case 30:Fo(i);break;default:Fo(i)}r=r.sibling}}function fi(r,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,R=r,O=i,N=O.flags;switch(O.tag){case 0:case 11:case 15:fi(R,O,c),Gc(4,O);break;case 1:if(fi(R,O,c),m=O,R=m.stateNode,typeof R.componentDidMount=="function")try{R.componentDidMount()}catch(pe){zt(m,m.return,pe)}if(m=O,R=m.updateQueue,R!==null){var Q=m.stateNode;try{var ie=R.shared.hiddenCallbacks;if(ie!==null)for(R.shared.hiddenCallbacks=null,R=0;R<ie.length;R++)t1(ie[R],Q)}catch(pe){zt(m,m.return,pe)}}c&&N&64&&fb(O),$c(O,O.return);break;case 27:gb(O);case 26:case 5:fi(R,O,c),c&&m===null&&N&4&&pb(O),$c(O,O.return);break;case 12:fi(R,O,c);break;case 31:fi(R,O,c),c&&N&4&&xb(R,O);break;case 13:fi(R,O,c),c&&N&4&&Sb(R,O);break;case 22:O.memoizedState===null&&fi(R,O,c),$c(O,O.return);break;case 30:break;default:fi(R,O,c)}i=i.sibling}}function og(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&&Dc(c))}function ag(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Dc(r))}function hs(r,i,c,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Eb(r,i,c,m),i=i.sibling}function Eb(r,i,c,m){var R=i.flags;switch(i.tag){case 0:case 11:case 15:hs(r,i,c,m),R&2048&&Gc(9,i);break;case 1:hs(r,i,c,m);break;case 3:hs(r,i,c,m),R&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Dc(r)));break;case 12:if(R&2048){hs(r,i,c,m),r=i.stateNode;try{var O=i.memoizedProps,N=O.id,Q=O.onPostCommit;typeof Q=="function"&&Q(N,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){zt(i,i.return,ie)}}else hs(r,i,c,m);break;case 31:hs(r,i,c,m);break;case 13:hs(r,i,c,m);break;case 23:break;case 22:O=i.stateNode,N=i.alternate,i.memoizedState!==null?O._visibility&2?hs(r,i,c,m):Kc(r,i):O._visibility&2?hs(r,i,c,m):(O._visibility|=2,cl(r,i,c,m,(i.subtreeFlags&10256)!==0||!1)),R&2048&&og(N,i);break;case 24:hs(r,i,c,m),R&2048&&ag(i.alternate,i);break;default:hs(r,i,c,m)}}function cl(r,i,c,m,R){for(R=R&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var O=r,N=i,Q=c,ie=m,pe=N.flags;switch(N.tag){case 0:case 11:case 15:cl(O,N,Q,ie,R),Gc(8,N);break;case 23:break;case 22:var we=N.stateNode;N.memoizedState!==null?we._visibility&2?cl(O,N,Q,ie,R):Kc(O,N):(we._visibility|=2,cl(O,N,Q,ie,R)),R&&pe&2048&&og(N.alternate,N);break;case 24:cl(O,N,Q,ie,R),R&&pe&2048&&ag(N.alternate,N);break;default:cl(O,N,Q,ie,R)}i=i.sibling}}function Kc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=r,m=i,R=m.flags;switch(m.tag){case 22:Kc(c,m),R&2048&&og(m.alternate,m);break;case 24:Kc(c,m),R&2048&&ag(m.alternate,m);break;default:Kc(c,m)}i=i.sibling}}var Yc=8192;function ul(r,i,c){if(r.subtreeFlags&Yc)for(r=r.child;r!==null;)Rb(r,i,c),r=r.sibling}function Rb(r,i,c){switch(r.tag){case 26:ul(r,i,c),r.flags&Yc&&r.memoizedState!==null&&PL(c,fs,r.memoizedState,r.memoizedProps);break;case 5:ul(r,i,c);break;case 3:case 4:var m=fs;fs=gf(r.stateNode.containerInfo),ul(r,i,c),fs=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=Yc,Yc=16777216,ul(r,i,c),Yc=m):ul(r,i,c));break;default:ul(r,i,c)}}function kb(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 Xc(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];jn=m,Lb(m,r)}kb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Tb(r),r=r.sibling}function Tb(r){switch(r.tag){case 0:case 11:case 15:Xc(r),r.flags&2048&&zi(9,r,r.return);break;case 3:Xc(r);break;case 12:Xc(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,nf(r)):Xc(r);break;default:Xc(r)}}function nf(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];jn=m,Lb(m,r)}kb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:zi(8,i,i.return),nf(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,nf(i));break;default:nf(i)}r=r.sibling}}function Lb(r,i){for(;jn!==null;){var c=jn;switch(c.tag){case 0:case 11:case 15:zi(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:Dc(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,jn=m;else e:for(c=r;jn!==null;){m=jn;var R=m.sibling,O=m.return;if(yb(m),m===c){jn=null;break e}if(R!==null){R.return=O,jn=R;break e}jn=O}}}var Y5={getCacheForType:function(r){var i=Vn(_n),c=i.data.get(r);return c===void 0&&(c=r(),i.data.set(r,c)),c},cacheSignal:function(){return Vn(_n).controller.signal}},X5=typeof WeakMap=="function"?WeakMap:Map,It=0,qt=null,Et=null,Tt=0,Bt=0,Lr=null,Hi=!1,dl=!1,lg=!1,hi=0,an=0,Vi=0,Uo=0,cg=0,Ar=0,fl=0,Qc=null,fr=null,ug=!1,rf=0,Ab=0,sf=1/0,of=null,Fi=null,Tn=0,Ui=null,hl=null,pi=0,dg=0,fg=null,Ob=null,Zc=0,hg=null;function Or(){return(It&2)!==0&&Tt!==0?Tt&-Tt:V.T!==null?yg():Cs()}function Mb(){if(Ar===0)if((Tt&536870912)===0||At){var r=nn;nn<<=1,(nn&3932160)===0&&(nn=262144),Ar=r}else Ar=536870912;return r=kr.current,r!==null&&(r.flags|=32),Ar}function hr(r,i,c){(r===qt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(pl(r,0),Wi(r,Tt,Ar,!1)),bt(r,c),((It&2)===0||r!==qt)&&(r===qt&&((It&2)===0&&(Uo|=c),an===4&&Wi(r,Tt,Ar,!1)),Ls(r))}function Db(r,i,c){if((It&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),R=m?J5(r,i):mg(r,i,!0),O=m;do{if(R===0){dl&&!m&&Wi(r,i,0,!1);break}else{if(c=r.current.alternate,O&&!Q5(c)){R=mg(r,i,!1),O=!1;continue}if(R===2){if(O=i,r.errorRecoveryDisabledLanes&O)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var Q=r;R=Qc;var ie=Q.current.memoizedState.isDehydrated;if(ie&&(pl(Q,N).flags|=256),N=mg(Q,N,!1),N!==2){if(lg&&!ie){Q.errorRecoveryDisabledLanes|=O,Uo|=O,R=4;break e}O=fr,fr=R,O!==null&&(fr===null?fr=O:fr.push.apply(fr,O))}R=N}if(O=!1,R!==2)continue}}if(R===1){pl(r,0),Wi(r,i,0,!0);break}e:{switch(m=r,O=R,O){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Wi(m,i,Ar,!Hi);break e;case 2:fr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(R=rf+300-de(),10<R)){if(Wi(m,i,Ar,!Hi),Ze(m,0,!0)!==0)break e;pi=i,m.timeoutHandle=ux(Pb.bind(null,m,c,fr,of,ug,i,Ar,Uo,fl,Hi,O,"Throttled",-0,0),R);break e}Pb(m,c,fr,of,ug,i,Ar,Uo,fl,Hi,O,null,-0,0)}}break}while(!0);Ls(r)}function Pb(r,i,c,m,R,O,N,Q,ie,pe,we,Te,ge,ye){if(r.timeoutHandle=-1,Te=i.subtreeFlags,Te&8192||(Te&16785408)===16785408){Te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:us},Rb(i,O,Te);var Ge=(O&62914560)===O?rf-de():(O&4194048)===O?Ab-de():0;if(Ge=IL(Te,Ge),Ge!==null){pi=O,r.cancelPendingCommit=Ge(Fb.bind(null,r,i,O,c,m,R,N,Q,ie,we,Te,null,ge,ye)),Wi(r,O,N,!pe);return}}Fb(r,i,O,c,m,R,N,Q,ie)}function Q5(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 R=c[m],O=R.getSnapshot;R=R.value;try{if(!Er(O(),R))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 Wi(r,i,c,m){i&=~cg,i&=~Uo,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var R=i;0<R;){var O=31-at(R),N=1<<O;m[O]=-1,R&=~N}c!==0&&Xe(r,c,i)}function af(){return(It&6)===0?(Jc(0),!1):!0}function pg(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,ri=Po=null,Am(r),sl=null,Ic=0,r=Et;for(;r!==null;)db(r.alternate,r),r=r.return;Et=null}}function pl(r,i){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,vL(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),pi=0,pg(),qt=r,Et=c=ti(r.current,null),Tt=i,Bt=0,Lr=null,Hi=!1,dl=Ot(r,i),lg=!1,fl=Ar=cg=Uo=Vi=an=0,fr=Qc=null,ug=!1,(i&8)!==0&&(i|=i&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=i;0<m;){var R=31-at(m),O=1<<R;i|=r[R],m&=~O}return hi=i,kd(),c}function Ib(r,i){gt=null,V.H=Uc,i===rl||i===Id?(i=Qy(),Bt=3):i===_m?(i=Qy(),Bt=4):Bt=i===Gm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Lr=i,Et===null&&(an=1,Yd(r,Ur(i,r.current)))}function jb(){var r=kr.current;return r===null?!0:(Tt&4194048)===Tt?$r===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===$r:!1}function Nb(){var r=V.H;return V.H=Uc,r===null?Uc:r}function Bb(){var r=V.A;return V.A=Y5,r}function lf(){an=4,Hi||(Tt&4194048)!==Tt&&kr.current!==null||(dl=!0),(Vi&134217727)===0&&(Uo&134217727)===0||qt===null||Wi(qt,Tt,Ar,!1)}function mg(r,i,c){var m=It;It|=2;var R=Nb(),O=Bb();(qt!==r||Tt!==i)&&(of=null,pl(r,i)),i=!1;var N=an;e:do try{if(Bt!==0&&Et!==null){var Q=Et,ie=Lr;switch(Bt){case 8:pg(),N=6;break e;case 3:case 2:case 9:case 6:kr.current===null&&(i=!0);var pe=Bt;if(Bt=0,Lr=null,ml(r,Q,ie,pe),c&&dl){N=0;break e}break;default:pe=Bt,Bt=0,Lr=null,ml(r,Q,ie,pe)}}Z5(),N=an;break}catch(we){Ib(r,we)}while(!0);return i&&r.shellSuspendCounter++,ri=Po=null,It=m,V.H=R,V.A=O,Et===null&&(qt=null,Tt=0,kd()),N}function Z5(){for(;Et!==null;)zb(Et)}function J5(r,i){var c=It;It|=2;var m=Nb(),R=Bb();qt!==r||Tt!==i?(of=null,sf=de()+500,pl(r,i)):dl=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=Lr;t:switch(Bt){case 1:Bt=0,Lr=null,ml(r,i,O,1);break;case 2:case 9:if(Yy(O)){Bt=0,Lr=null,Hb(i);break}i=function(){Bt!==2&&Bt!==9||qt!==r||(Bt=7),Ls(r)},O.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:Yy(O)?(Bt=0,Lr=null,Hb(i)):(Bt=0,Lr=null,ml(r,i,O,7));break;case 5:var N=null;switch(Et.tag){case 26:N=Et.memoizedState;case 5:case 27:var Q=Et;if(N?Ex(N):Q.stateNode.complete){Bt=0,Lr=null;var ie=Q.sibling;if(ie!==null)Et=ie;else{var pe=Q.return;pe!==null?(Et=pe,cf(pe)):Et=null}break t}}Bt=0,Lr=null,ml(r,i,O,5);break;case 6:Bt=0,Lr=null,ml(r,i,O,6);break;case 8:pg(),an=6;break e;default:throw Error(s(462))}}eL();break}catch(we){Ib(r,we)}while(!0);return ri=Po=null,V.H=m,V.A=R,It=c,Et!==null?0:(qt=null,Tt=0,kd(),an)}function eL(){for(;Et!==null&&!Oe();)zb(Et)}function zb(r){var i=cb(r.alternate,r,hi);r.memoizedProps=r.pendingProps,i===null?cf(r):Et=i}function Hb(r){var i=r,c=i.alternate;switch(i.tag){case 15:case 0:i=rb(c,i,i.pendingProps,i.type,void 0,Tt);break;case 11:i=rb(c,i,i.pendingProps,i.type.render,i.ref,Tt);break;case 5:Am(i);default:db(c,i),i=Et=By(i,hi),i=cb(c,i,hi)}r.memoizedProps=r.pendingProps,i===null?cf(r):Et=i}function ml(r,i,c,m){ri=Po=null,Am(i),sl=null,Ic=0;var R=i.return;try{if(F5(r,R,i,c,Tt)){an=1,Yd(r,Ur(c,r.current)),Et=null;return}}catch(O){if(R!==null)throw Et=R,O;an=1,Yd(r,Ur(c,r.current)),Et=null;return}i.flags&32768?(At||m===1?r=!0:dl||(Tt&536870912)!==0?r=!1:(Hi=r=!0,(m===2||m===9||m===3||m===6)&&(m=kr.current,m!==null&&m.tag===13&&(m.flags|=16384))),Vb(i,r)):cf(i)}function cf(r){var i=r;do{if((i.flags&32768)!==0){Vb(i,Hi);return}r=i.return;var c=q5(i.alternate,i,hi);if(c!==null){Et=c;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);an===0&&(an=5)}function Vb(r,i){do{var c=G5(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);an=6,Et=null}function Fb(r,i,c,m,R,O,N,Q,ie){r.cancelPendingCommit=null;do uf();while(Tn!==0);if((It&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=rm,xt(r,c,O,N,Q,ie),r===qt&&(Et=qt=null,Tt=0),hl=i,Ui=r,pi=c,dg=O,fg=R,Ob=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,sL(Ve,function(){return $b(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=V.T,V.T=null,R=G.p,G.p=2,N=It,It|=4;try{$5(r,i,c)}finally{It=N,G.p=R,V.T=m}}Tn=1,Ub(),Wb(),qb()}}function Ub(){if(Tn===1){Tn=0;var r=Ui,i=hl,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=V.T,V.T=null;var m=G.p;G.p=2;var R=It;It|=4;try{Cb(i,r);var O=kg,N=Ly(r.containerInfo),Q=O.focusedElem,ie=O.selectionRange;if(N!==Q&&Q&&Q.ownerDocument&&Ty(Q.ownerDocument.documentElement,Q)){if(ie!==null&&Zp(Q)){var pe=ie.start,we=ie.end;if(we===void 0&&(we=pe),"selectionStart"in Q)Q.selectionStart=pe,Q.selectionEnd=Math.min(we,Q.value.length);else{var Te=Q.ownerDocument||document,ge=Te&&Te.defaultView||window;if(ge.getSelection){var ye=ge.getSelection(),Ge=Q.textContent.length,ut=Math.min(ie.start,Ge),Ut=ie.end===void 0?ut:Math.min(ie.end,Ge);!ye.extend&&ut>Ut&&(N=Ut,Ut=ut,ut=N);var ce=ky(Q,ut),ae=ky(Q,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=Te.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(Te=[],ye=Q;ye=ye.parentNode;)ye.nodeType===1&&Te.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<Te.length;Q++){var ke=Te[Q];ke.element.scrollLeft=ke.left,ke.element.scrollTop=ke.top}}Sf=!!Rg,kg=Rg=null}finally{It=R,G.p=m,V.T=c}}r.current=i,Tn=2}}function Wb(){if(Tn===2){Tn=0;var r=Ui,i=hl,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=V.T,V.T=null;var m=G.p;G.p=2;var R=It;It|=4;try{_b(r,i.alternate,i)}finally{It=R,G.p=m,V.T=c}}Tn=3}}function qb(){if(Tn===4||Tn===3){Tn=0,me();var r=Ui,i=hl,c=pi,m=Ob;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Tn=5:(Tn=0,hl=Ui=null,Gb(r,r.pendingLanes));var R=r.pendingLanes;if(R===0&&(Fi=null),zn(c),i=i.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(Be,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=V.T,R=G.p,G.p=2,V.T=null;try{for(var O=r.onRecoverableError,N=0;N<m.length;N++){var Q=m[N];O(Q.value,{componentStack:Q.stack})}}finally{V.T=i,G.p=R}}(pi&3)!==0&&uf(),Ls(r),R=r.pendingLanes,(c&261930)!==0&&(R&42)!==0?r===hg?Zc++:(Zc=0,hg=r):Zc=0,Jc(0)}}function Gb(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Dc(i)))}function uf(){return Ub(),Wb(),qb(),$b()}function $b(){if(Tn!==5)return!1;var r=Ui,i=dg;dg=0;var c=zn(pi),m=V.T,R=G.p;try{G.p=32>c?32:c,V.T=null,c=fg,fg=null;var O=Ui,N=pi;if(Tn=0,hl=Ui=null,pi=0,(It&6)!==0)throw Error(s(331));var Q=It;if(It|=4,Tb(O.current),Eb(O,O.current,N,c),It=Q,Jc(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(Be,O)}catch{}return!0}finally{G.p=R,V.T=m,Gb(r,i)}}function Kb(r,i,c){i=Ur(c,i),i=qm(r.stateNode,i,2),r=ji(r,i,2),r!==null&&(bt(r,2),Ls(r))}function zt(r,i,c){if(r.tag===3)Kb(r,r,c);else for(;i!==null;){if(i.tag===3){Kb(i,r,c);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Fi===null||!Fi.has(m))){r=Ur(c,r),c=Y1(2),m=ji(i,c,2),m!==null&&(X1(c,m,i,r),bt(m,2),Ls(m));break}}i=i.return}}function gg(r,i,c){var m=r.pingCache;if(m===null){m=r.pingCache=new X5;var R=new Set;m.set(i,R)}else R=m.get(i),R===void 0&&(R=new Set,m.set(i,R));R.has(c)||(lg=!0,R.add(c),r=tL.bind(null,r,i,c),i.then(r,r))}function tL(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&&(an===4||an===3&&(Tt&62914560)===Tt&&300>de()-rf?(It&2)===0&&pl(r,0):cg|=c,fl===Tt&&(fl=0)),Ls(r)}function Yb(r,i){i===0&&(i=ot()),r=Oo(r,i),r!==null&&(bt(r,i),Ls(r))}function nL(r){var i=r.memoizedState,c=0;i!==null&&(c=i.retryLane),Yb(r,c)}function rL(r,i){var c=0;switch(r.tag){case 31:case 13:var m=r.stateNode,R=r.memoizedState;R!==null&&(c=R.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),Yb(r,c)}function sL(r,i){return Ae(r,i)}var df=null,gl=null,vg=!1,ff=!1,_g=!1,qi=0;function Ls(r){r!==gl&&r.next===null&&(gl===null?df=gl=r:gl=gl.next=r),ff=!0,vg||(vg=!0,oL())}function Jc(r,i){if(!_g&&ff){_g=!0;do for(var c=!1,m=df;m!==null;){if(r!==0){var R=m.pendingLanes;if(R===0)var O=0;else{var N=m.suspendedLanes,Q=m.pingedLanes;O=(1<<31-at(42|r)+1)-1,O&=R&~(N&~Q),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(c=!0,Jb(m,O))}else O=Tt,O=Ze(m,m===qt?O:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(O&3)===0||Ot(m,O)||(c=!0,Jb(m,O));m=m.next}while(c);_g=!1}}function iL(){Xb()}function Xb(){ff=vg=!1;var r=0;qi!==0&&gL()&&(r=qi);for(var i=de(),c=null,m=df;m!==null;){var R=m.next,O=Qb(m,i);O===0?(m.next=null,c===null?df=R:c.next=R,R===null&&(gl=c)):(c=m,(r!==0||(O&3)!==0)&&(ff=!0)),m=R}Tn!==0&&Tn!==5||Jc(r),qi!==0&&(qi=0)}function Qb(r,i){for(var c=r.suspendedLanes,m=r.pingedLanes,R=r.expirationTimes,O=r.pendingLanes&-62914561;0<O;){var N=31-at(O),Q=1<<N,ie=R[N];ie===-1?((Q&c)===0||(Q&m)!==0)&&(R[N]=jt(Q,i)):ie<=i&&(r.expiredLanes|=Q),O&=~Q}if(i=qt,c=Tt,c=Ze(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=nt;break;case 32:c=Ve;break;case 268435456:c=Je;break;default:c=Ve}return m=Zb.bind(null,r),c=Ae(c,m),r.callbackPriority=i,r.callbackNode=c,i}return m!==null&&m!==null&&be(m),r.callbackPriority=2,r.callbackNode=null,2}function Zb(r,i){if(Tn!==0&&Tn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(uf()&&r.callbackNode!==c)return null;var m=Tt;return m=Ze(r,r===qt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(Db(r,m,i),Qb(r,de()),r.callbackNode!=null&&r.callbackNode===c?Zb.bind(null,r):null)}function Jb(r,i){if(uf())return null;Db(r,i,!0)}function oL(){_L(function(){(It&6)!==0?Ae(We,iL):Xb()})}function yg(){if(qi===0){var r=tl;r===0&&(r=lt,lt<<=1,(lt&261888)===0&&(lt=256)),qi=r}return qi}function ex(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Js(""+r)}function tx(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 aL(r,i,c,m,R){if(i==="submit"&&c&&c.stateNode===R){var O=ex((R[mn]||null).action),N=m.submitter;N&&(i=(i=N[mn]||null)?ex(i.formAction):N.getAttribute("formAction"),i!==null&&(O=i,N=null));var Q=new Cd("action","action",null,m,R);r.push({event:Q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(qi!==0){var ie=N?tx(R,N):new FormData(R);zm(c,{pending:!0,data:ie,method:R.method,action:O},null,ie)}}else typeof O=="function"&&(Q.preventDefault(),ie=N?tx(R,N):new FormData(R),zm(c,{pending:!0,data:ie,method:R.method,action:O},O,ie))},currentTarget:R}]})}}for(var bg=0;bg<nm.length;bg++){var xg=nm[bg],lL=xg.toLowerCase(),cL=xg[0].toUpperCase()+xg.slice(1);ds(lL,"on"+cL)}ds(My,"onAnimationEnd"),ds(Dy,"onAnimationIteration"),ds(Py,"onAnimationStart"),ds("dblclick","onDoubleClick"),ds("focusin","onFocus"),ds("focusout","onBlur"),ds(E5,"onTransitionRun"),ds(R5,"onTransitionStart"),ds(k5,"onTransitionCancel"),ds(Iy,"onTransitionEnd"),cs("onMouseEnter",["mouseout","mouseover"]),cs("onMouseLeave",["mouseout","mouseover"]),cs("onPointerEnter",["pointerout","pointerover"]),cs("onPointerLeave",["pointerout","pointerover"]),Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="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(" "),uL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function nx(r,i){i=(i&4)!==0;for(var c=0;c<r.length;c++){var m=r[c],R=m.event;m=m.listeners;e:{var O=void 0;if(i)for(var N=m.length-1;0<=N;N--){var Q=m[N],ie=Q.instance,pe=Q.currentTarget;if(Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=pe;try{O(R)}catch(we){Rd(we)}R.currentTarget=null,O=ie}else for(N=0;N<m.length;N++){if(Q=m[N],ie=Q.instance,pe=Q.currentTarget,Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=pe;try{O(R)}catch(we){Rd(we)}R.currentTarget=null,O=ie}}}}function Rt(r,i){var c=i[Sr];c===void 0&&(c=i[Sr]=new Set);var m=r+"__bubble";c.has(m)||(rx(i,r,2,!1),c.add(m))}function Sg(r,i,c){var m=0;i&&(m|=4),rx(c,r,m,i)}var hf="_reactListening"+Math.random().toString(36).slice(2);function Cg(r){if(!r[hf]){r[hf]=!0,tr.forEach(function(c){c!=="selectionchange"&&(uL.has(c)||Sg(c,!1,r),Sg(c,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[hf]||(i[hf]=!0,Sg("selectionchange",!1,i))}}function rx(r,i,c,m){switch(Mx(i)){case 2:var R=BL;break;case 8:R=zL;break;default:R=Bg}c=R.bind(null,i,c,r),R=void 0,!Up||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(R=!0),m?R!==void 0?r.addEventListener(i,c,{capture:!0,passive:R}):r.addEventListener(i,c,!0):R!==void 0?r.addEventListener(i,c,{passive:R}):r.addEventListener(i,c,!1)}function wg(r,i,c,m,R){var O=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var Q=m.stateNode.containerInfo;if(Q===R)break;if(N===4)for(N=m.return;N!==null;){var ie=N.tag;if((ie===3||ie===4)&&N.stateNode.containerInfo===R)return;N=N.return}for(;Q!==null;){if(N=Ys(Q),N===null)return;if(ie=N.tag,ie===5||ie===6||ie===26||ie===27){m=O=N;continue e}Q=Q.parentNode}}m=m.return}ly(function(){var pe=O,we=Vp(c),Te=[];e:{var ge=jy.get(r);if(ge!==void 0){var ye=Cd,Ge=r;switch(r){case"keypress":if(xd(c)===0)break e;case"keydown":case"keyup":ye=r5;break;case"focusin":Ge="focus",ye=$p;break;case"focusout":Ge="blur",ye=$p;break;case"beforeblur":case"afterblur":ye=$p;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=dy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=qT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=o5;break;case My:case Dy:case Py:ye=KT;break;case Iy:ye=l5;break;case"scroll":case"scrollend":ye=UT;break;case"wheel":ye=u5;break;case"copy":case"cut":case"paste":ye=XT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=hy;break;case"toggle":case"beforetoggle":ye=f5}var ut=(i&4)!==0,Ut=!ut&&(r==="scroll"||r==="scrollend"),ce=ut?ge!==null?ge+"Capture":null:ge;ut=[];for(var ae=pe,fe;ae!==null;){var ke=ae;if(fe=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||fe===null||ce===null||(ke=Sc(ae,ce),ke!=null&&ut.push(tu(ae,ke,fe))),Ut)break;ae=ae.return}0<ut.length&&(ge=new ye(ge,Ge,null,c,we),Te.push({event:ge,listeners:ut}))}}if((i&7)===0){e:{if(ge=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",ge&&c!==yd&&(Ge=c.relatedTarget||c.fromElement)&&(Ys(Ge)||Ge[ws]))break e;if((ye||ge)&&(ge=we.window===we?we:(ge=we.ownerDocument)?ge.defaultView||ge.parentWindow:window,ye?(Ge=c.relatedTarget||c.toElement,ye=pe,Ge=Ge?Ys(Ge):null,Ge!==null&&(Ut=u(Ge),ut=Ge.tag,Ge!==Ut||ut!==5&&ut!==27&&ut!==6)&&(Ge=null)):(ye=null,Ge=pe),ye!==Ge)){if(ut=dy,ke="onMouseLeave",ce="onMouseEnter",ae="mouse",(r==="pointerout"||r==="pointerover")&&(ut=hy,ke="onPointerLeave",ce="onPointerEnter",ae="pointer"),Ut=ye==null?ge:ko(ye),fe=Ge==null?ge:ko(Ge),ge=new ut(ke,ae+"leave",ye,c,we),ge.target=Ut,ge.relatedTarget=fe,ke=null,Ys(we)===pe&&(ut=new ut(ce,ae+"enter",Ge,c,we),ut.target=fe,ut.relatedTarget=Ut,ke=ut),Ut=ke,ye&&Ge)t:{for(ut=dL,ce=ye,ae=Ge,fe=0,ke=ce;ke;ke=ut(ke))fe++;ke=0;for(var it=ae;it;it=ut(it))ke++;for(;0<fe-ke;)ce=ut(ce),fe--;for(;0<ke-fe;)ae=ut(ae),ke--;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&&sx(Te,ge,ye,ut,!1),Ge!==null&&Ut!==null&&sx(Te,Ut,Ge,ut,!0)}}e:{if(ge=pe?ko(pe):window,ye=ge.nodeName&&ge.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ge.type==="file")var Mt=xy;else if(yy(ge))if(Sy)Mt=S5;else{Mt=b5;var Qe=y5}else ye=ge.nodeName,!ye||ye.toLowerCase()!=="input"||ge.type!=="checkbox"&&ge.type!=="radio"?pe&&vn(pe.elementType)&&(Mt=xy):Mt=x5;if(Mt&&(Mt=Mt(r,pe))){by(Te,Mt,c,we);break e}Qe&&Qe(r,ge,pe),r==="focusout"&&pe&&ge.type==="number"&&pe.memoizedProps.value!=null&&xc(ge,"number",ge.value)}switch(Qe=pe?ko(pe):window,r){case"focusin":(yy(Qe)||Qe.contentEditable==="true")&&($a=Qe,Jp=pe,Ac=null);break;case"focusout":Ac=Jp=$a=null;break;case"mousedown":em=!0;break;case"contextmenu":case"mouseup":case"dragend":em=!1,Ay(Te,c,we);break;case"selectionchange":if(w5)break;case"keydown":case"keyup":Ay(Te,c,we)}var _t;if(Yp)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 Ga?vy(r,c)&&(Lt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Lt="onCompositionStart");Lt&&(py&&c.locale!=="ko"&&(Ga||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&Ga&&(_t=cy()):(Li=we,Wp="value"in Li?Li.value:Li.textContent,Ga=!0)),Qe=pf(pe,Lt),0<Qe.length&&(Lt=new fy(Lt,r,null,c,we),Te.push({event:Lt,listeners:Qe}),_t?Lt.data=_t:(_t=_y(c),_t!==null&&(Lt.data=_t)))),(_t=p5?m5(r,c):g5(r,c))&&(Lt=pf(pe,"onBeforeInput"),0<Lt.length&&(Qe=new fy("onBeforeInput","beforeinput",null,c,we),Te.push({event:Qe,listeners:Lt}),Qe.data=_t)),aL(Te,r,pe,c,we)}nx(Te,i)})}function tu(r,i,c){return{instance:r,listener:i,currentTarget:c}}function pf(r,i){for(var c=i+"Capture",m=[];r!==null;){var R=r,O=R.stateNode;if(R=R.tag,R!==5&&R!==26&&R!==27||O===null||(R=Sc(r,c),R!=null&&m.unshift(tu(r,R,O)),R=Sc(r,i),R!=null&&m.push(tu(r,R,O))),r.tag===3)return m;r=r.return}return[]}function dL(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function sx(r,i,c,m,R){for(var O=i._reactName,N=[];c!==null&&c!==m;){var Q=c,ie=Q.alternate,pe=Q.stateNode;if(Q=Q.tag,ie!==null&&ie===m)break;Q!==5&&Q!==26&&Q!==27||pe===null||(ie=pe,R?(pe=Sc(c,O),pe!=null&&N.unshift(tu(c,pe,ie))):R||(pe=Sc(c,O),pe!=null&&N.push(tu(c,pe,ie)))),c=c.return}N.length!==0&&r.push({event:i,listeners:N})}var fL=/\r\n?/g,hL=/\u0000|\uFFFD/g;function ix(r){return(typeof r=="string"?r:""+r).replace(fL,`
|
|
10
|
+
`).replace(hL,"")}function ox(r,i){return i=ix(i),ix(r)===i}function Ft(r,i,c,m,R,O){switch(c){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||tt(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&tt(r,""+m);break;case"className":Ri(r,"class",m);break;case"tabIndex":Ri(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(r,c,m);break;case"style":rn(r,m,O);break;case"data":if(i!=="object"){Ri(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=Js(""+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"&&Ft(r,i,"name",R.name,R,null),Ft(r,i,"formEncType",R.formEncType,R,null),Ft(r,i,"formMethod",R.formMethod,R,null),Ft(r,i,"formTarget",R.formTarget,R,null)):(Ft(r,i,"encType",R.encType,R,null),Ft(r,i,"method",R.method,R,null),Ft(r,i,"target",R.target,R,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(c);break}m=Js(""+m),r.setAttribute(c,m);break;case"onClick":m!=null&&(r.onclick=us);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(R.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=Js(""+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),Xs(r,"popover",m);break;case"xlinkActuate":wr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":wr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":wr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":wr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":wr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":wr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":wr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":wr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":wr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Xs(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=Qs.get(c)||c,Xs(r,c,m))}}function Eg(r,i,c,m,R,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(R.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof m=="string"?tt(r,m):(typeof m=="number"||typeof m=="bigint")&&tt(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=us);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"&&(R=c.endsWith("Capture"),i=c.slice(2,R?c.length-7:void 0),O=r[mn]||null,O=O!=null?O[c]:null,typeof O=="function"&&r.removeEventListener(i,O,R),typeof m=="function")){typeof O!="function"&&O!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(i,m,R);break e}c in r?r[c]=m:m===!0?r.setAttribute(c,""):Xs(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,R=!1,O;for(O in c)if(c.hasOwnProperty(O)){var N=c[O];if(N!=null)switch(O){case"src":m=!0;break;case"srcSet":R=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,O,N,c,null)}}R&&Ft(r,i,"srcSet",c.srcSet,c,null),m&&Ft(r,i,"src",c.src,c,null);return;case"input":Rt("invalid",r);var Q=O=N=R=null,ie=null,pe=null;for(m in c)if(c.hasOwnProperty(m)){var we=c[m];if(we!=null)switch(m){case"name":R=we;break;case"type":N=we;break;case"checked":ie=we;break;case"defaultChecked":pe=we;break;case"value":O=we;break;case"defaultValue":Q=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(s(137,i));break;default:Ft(r,i,m,we,c,null)}}vd(r,O,Q,ie,pe,N,R,!1);return;case"select":Rt("invalid",r),m=N=O=null;for(R in c)if(c.hasOwnProperty(R)&&(Q=c[R],Q!=null))switch(R){case"value":O=Q;break;case"defaultValue":N=Q;break;case"multiple":m=Q;default:Ft(r,i,R,Q,c,null)}i=O,c=N,r.multiple=!!m,i!=null?Ti(r,!!m,i,!1):c!=null&&Ti(r,!!m,c,!0);return;case"textarea":Rt("invalid",r),O=R=m=null;for(N in c)if(c.hasOwnProperty(N)&&(Q=c[N],Q!=null))switch(N){case"value":m=Q;break;case"defaultValue":R=Q;break;case"children":O=Q;break;case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(91));break;default:Ft(r,i,N,Q,c,null)}Fe(r,m,R,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":Ft(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<eu.length;m++)Rt(eu[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(pe in c)if(c.hasOwnProperty(pe)&&(m=c[pe],m!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,pe,m,c,null)}return;default:if(vn(i)){for(we in c)c.hasOwnProperty(we)&&(m=c[we],m!==void 0&&Eg(r,i,we,m,c,void 0));return}}for(Q in c)c.hasOwnProperty(Q)&&(m=c[Q],m!=null&&Ft(r,i,Q,m,c,null))}function pL(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 R=null,O=null,N=null,Q=null,ie=null,pe=null,we=null;for(ye in c){var Te=c[ye];if(c.hasOwnProperty(ye)&&Te!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":ie=Te;default:m.hasOwnProperty(ye)||Ft(r,i,ye,null,m,Te)}}for(var ge in m){var ye=m[ge];if(Te=c[ge],m.hasOwnProperty(ge)&&(ye!=null||Te!=null))switch(ge){case"type":O=ye;break;case"name":R=ye;break;case"checked":pe=ye;break;case"defaultChecked":we=ye;break;case"value":N=ye;break;case"defaultValue":Q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:ye!==Te&&Ft(r,i,ge,ye,m,Te)}}bc(r,N,Q,ie,pe,we,O,R);return;case"select":ye=N=Q=ge=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)||Ft(r,i,O,null,m,ie)}for(R in m)if(O=m[R],ie=c[R],m.hasOwnProperty(R)&&(O!=null||ie!=null))switch(R){case"value":ge=O;break;case"defaultValue":Q=O;break;case"multiple":N=O;default:O!==ie&&Ft(r,i,R,O,m,ie)}i=Q,c=N,m=ye,ge!=null?Ti(r,!!c,ge,!1):!!m!=!!c&&(i!=null?Ti(r,!!c,i,!0):Ti(r,!!c,c?[]:"",!1));return;case"textarea":ye=ge=null;for(Q in c)if(R=c[Q],c.hasOwnProperty(Q)&&R!=null&&!m.hasOwnProperty(Q))switch(Q){case"value":break;case"children":break;default:Ft(r,i,Q,null,m,R)}for(N in m)if(R=m[N],O=c[N],m.hasOwnProperty(N)&&(R!=null||O!=null))switch(N){case"value":ge=R;break;case"defaultValue":ye=R;break;case"children":break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:R!==O&&Ft(r,i,N,R,m,O)}_d(r,ge,ye);return;case"option":for(var Ge in c)ge=c[Ge],c.hasOwnProperty(Ge)&&ge!=null&&!m.hasOwnProperty(Ge)&&(Ge==="selected"?r.selected=!1:Ft(r,i,Ge,null,m,ge));for(ie in m)ge=m[ie],ye=c[ie],m.hasOwnProperty(ie)&&ge!==ye&&(ge!=null||ye!=null)&&(ie==="selected"?r.selected=ge&&typeof ge!="function"&&typeof ge!="symbol":Ft(r,i,ie,ge,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)ge=c[ut],c.hasOwnProperty(ut)&&ge!=null&&!m.hasOwnProperty(ut)&&Ft(r,i,ut,null,m,ge);for(pe in m)if(ge=m[pe],ye=c[pe],m.hasOwnProperty(pe)&&ge!==ye&&(ge!=null||ye!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,i));break;default:Ft(r,i,pe,ge,m,ye)}return;default:if(vn(i)){for(var Ut in c)ge=c[Ut],c.hasOwnProperty(Ut)&&ge!==void 0&&!m.hasOwnProperty(Ut)&&Eg(r,i,Ut,void 0,m,ge);for(we in m)ge=m[we],ye=c[we],!m.hasOwnProperty(we)||ge===ye||ge===void 0&&ye===void 0||Eg(r,i,we,ge,m,ye);return}}for(var ce in c)ge=c[ce],c.hasOwnProperty(ce)&&ge!=null&&!m.hasOwnProperty(ce)&&Ft(r,i,ce,null,m,ge);for(Te in m)ge=m[Te],ye=c[Te],!m.hasOwnProperty(Te)||ge===ye||ge==null&&ye==null||Ft(r,i,Te,ge,m,ye)}function ax(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mL(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var R=c[m],O=R.transferSize,N=R.initiatorType,Q=R.duration;if(O&&Q&&ax(N)){for(N=0,Q=R.responseEnd,m+=1;m<c.length;m++){var ie=c[m],pe=ie.startTime;if(pe>Q)break;var we=ie.transferSize,Te=ie.initiatorType;we&&ax(Te)&&(ie=ie.responseEnd,N+=we*(ie<Q?1:(Q-pe)/(ie-pe)))}if(--m,i+=8*(O+N)/(R.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 Rg=null,kg=null;function mf(r){return r.nodeType===9?r:r.ownerDocument}function lx(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 cx(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 Tg(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 Lg=null;function gL(){var r=window.event;return r&&r.type==="popstate"?r===Lg?!1:(Lg=r,!0):(Lg=null,!1)}var ux=typeof setTimeout=="function"?setTimeout:void 0,vL=typeof clearTimeout=="function"?clearTimeout:void 0,dx=typeof Promise=="function"?Promise:void 0,_L=typeof queueMicrotask=="function"?queueMicrotask:typeof dx<"u"?function(r){return dx.resolve(null).then(r).catch(yL)}:ux;function yL(r){setTimeout(function(){throw r})}function Gi(r){return r==="head"}function fx(r,i){var c=i,m=0;do{var R=c.nextSibling;if(r.removeChild(c),R&&R.nodeType===8)if(c=R.data,c==="/$"||c==="/&"){if(m===0){r.removeChild(R),bl(i);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")nu(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,nu(c);for(var O=c.firstChild;O;){var N=O.nextSibling,Q=O.nodeName;O[Eo]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&O.rel.toLowerCase()==="stylesheet"||c.removeChild(O),O=N}}else c==="body"&&nu(r.ownerDocument.body);c=R}while(c);bl(i)}function hx(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 Ag(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":Ag(c),Ro(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function bL(r,i,c,m){for(;r.nodeType===1;){var R=c;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[Eo])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!==R.rel||r.getAttribute("href")!==(R.href==null||R.href===""?null:R.href)||r.getAttribute("crossorigin")!==(R.crossOrigin==null?null:R.crossOrigin)||r.getAttribute("title")!==(R.title==null?null:R.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(O=r.getAttribute("src"),(O!==(R.src==null?null:R.src)||r.getAttribute("type")!==(R.type==null?null:R.type)||r.getAttribute("crossorigin")!==(R.crossOrigin==null?null:R.crossOrigin))&&O&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var O=R.name==null?null:""+R.name;if(R.type==="hidden"&&r.getAttribute("name")===O)return r}else return r;if(r=Kr(r.nextSibling),r===null)break}return null}function xL(r,i,c){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Kr(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=Kr(r.nextSibling),r===null))return null;return r}function Og(r){return r.data==="$?"||r.data==="$~"}function Mg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function SL(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 Kr(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 Dg=null;function mx(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(i===0)return Kr(r.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}r=r.nextSibling}return null}function gx(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 vx(r,i,c){switch(i=mf(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 nu(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Ro(r)}var Yr=new Map,_x=new Set;function gf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var mi=G.d;G.d={f:CL,r:wL,D:EL,C:RL,L:kL,m:TL,X:AL,S:LL,M:OL};function CL(){var r=mi.f(),i=af();return r||i}function wL(r){var i=Es(r);i!==null&&i.tag===5&&i.type==="form"?I1(i):mi.r(r)}var vl=typeof document>"u"?null:document;function yx(r,i,c){var m=vl;if(m&&typeof i=="string"&&i){var R=ar(i);R='link[rel="'+r+'"][href="'+R+'"]',typeof c=="string"&&(R+='[crossorigin="'+c+'"]'),_x.has(R)||(_x.add(R),r={rel:r,crossOrigin:c,href:i},m.querySelector(R)===null&&(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function EL(r){mi.D(r),yx("dns-prefetch",r,null)}function RL(r,i){mi.C(r,i),yx("preconnect",r,i)}function kL(r,i,c){mi.L(r,i,c);var m=vl;if(m&&r&&i){var R='link[rel="preload"][as="'+ar(i)+'"]';i==="image"&&c&&c.imageSrcSet?(R+='[imagesrcset="'+ar(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(R+='[imagesizes="'+ar(c.imageSizes)+'"]')):R+='[href="'+ar(r)+'"]';var O=R;switch(i){case"style":O=_l(r);break;case"script":O=yl(r)}Yr.has(O)||(r=f({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:r,as:i},c),Yr.set(O,r),m.querySelector(R)!==null||i==="style"&&m.querySelector(ru(O))||i==="script"&&m.querySelector(su(O))||(i=m.createElement("link"),Un(i,"link",r),gn(i),m.head.appendChild(i)))}}function TL(r,i){mi.m(r,i);var c=vl;if(c&&r){var m=i&&typeof i.as=="string"?i.as:"script",R='link[rel="modulepreload"][as="'+ar(m)+'"][href="'+ar(r)+'"]',O=R;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=yl(r)}if(!Yr.has(O)&&(r=f({rel:"modulepreload",href:r},i),Yr.set(O,r),c.querySelector(R)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(su(O)))return}m=c.createElement("link"),Un(m,"link",r),gn(m),c.head.appendChild(m)}}}function LL(r,i,c){mi.S(r,i,c);var m=vl;if(m&&r){var R=ls(m).hoistableStyles,O=_l(r);i=i||"default";var N=R.get(O);if(!N){var Q={loading:0,preload:null};if(N=m.querySelector(ru(O)))Q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},c),(c=Yr.get(O))&&Pg(r,c);var ie=N=m.createElement("link");gn(ie),Un(ie,"link",r),ie._p=new Promise(function(pe,we){ie.onload=pe,ie.onerror=we}),ie.addEventListener("load",function(){Q.loading|=1}),ie.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,vf(N,i,m)}N={type:"stylesheet",instance:N,count:1,state:Q},R.set(O,N)}}}function AL(r,i){mi.X(r,i);var c=vl;if(c&&r){var m=ls(c).hoistableScripts,R=yl(r),O=m.get(R);O||(O=c.querySelector(su(R)),O||(r=f({src:r,async:!0},i),(i=Yr.get(R))&&Ig(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(R,O))}}function OL(r,i){mi.M(r,i);var c=vl;if(c&&r){var m=ls(c).hoistableScripts,R=yl(r),O=m.get(R);O||(O=c.querySelector(su(R)),O||(r=f({src:r,async:!0,type:"module"},i),(i=Yr.get(R))&&Ig(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(R,O))}}function bx(r,i,c,m){var R=(R=ee.current)?gf(R):null;if(!R)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=_l(c.href),c=ls(R).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=_l(c.href);var O=ls(R).hoistableStyles,N=O.get(r);if(N||(R=R.ownerDocument||R,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(r,N),(O=R.querySelector(ru(r)))&&!O._p&&(N.instance=O,N.state.loading=5),Yr.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},Yr.set(r,c),O||ML(R,r,c,N.state))),i&&m===null)throw Error(s(528,""));return N}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=yl(c),c=ls(R).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 _l(r){return'href="'+ar(r)+'"'}function ru(r){return'link[rel="stylesheet"]['+r+"]"}function xx(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function ML(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 yl(r){return'[src="'+ar(r)+'"]'}function su(r){return"script[async]"+r}function Sx(r,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+ar(c.href)+'"]');if(m)return i.instance=m,gn(m),m;var R=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",R),vf(m,c.precedence,r),i.instance=m;case"stylesheet":R=_l(c.href);var O=r.querySelector(ru(R));if(O)return i.state.loading|=4,i.instance=O,gn(O),O;m=xx(c),(R=Yr.get(R))&&Pg(m,R),O=(r.ownerDocument||r).createElement("link"),gn(O);var N=O;return N._p=new Promise(function(Q,ie){N.onload=Q,N.onerror=ie}),Un(O,"link",m),i.state.loading|=4,vf(O,c.precedence,r),i.instance=O;case"script":return O=yl(c.src),(R=r.querySelector(su(O)))?(i.instance=R,gn(R),R):(m=c,(R=Yr.get(O))&&(m=f({},c),Ig(m,R)),r=r.ownerDocument||r,R=r.createElement("script"),gn(R),Un(R,"link",m),r.head.appendChild(R),i.instance=R);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,vf(m,c.precedence,r));return i.instance}function vf(r,i,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=m.length?m[m.length-1]:null,O=R,N=0;N<m.length;N++){var Q=m[N];if(Q.dataset.precedence===i)O=Q;else if(O!==R)break}O?O.parentNode.insertBefore(r,O.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(r,i.firstChild))}function Pg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Ig(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var _f=null;function Cx(r,i,c){if(_f===null){var m=new Map,R=_f=new Map;R.set(c,m)}else R=_f,m=R.get(c),m||(m=new Map,R.set(c,m));if(m.has(r))return m;for(m.set(r,null),c=c.getElementsByTagName(r),R=0;R<c.length;R++){var O=c[R];if(!(O[Eo]||O[pn]||r==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var N=O.getAttribute(i)||"";N=r+N;var Q=m.get(N);Q?Q.push(O):m.set(N,[O])}}return m}function wx(r,i,c){r=r.ownerDocument||r,r.head.insertBefore(c,i==="title"?r.querySelector("head > title"):null)}function DL(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 Ex(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function PL(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 R=_l(m.href),O=i.querySelector(ru(R));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=yf.bind(r),i.then(r,r)),c.state.loading|=4,c.instance=O,gn(O);return}O=i.ownerDocument||i,m=xx(m),(R=Yr.get(R))&&Pg(m,R),O=O.createElement("link"),gn(O);var N=O;N._p=new Promise(function(Q,ie){N.onload=Q,N.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=yf.bind(r),i.addEventListener("load",c),i.addEventListener("error",c))}}var jg=0;function IL(r,i){return r.stylesheets&&r.count===0&&xf(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var m=setTimeout(function(){if(r.stylesheets&&xf(r,r.stylesheets),r.unsuspend){var O=r.unsuspend;r.unsuspend=null,O()}},6e4+i);0<r.imgBytes&&jg===0&&(jg=62500*mL());var R=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&xf(r,r.stylesheets),r.unsuspend)){var O=r.unsuspend;r.unsuspend=null,O()}},(r.imgBytes>jg?50:800)+i);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(R)}}:null}function yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var bf=null;function xf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,bf=new Map,i.forEach(jL,r),bf=null,yf.call(r))}function jL(r,i){if(!(i.state.loading&4)){var c=bf.get(r);if(c)var m=c.get(null);else{c=new Map,bf.set(r,c);for(var R=r.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<R.length;O++){var N=R[O];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(c.set(N.dataset.precedence,N),m=N)}m&&c.set(null,m)}R=i.instance,N=R.getAttribute("data-precedence"),O=c.get(N)||m,O===m&&c.set(null,R),c.set(N,R),this.count++,m=yf.bind(this),R.addEventListener("load",m),R.addEventListener("error",m),O?O.parentNode.insertBefore(R,O.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(R,r.firstChild)),i.state.loading|=4}}var iu={$$typeof:b,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function NL(r,i,c,m,R,O,N,Q,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=R,this.onCaughtError=O,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Rx(r,i,c,m,R,O,N,Q,ie,pe,we,Te){return r=new NL(r,i,c,N,ie,pe,we,Te,Q),i=1,O===!0&&(i|=24),O=Rr(3,null,null,i),r.current=O,O.stateNode=r,i=mm(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:c,cache:i},ym(O),r}function kx(r){return r?(r=Xa,r):Xa}function Tx(r,i,c,m,R,O){R=kx(R),m.context===null?m.context=R:m.pendingContext=R,m=Ii(i),m.payload={element:c},O=O===void 0?null:O,O!==null&&(m.callback=O),c=ji(r,m,i),c!==null&&(hr(c,r,i),Nc(c,r,i))}function Lx(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<i?c:i}}function Ng(r,i){Lx(r,i),(r=r.alternate)&&Lx(r,i)}function Ax(r){if(r.tag===13||r.tag===31){var i=Oo(r,67108864);i!==null&&hr(i,r,67108864),Ng(r,67108864)}}function Ox(r){if(r.tag===13||r.tag===31){var i=Or();i=Yn(i);var c=Oo(r,i);c!==null&&hr(c,r,i),Ng(r,i)}}var Sf=!0;function BL(r,i,c,m){var R=V.T;V.T=null;var O=G.p;try{G.p=2,Bg(r,i,c,m)}finally{G.p=O,V.T=R}}function zL(r,i,c,m){var R=V.T;V.T=null;var O=G.p;try{G.p=8,Bg(r,i,c,m)}finally{G.p=O,V.T=R}}function Bg(r,i,c,m){if(Sf){var R=zg(m);if(R===null)wg(r,i,m,Cf,c),Dx(r,m);else if(VL(R,r,i,c,m))m.stopPropagation();else if(Dx(r,m),i&4&&-1<HL.indexOf(r)){for(;R!==null;){var O=Es(R);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var N=vt(O.pendingLanes);if(N!==0){var Q=O;for(Q.pendingLanes|=2,Q.entangledLanes|=2;N;){var ie=1<<31-at(N);Q.entanglements[1]|=ie,N&=~ie}Ls(O),(It&6)===0&&(sf=de()+500,Jc(0))}}break;case 31:case 13:Q=Oo(O,2),Q!==null&&hr(Q,O,2),af(),Ng(O,2)}if(O=zg(m),O===null&&wg(r,i,m,Cf,c),O===R)break;R=O}R!==null&&m.stopPropagation()}else wg(r,i,m,null,c)}}function zg(r){return r=Vp(r),Hg(r)}var Cf=null;function Hg(r){if(Cf=null,r=Ys(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 Cf=r,null}function Mx(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(xe()){case We:return 2;case nt:return 8;case Ve:case rt:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Vg=!1,$i=null,Ki=null,Yi=null,ou=new Map,au=new Map,Xi=[],HL="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 Dx(r,i){switch(r){case"focusin":case"focusout":$i=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":Yi=null;break;case"pointerover":case"pointerout":ou.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":au.delete(i.pointerId)}}function lu(r,i,c,m,R,O){return r===null||r.nativeEvent!==O?(r={blockedOn:i,domEventName:c,eventSystemFlags:m,nativeEvent:O,targetContainers:[R]},i!==null&&(i=Es(i),i!==null&&Ax(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,R!==null&&i.indexOf(R)===-1&&i.push(R),r)}function VL(r,i,c,m,R){switch(i){case"focusin":return $i=lu($i,r,i,c,m,R),!0;case"dragenter":return Ki=lu(Ki,r,i,c,m,R),!0;case"mouseover":return Yi=lu(Yi,r,i,c,m,R),!0;case"pointerover":var O=R.pointerId;return ou.set(O,lu(ou.get(O)||null,r,i,c,m,R)),!0;case"gotpointercapture":return O=R.pointerId,au.set(O,lu(au.get(O)||null,r,i,c,m,R)),!0}return!1}function Px(r){var i=Ys(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,Ha(r.priority,function(){Ox(c)});return}}else if(i===31){if(i=a(c),i!==null){r.blockedOn=i,Ha(r.priority,function(){Ox(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 wf(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var c=zg(r.nativeEvent);if(c===null){c=r.nativeEvent;var m=new c.constructor(c.type,c);yd=m,c.target.dispatchEvent(m),yd=null}else return i=Es(c),i!==null&&Ax(i),r.blockedOn=c,!1;i.shift()}return!0}function Ix(r,i,c){wf(r)&&c.delete(i)}function FL(){Vg=!1,$i!==null&&wf($i)&&($i=null),Ki!==null&&wf(Ki)&&(Ki=null),Yi!==null&&wf(Yi)&&(Yi=null),ou.forEach(Ix),au.forEach(Ix)}function Ef(r,i){r.blockedOn===i&&(r.blockedOn=null,Vg||(Vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FL)))}var Rf=null;function jx(r){Rf!==r&&(Rf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rf===r&&(Rf=null);for(var i=0;i<r.length;i+=3){var c=r[i],m=r[i+1],R=r[i+2];if(typeof m!="function"){if(Hg(m||c)===null)continue;break}var O=Es(c);O!==null&&(r.splice(i,3),i-=3,zm(O,{pending:!0,data:R,method:c.method,action:m},m,R))}}))}function bl(r){function i(ie){return Ef(ie,r)}$i!==null&&Ef($i,r),Ki!==null&&Ef(Ki,r),Yi!==null&&Ef(Yi,r),ou.forEach(i),au.forEach(i);for(var c=0;c<Xi.length;c++){var m=Xi[c];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Xi.length&&(c=Xi[0],c.blockedOn===null);)Px(c),c.blockedOn===null&&Xi.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var R=c[m],O=c[m+1],N=R[mn]||null;if(typeof O=="function")N||jx(c);else if(N){var Q=null;if(O&&O.hasAttribute("formAction")){if(R=O,N=O[mn]||null)Q=N.formAction;else if(Hg(R)!==null)continue}else Q=N.action;typeof Q=="function"?c[m+1]=Q:(c.splice(m,3),m-=3),jx(c)}}}function Nx(){function r(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(N){return R=N})},focusReset:"manual",scroll:"manual"})}function i(){R!==null&&(R(),R=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,R=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),R!==null&&(R(),R=null)}}}function Fg(r){this._internalRoot=r}kf.prototype.render=Fg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=Or();Tx(c,m,r,i,null,null)},kf.prototype.unmount=Fg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Tx(r.current,2,null,r,null,null),af(),i[ws]=null}};function kf(r){this._internalRoot=r}kf.prototype.unstable_scheduleHydration=function(r){if(r){var i=Cs();r={blockedOn:null,target:r,priority:i};for(var c=0;c<Xi.length&&i!==0&&i<Xi[c].priority;c++);Xi.splice(c,0,r),c===0&&Px(r)}};var Bx=t.version;if(Bx!=="19.2.3")throw Error(s(527,Bx,"19.2.3"));G.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 UL={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tf.isDisabled&&Tf.supportsFiber)try{Be=Tf.inject(UL),Re=Tf}catch{}}return uu.createRoot=function(r,i){if(!o(r))throw Error(s(299));var c=!1,m="",R=q1,O=G1,N=$1;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(R=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Rx(r,1,!1,null,null,c,m,null,R,O,N,Nx),r[ws]=i.current,Cg(r),new Fg(i)},uu.hydrateRoot=function(r,i,c){if(!o(r))throw Error(s(299));var m=!1,R="",O=q1,N=G1,Q=$1,ie=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(R=c.identifierPrefix),c.onUncaughtError!==void 0&&(O=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(Q=c.onRecoverableError),c.formState!==void 0&&(ie=c.formState)),i=Rx(r,1,!0,i,c??null,m,R,ie,O,N,Q,Nx),i.context=kx(null),c=i.current,m=Or(),m=Yn(m),R=Ii(m),R.callback=null,ji(c,R,m),c=m,i.current.lanes=c,bt(i,c),Ls(i),r[ws]=i.current,Cg(r),new kf(i)},uu.version="19.2.3",uu}var Kx;function JL(){if(Kx)return qg.exports;Kx=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=ZL(),qg.exports}var eA=JL();const Hv=new WeakMap,tA=new WeakMap,gh={current:[]};let Yg=!1,Eu=0;const xu=new Set,Lf=new Map;function Pw(e){for(const t of e){if(gh.current.includes(t))continue;gh.current.push(t),t.recompute();const n=tA.get(t);if(n)for(const s of n){const o=Hv.get(s);o?.length&&Pw(o)}}}function nA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function rA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Iw(e){if(Eu>0&&!Lf.has(e)&&Lf.set(e,e.prevState),xu.add(e),!(Eu>0)&&!Yg)try{for(Yg=!0;xu.size>0;){const t=Array.from(xu);xu.clear();for(const n of t){const s=Lf.get(n)??n.prevState;n.prevState=s,nA(n)}for(const n of t){const s=Hv.get(n);s&&(gh.current.push(n),Pw(s))}for(const n of t){const s=Hv.get(n);if(s)for(const o of s)rA(o)}}}finally{Yg=!1,gh.current=[],Lf.clear()}}function Ru(e){Eu++;try{e()}finally{if(Eu--,Eu===0){const t=xu.values().next().value;t&&Iw(t)}}}function sA(e){return typeof e=="function"}let iA=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):sA(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Iw(this)}};const oo="__TSR_index",Yx="popstate",Xx="beforeunload";function oA(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 x=vh(l.path,l.state);if(await g.blockerFn({currentLocation:t,nextLocation:x,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[oo];a=Qx(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[oo];a=Qx(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[oo]!==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 Qx(e,t){t||(t={});const n=M_();return{...t,key:n,__TSR_key:n,[oo]:e}}function aA(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=(()=>vh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=M_();t.history.replaceState({[oo]:0,key:L,__TSR_key:L},"")}let d=l(),p,f=!1,g=!1,x=!1,C=!1;const w=()=>d;let _,y;const v=()=>{_&&(M._ignoreSubscribers=!0,(_.isPush?t.history.pushState:t.history.replaceState)(_.state,"",_.href),M._ignoreSubscribers=!1,_=void 0,y=void 0,p=void 0)},b=(L,D,H)=>{const z=a(D);y||(p=d),d=vh(D,H),_={href:z,state:H,isPush:_?.isPush||L==="push"},y||(y=Promise.resolve().then(()=>v()))},E=L=>{d=l(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=l(),D=L.state[oo]-d.state[oo],H=D===1,z=D===-1,q=!H&&!z||f;f=!1;const j=q?"GO":z?"BACK":"FORWARD",K=q?{type:"GO",index:D}:{type:z?"BACK":"FORWARD"};if(x)x=!1;else{const $=u();if(typeof document<"u"&&$.length){for(const V of $)if(await V.blockerFn({currentLocation:d,nextLocation:L,action:j})){g=!0,t.history.go(1),M.notify(K);return}}}d=l(),M.notify(K)},A=L=>{if(C){C=!1;return}let D=!1;const H=u();if(typeof document<"u"&&H.length)for(const z of H){const q=z.enableBeforeUnload??!0;if(q===!0){D=!0;break}if(typeof q=="function"&&q()===!0){D=!0;break}}if(D)return L.preventDefault(),L.returnValue=""},M=oA({getLocation:w,getLength:()=>t.history.length,pushState:(L,D)=>b("push",L,D),replaceState:(L,D)=>b("replace",L,D),back:L=>(L&&(x=!0),C=!0,t.history.back()),forward:L=>{L&&(x=!0),C=!0,t.history.forward()},go:L=>{f=!0,t.history.go(L)},createHref:L=>a(L),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(Xx,A,{capture:!0}),t.removeEventListener(Yx,T)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:u,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener(Xx,A,{capture:!0}),t.addEventListener(Yx,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 vh(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=M_();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||{[oo]:0,key:o,__TSR_key:o}}}function M_(){return(Math.random()+1).toString(36).substring(7)}function _h(e){return e[e.length-1]}function lA(e){return typeof e=="function"}function to(e,t){return lA(e)?e(t):e}const cA=Object.prototype.hasOwnProperty;function Zr(e,t){if(e===t)return e;const n=t,s=eS(e)&&eS(n);if(!s&&!(yh(e)&&yh(n)))return n;const o=s?e:Zx(e);if(!o)return n;const u=s?n:Zx(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],x=n[f];if(g===x){l[f]=g,(s?p<h:cA.call(e,f))&&d++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){l[f]=x;continue}const C=Zr(g,x);l[f]=C,C===g&&d++}return h===a&&d===h?e:l}function Zx(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 yh(e){if(!Jx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Jx(n)||!n.hasOwnProperty("isPrototypeOf"))}function Jx(e){return Object.prototype.toString.call(e)==="[object Object]"}function eS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ca(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(!ca(e[s],t[s],n))return!1;return!0}if(yh(e)&&yh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const h in t)if((!s||t[h]!==void 0)&&!ca(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||!ca(e[h],t[h],n)))return!1;return o===u}return!1}function zl(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 ao(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function tS(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function nS(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,o="",u;for(;(u=n.exec(e))!==null;)o+=tS(e.slice(s,u.index))+u[0],s=n.lastIndex;return o+tS(s?e.slice(s):e)}var uA="Invariant failed";function yi(e,t){if(!e)throw new Error(uA)}function bh(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 Hl=0,ya=1,ba=2,Mu=3,dA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,fA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,hA=/^([^{]*)\{\$\}([^}]*)$/;function D_(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]=Hl,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]=ba,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=ya,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const h=u.match(hA);if(h){const p=h[1].length;return n[0]=ba,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(fA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=Mu,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(dA);if(l){const d=l[1],p=l[2],f=l[3],g=d.length;return n[0]=ya,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]=Hl,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function tp(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=D_(l,a,t);let g;const x=a,C=f[5];switch(a=C+1,u++,f[0]){case Hl:{const _=l.substring(f[2],f[3]);if(p){const y=o.static?.get(_);if(y)g=y;else{o.static??=new Map;const v=Du(n.fullPath??n.from);v.parent=o,v.depth=u,g=v,o.static.set(_,v)}}else{const y=_.toLowerCase(),v=o.staticInsensitive?.get(y);if(v)g=v;else{o.staticInsensitive??=new Map;const b=Du(n.fullPath??n.from);b.parent=o,b.depth=u,g=b,o.staticInsensitive.set(y,b)}}break}case ya:{const _=l.substring(x,f[1]),y=l.substring(f[4],C),v=p&&!!(_||y),b=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===v&&A.prefix===b&&A.suffix===E);if(T)g=T;else{const A=Qg(ya,n.fullPath??n.from,v,b,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case Mu:{const _=l.substring(x,f[1]),y=l.substring(f[4],C),v=p&&!!(_||y),b=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===v&&A.prefix===b&&A.suffix===E);if(T)g=T;else{const A=Qg(Mu,n.fullPath??n.from,v,b,E);g=A,A.parent=o,A.depth=u,o.optional??=[],o.optional.push(A)}break}case ba:{const _=l.substring(x,f[1]),y=l.substring(f[4],C),v=p&&!!(_||y),b=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=Qg(ba,n.fullPath??n.from,v,b,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)tp(e,t,l,a,o,u,h)}function Xg(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 Qo(e){if(e.static)for(const t of e.static.values())Qo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Qo(t);if(e.dynamic?.length){e.dynamic.sort(Xg);for(const t of e.dynamic)Qo(t)}if(e.optional?.length){e.optional.sort(Xg);for(const t of e.optional)Qo(t)}if(e.wildcard?.length){e.wildcard.sort(Xg);for(const t of e.wildcard)Qo(t)}}function Du(e){return{kind:Hl,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Qg(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 pA(e,t){const n=Du("/"),s=new Uint16Array(6);for(const o of e)tp(!1,s,o,1,n,0);Qo(n),t.masksTree=n,t.flatCache=bh(1e3)}function mA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=P_(e,t.masksTree);return t.flatCache.set(e,s),s}function gA(e,t,n,s,o){e||="/",s||="/";const u=t?`case\0${e}`:e;let h=o.singleCache.get(u);if(!h){h=Du("/");const a=new Uint16Array(6);tp(t,a,{from:e},1,h,0),o.singleCache.set(u,h)}return P_(s,h,n)}function vA(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=P_(e,t.segmentTree,n);return u&&(u.branch=xA(u.route)),t.matchCache.set(s,u),u}function _A(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function yA(e,t=!1,n){const s=Du(e.fullPath),o=new Uint16Array(6),u={},h={};let a=0;return tp(t,o,e,1,s,0,d=>{if(n?.(d,a),yi(!(d.id in u),`Duplicate routes found with id: ${String(d.id)}`),u[d.id]=d,a!==0&&d.path){const p=_A(d.fullPath);(!h[p]||d.fullPath.endsWith("/"))&&(h[p]=d)}a++}),Qo(s),{processedTree:{segmentTree:s,singleCache:bh(1e3),matchCache:bh(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:h}}function P_(e,t,n=!1){const s=e.split("/"),o=CA(e,s,t,n);if(!o)return null;const u=bA(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function bA(e,t,n){const s=SA(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===ya){o??=n.node.fullPath.split("/");const g=o[a],x=d.prefix?.length??0;if(g.charCodeAt(x)===123){const w=d.suffix?.length??0,_=g.substring(x+2,g.length-w-1),y=p.substring(x,p.length-w);u[_]=decodeURIComponent(y)}else{const w=g.substring(1);u[w]=decodeURIComponent(p)}}else if(d.kind===Mu){if(n.skipped&1<<a){h--;continue}o??=n.node.fullPath.split("/");const g=o[a],x=d.prefix?.length??0,C=d.suffix?.length??0,w=g.substring(x+3,g.length-C-1),_=d.suffix||d.prefix?p.substring(x,p.length-C):p;_&&(u[w]=decodeURIComponent(_))}else if(d.kind===ba){const g=d,x=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),C=decodeURIComponent(x);u["*"]=C,u._splat=C;break}}return u}function xA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function SA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function CA(e,t,n,s){const o=!_h(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:x,skipped:C,depth:w,statics:_,dynamics:y,optionals:v}=f;s&&g.notFound&&Af(d,f)&&(d=f);const b=x===h;if(b){if(g.route&&(!u||g.isIndex)&&(Af(p,f)&&(p=f),_===h&&g.isIndex))return p;if(!g.optional&&!g.wildcard)continue}const E=b?void 0:t[x];let T;if(g.wildcard&&Af(l,f))for(const A of g.wildcard){const{prefix:M,suffix:L}=A;if(!(M&&(b||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(b)continue;const D=t.slice(x).join("/").slice(-L.length);if((A.caseSensitive?D:D.toLowerCase())!==L)continue}l={node:A,index:x,skipped:C,depth:w,statics:_,dynamics:y,optionals:v};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:x,skipped:A,depth:M,statics:_,dynamics:y,optionals:v})}if(!b)for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L],{prefix:H,suffix:z}=D;if(H||z){const q=D.caseSensitive?E:T??=E.toLowerCase();if(H&&!q.startsWith(H)||z&&!q.endsWith(z))continue}a.push({node:D,index:x+1,skipped:C,depth:M,statics:_,dynamics:y,optionals:v+1})}}if(!b&&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 H=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!H.startsWith(L)||D&&!H.endsWith(D))continue}a.push({node:M,index:x+1,skipped:C,depth:w+1,statics:_,dynamics:y+1,optionals:v})}if(!b&&g.staticInsensitive){const A=g.staticInsensitive.get(T??=E.toLowerCase());A&&a.push({node:A,index:x+1,skipped:C,depth:w+1,statics:_+1,dynamics:y,optionals:v})}if(!b&&g.static){const A=g.static.get(E);A&&a.push({node:A,index:x+1,skipped:C,depth:w+1,statics:_+1,dynamics:y,optionals:v})}}if(p&&l)return Af(l,p)?p:l;if(p)return p;if(l)return l;if(s&&d){let f=d.index;for(let x=0;x<d.index;x++)f+=t[x].length;const g=f===e.length?"/":e.slice(f);return{node:d.node,skipped:d.skipped,"**":decodeURIComponent(g)}}return null}function Af(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 lh(e){return I_(e.filter(t=>t!==void 0).join("/"))}function I_(e){return e.replace(/\/{2,}/g,"/")}function jw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ua(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Nw(e){return ua(jw(e))}function xh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function wA(e,t,n){return xh(e,n)===xh(t,n)}function EA({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&&_h(a)==="";)a.pop();const f=t.split("/");for(let g=0,x=f.length;g<x;g++){const C=f[g];C===""?g?g===x-1&&a.push(C):a=[C]:C===".."?a.pop():C==="."||a.push(C)}}a.length>1&&(_h(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=D_(g,0,l);const x=l[0];if(x===Hl){d+=g;continue}const C=l[5],w=g.substring(0,l[1]),_=g.substring(l[4],C),y=g.substring(l[2],l[3]);x===ya?d+=w||_?`${w}{$${y}}${_}`:`$${y}`:x===ba?d+=w||_?`${w}{$}${_}`:"$":d+=`${w}{-$${y}}${_}`}d=I_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function Zg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):RA(s,n)}function Jg({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=D_(e,p,a);const f=a[5];if(h=f+1,p===f)continue;const g=a[0];if(g===Hl){l+="/"+e.substring(p,f);continue}if(g===ba){const x=t._splat;o._splat=x,o["*"]=x;const C=e.substring(p,a[1]),w=e.substring(a[4],f);if(!x){s=!0,(C||w)&&(l+="/"+C+w);continue}const _=Zg("_splat",t,n);l+="/"+C+_+w;continue}if(g===ya){const x=e.substring(a[2],a[3]);!s&&!(x in t)&&(s=!0),o[x]=t[x];const C=e.substring(p,a[1]),w=e.substring(a[4],f),_=Zg(x,t,n)??"undefined";l+="/"+C+_+w;continue}if(g===Mu){const x=e.substring(a[2],a[3]),C=t[x];if(C==null)continue;o[x]=C;const w=e.substring(p,a[1]),_=e.substring(a[4],f),y=Zg(x,t,n)??"";l+="/"+w+y+_;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function RA(e,t){let n=encodeURIComponent(e);if(t)for(const[s,o]of t)n=n.replaceAll(s,o);return n}function rs(e){return!!e?.isNotFound}function kA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Sh="tsr-scroll-restoration-v1_3",TA=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function LA(){const e=kA();if(!e)return null;const t=e.getItem(Sh);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=to(s,n)||n,e.setItem(Sh,JSON.stringify(n)))}}const Of=LA(),Vv=e=>e.state.__TSR_key||e.href;function AA(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 Ch=!1;function Bw({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];Ch=!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 x=document.querySelector(f);x&&(x.scrollLeft=g.scrollX,x.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)}}Ch=!1}function OA(e,t){if(!Of&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Of))return;e.isScrollRestorationSetup=!0,Ch=!1;const s=e.options.getScrollRestorationKey||Vv;window.history.scrollRestoration="manual";const o=u=>{if(Ch||!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=AA(u.target)}const a=s(e.state.location);Of.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",TA(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})||(Bw({storageKey:Sh,key:h,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Of.set(a=>(a[h]||={},a)))})}function MA(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 DA(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 ev(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function PA(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=ev(o):Array.isArray(u)?u.push(ev(o)):n[s]=[u,ev(o)]}return n}const IA=NA(JSON.parse),jA=BA(JSON.stringify,JSON.parse);function NA(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=PA(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function BA(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=DA(o,s);return u?`?${u}`:""}}const Dr="__root__";function zw(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 vs(e){return e instanceof Response&&!!e.options}const ch=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},np=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),j_=(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},Hw=(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),yi(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);yi(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,Hw(e,t))},no=(e,t,n)=>{if(!(!vs(n)&&!rs(n))){if(vs(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=vs(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,isFetching:!1,error:n})),rs(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw vs(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Hw(e,n),n)}},Vw=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},du=(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,no(e,e.router.getMatch(o),n);try{h.options.onError?.(n)}catch(a){n=a,no(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}))},zA=(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===Dr;return}if(h?.ssr===!1){o.ssr=!1;return}const a=x=>x===!0&&h?.ssr==="data-only"?"data-only":x,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:Mf(d,o.searchError),params:Mf(p,o.paramsError),location:e.location,matches:e.matches.map(x=>({index:x.index,pathname:x.pathname,fullPath:x.fullPath,staticData:x.staticData,id:x.id,routeId:x.routeId,search:Mf(x.search,x.searchError),params:Mf(x.params,x.paramsError),ssr:x.ssr}))},g=s.options.ssr(f);if(ao(g))return g.then(x=>{o.ssr=a(x??l)});o.ssr=a(g??l)},Fw=(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&&!np(e,t)&&(n.options.loader||n.options.beforeLoad||qw(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{ch(e)},o);s._nonReactive.pendingTimeout=h}},HA=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Fw(e,t,n,s);const o=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&no(e,u,u.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},VA=(e,t,n,s)=>{const o=e.router.getMatch(t),u=o._nonReactive.loadPromise;o._nonReactive.loadPromise=zl(()=>{u?.resolve()});const{paramsError:h,searchError:a}=o;h&&du(e,n,h,"PARSE_PARAMS"),a&&du(e,n,a,"VALIDATE_SEARCH"),Fw(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})))},x=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!s.options.beforeLoad){Ru(()=>{g(),x()});return}o._nonReactive.beforeLoadPromise=zl();const C={...j_(e,n,!1),...o.__routeContext},{search:w,params:_,cause:y}=o,v=np(e,t),b={search:w,abortController:l,params:_,preload:v,context:C,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":y,matches:e.matches,...e.router.options.additionalContext},E=A=>{if(A===void 0){Ru(()=>{g(),x()});return}(vs(A)||rs(A))&&(g(),du(e,n,A,"BEFORE_LOAD")),Ru(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:A})),x()})};let T;try{if(T=s.options.beforeLoad(b),ao(T))return g(),T.catch(A=>{du(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){g(),du(e,n,A,"BEFORE_LOAD")}E(T)},FA=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const l=zA(e,n,t,o);if(ao(l))return l.then(a)}return a()},h=()=>VA(e,n,t,o),a=()=>{if(Vw(e,n))return;const l=HA(e,n,o);return ao(l)?l.then(h):h()};return u()},ku=(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}})},Uw=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:l}=e.router.getMatch(t),d=j_(e,n),p=np(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}},rS=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!e.router.isServer||o.ssr===!0)&&Ww(s);const u=s.options.loader?.(Uw(e,t,n,s)),h=s.options.loader&&ao(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;no(e,e.router.getMatch(t),f),f!==void 0&&e.updateMatch(t,g=>({...g,loaderData:f}))}s._lazyPromise&&await s._lazyPromise;const l=ku(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,rs(u)&&await s.options.notFoundComponent?.preload?.(),no(e,e.router.getMatch(t),u);try{s.options.onError?.(u)}catch(p){h=p,no(e,e.router.getMatch(t),p)}const l=ku(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=ku(e,t,s);if(h){const a=await h;e.updateMatch(t,l=>({...l,...a}))}u._nonReactive.loaderPromise=void 0}no(e,u,o)}},UA=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:j_(e,t)}))};if(Vw(e,n)){if(e.router.isServer){const p=ku(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&&no(e,f,g)}else{const f=Date.now()-p.updatedAt,g=np(e,n),x=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(Uw(e,n,t,h)):C,_=!!g&&!e.router.state.matches.some(E=>E.id===n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=zl(),_!==y.preload&&e.updateMatch(n,E=>({...E,preload:_}));const{status:v,invalid:b}=y;if(o=v==="success"&&(b||(w??f>x)),!(g&&h.options.preload===!1))if(o&&!e.sync)u=!0,(async()=>{try{await rS(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){vs(E)&&await e.router.navigate(E.options)}})();else if(v!=="success"||o&&e.sync)await rS(e,n,t,h);else{const E=ku(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 sS(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&ch(t);try{for(let o=0;o<t.matches.length;o++){const u=FA(t,o);ao(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(UA(t,o));await Promise.all(t.matchPromises);const s=ch(t);ao(s)&&await s}catch(n){if(rs(n)&&!t.preload){const s=ch(t);throw ao(s)&&await s,n}if(vs(n))throw n}return t.matches}async function Ww(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 Gw){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 Mf(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function qw(e){for(const t of Gw)if(e.options[t]?.preload)return!0;return!1}const Gw=["component","errorComponent","pendingComponent","notFoundComponent"];function WA(e){return{input:({url:t})=>{for(const n of e)t=$w(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Kw(e[n],t);return t}}}function qA(e){const t=Nw(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=lh(["/",t,h.pathname]),h)}}function $w(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 Kw(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 da(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 GA{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=aA())),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 iA(KA(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),OA(this));let a=!1;const l=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==l||h!==d){this.basepath=l;const g=[];Nw(l)!==""&&g.push(qA({basepath:l})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:WA(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}=yA(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&pA(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=$w(this.rewrite,p),g=this.options.parseSearch(f.search),x=this.options.stringifySearch(g);return f.search=x,{href:f.href.replace(f.origin,""),publicHref:l,url:f,pathname:nS(f.pathname),searchStr:x,search:Zr(s?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:Zr(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=bh(1e3),this.resolvePathWithBase=(n,s)=>EA({base:n,to:I_(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=>YA({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=_h(a);u.from;const d=u.unsafeRelative==="path"?h.pathname:u.from??l.fullPath,p=this.resolvePathWithBase(d,"."),f=l.search,g={...l.params},x=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,to(u.params,g)),w=Jg({path:x,params:C}).interpolatedPath,_=this.matchRoutes(w,void 0,{_buildLocation:!0}).map(H=>this.looseRoutesById[H.routeId]);if(Object.keys(C).length>0)for(const H of _){const z=H.options.params?.stringify??H.options.stringifyParams;z&&Object.assign(C,z(C))}const y=n.leaveParams?x:nS(Jg({path:x,params:C,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const H={};_.forEach(z=>{if(z.options.validateSearch)try{Object.assign(H,Fv(z.options.validateSearch,{...H,...v}))}catch{}}),v=H}v=XA({search:v,dest:u,destRoutes:_,_includeValidateSearch:n._includeValidateSearch}),v=Zr(f,v);const b=this.options.stringifySearch(v),E=u.hash===!0?h.hash:u.hash?to(u.hash,h.hash):void 0,T=E?`#${E}`:"";let A=u.state===!0?h.state:u.state?to(u.state,h.state):{};A=Zr(h.state,A);const M=`${y}${b}${T}`,L=new URL(M,this.origin),D=Kw(this.rewrite,L);return{publicHref:D.pathname+D.search+D.hash,href:M,url:D,pathname:y,search:v,searchStr:b,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=mA(a.pathname,this.processedTree);if(p){Object.assign(d,p.params);const{from:f,params:g,...x}=p.route,C=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,to(g,d));h={from:n.from,...x,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=ca(o.state,this.latestLocation.state);return l.forEach(p=>{delete o.state[p]}),d},h=ua(this.latestLocation.href)===ua(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=zl(()=>{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=vh(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 zw({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",...da({resolvedLocation:d,location:l})}),this.emit({type:"onBeforeLoad",...da({resolvedLocation:d,location:l})}),await sS({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=[];Ru(()=>{this.__store.setState(x=>{const C=x.matches,w=x.pendingMatches||x.matches;return p=C.filter(_=>!w.some(y=>y.id===_.id)),f=w.filter(_=>!C.some(y=>y.id===_.id)),g=w.filter(_=>C.some(y=>y.id===_.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...p.filter(_=>_.status!=="error"&&_.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([x,C])=>{x.forEach(w=>{this.looseRoutesById[w.routeId].options[C]?.(w)})})})})}})}catch(l){vs(l)?(s=l,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):rs(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(da({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=Ww,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)]);Ru(()=>{o.forEach(a=>{h.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return o=await sS({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(vs(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});rs(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=gA(u.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!l||n.params&&!ca(l.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?ca(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??jA,parseSearch:t.parseSearch??IA}),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["**"]:ua(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 Dr}})(),d=[],p=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((f,g)=>{const x=d[g-1],[C,w,_]=(()=>{const j=x?.search??t.search,K=x?._strictSearch??void 0;try{const $=Fv(f.options.validateSearch,{...j})??void 0;return[{...j,...$},{...K,...$},void 0]}catch($){let V=$;if($ instanceof wh||(V=new wh($.message,{cause:$})),n?.throwOnError)throw V;return[j,{},V]}})(),y=f.options.loaderDeps?.({search:C})??"",v=y?JSON.stringify(y):"",{interpolatedPath:b,usedParams:E}=Jg({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+b+v,A=this.getMatch(T),M=this.state.matches.find(j=>j.routeId===f.id),L=A?._strictParams??E;let D;if(!A){const j=f.options.params?.parse??f.options.parseParams;if(j)try{Object.assign(L,j(L))}catch(K){if(rs(K)||vs(K)?D=K:D=new $A(K.message,{cause:K}),n?.throwOnError)throw D}}Object.assign(u,L);const H=M?"stay":"enter";let z;if(A)z={...A,cause:H,params:M?Zr(M.params,u):u,_strictParams:L,search:Zr(M?M.search:A.search,C),_strictSearch:w};else{const j=f.options.loader||f.options.beforeLoad||f.lazyFn||qw(f)?"pending":"success";z={id:T,ssr:this.isServer?void 0:f.options.ssr,index:g,routeId:f.id,params:M?Zr(M.params,u):u,_strictParams:L,pathname:b,updatedAt:Date.now(),search:M?Zr(M.search,C):C,_strictSearch:w,searchError:void 0,status:j,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:zl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:H,loaderDeps:M?Zr(M.loaderDeps,y):y,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||(z.globalNotFound=l===f.id),z.searchError=_;const q=p(x);z.context={...q,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((f,g)=>{const x=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)&&n?._buildLocation!==!0){const w=d[g-1],_=p(w);if(x.options.context){const y={deps:f.loaderDeps,params:f.params,context:_??{},location:t,navigate:v=>this.navigate({...v,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:d};f.__routeContext=x.options.context(y)??void 0}f.context={..._,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class wh extends Error{}class $A extends Error{}function KA(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Fv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new wh("Async validation not supported");if(n.issues)throw new wh(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 YA({pathname:e,routesById:t,processedTree:n}){const s={},o=ua(e);let u;const h=vA(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Dr]],routeParams:s,foundRoute:u}}function XA({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 x=f;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(x=l.options.preSearchFilters.reduce((w,_)=>_(w),f));const C=g(x);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((w,_)=>_(w),C):C};d.push(p)}if(s&&l.options.validateSearch){const p=({search:f,next:g})=>{const x=g(f);try{return{...x,...Fv(l.options.validateSearch,x)??void 0}}catch{return x}};d.push(p)}return a.concat(d)},[])??[],u=({search:a})=>t.search?t.search===!0?a:to(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 QA="Error preloading route! ☝️";class Yw{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=Dr:this.parentRoute||yi(!1);let u=o?Dr:s?.path;u&&u!=="/"&&(u=jw(u));const h=s?.id||u;let a=o?Dr:lh([this.parentRoute.id===Dr?"":this.parentRoute.id,h]);u===Dr&&(u="/"),a!==Dr&&(a=lh(["/",a]));const l=a===Dr?"/":lh([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 ZA extends Yw{constructor(t){super(t)}}function N_(e){const t=e.errorComponent??rp;return S.jsx(JA,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?k.createElement(t,{error:n,reset:s}):e.children})}class JA extends k.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 rp({error:e}){const[t,n]=k.useState(!1);return S.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[S.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),S.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"})]}),S.jsx("div",{style:{height:".25rem"}}),t?S.jsx("div",{children:S.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?S.jsx("code",{children:e.message}):null})}):null]})}function e3({children:e,fallback:t=null}){return t3()?S.jsx(Ne.Fragment,{children:e}):S.jsx(Ne.Fragment,{children:t})}function t3(){return Ne.useSyncExternalStore(n3,()=>!0,()=>!1)}function n3(){return()=>{}}var tv={exports:{}},nv={},rv={exports:{}},sv={};var iS;function r3(){if(iS)return sv;iS=1;var e=Yu();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 x=g(),C=s({inst:{value:x,getSnapshot:g}}),w=C[0].inst,_=C[1];return u(function(){w.value=x,w.getSnapshot=g,l(w)&&_({inst:w})},[f,x,g]),o(function(){return l(w)&&_({inst:w}),f(function(){l(w)&&_({inst:w})})},[f]),h(x),x}function l(f){var g=f.getSnapshot;f=f.value;try{var x=g();return!n(f,x)}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 sv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,sv}var oS;function Xw(){return oS||(oS=1,rv.exports=r3()),rv.exports}var aS;function s3(){if(aS)return nv;aS=1;var e=Yu(),t=Xw();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 nv.useSyncExternalStoreWithSelector=function(d,p,f,g,x){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 y(A){if(!v){if(v=!0,b=A,A=g(A),x!==void 0&&w.hasValue){var M=w.value;if(x(M,A))return E=M}return E=A}if(M=E,s(b,A))return M;var L=g(A);return x!==void 0&&x(M,L)?(b=A,M):(b=A,E=L)}var v=!1,b,E,T=f===void 0?null:f;return[function(){return y(p())},T===null?void 0:function(){return y(T())}]},[p,f,g,x]);var _=o(d,C[0],C[1]);return h(function(){w.hasValue=!0,w.value=_},[_]),l(_),_},nv}var lS;function i3(){return lS||(lS=1,tv.exports=s3()),tv.exports}var Qw=i3();function o3(e,t=s=>s,n={}){const s=n.equal??a3;return Qw.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function a3(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=cS(e);if(n.length!==cS(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 cS(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const iv=k.createContext(null);function Zw(){return typeof document>"u"?iv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=iv,iv)}function Hr(e){const t=k.useContext(Zw());return e?.warn,t}function Jn(e){const t=Hr({warn:e?.router===void 0}),n=e?.router||t,s=k.useRef(void 0);return o3(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const u=Zr(s.current,e.select(o));return s.current=u,u}return e.select(o)}return o})}const sp=k.createContext(void 0),l3=k.createContext(void 0);function Hs(e){const t=k.useContext(e.from?l3:sp);return Jn({select:s=>{const o=s.matches.find(u=>e.from?e.from===u.routeId:u.id===t);if(yi(!((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 B_(e){return Hs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function z_(e){const{select:t,...n}=e;return Hs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function H_(e){return Hs({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 V_(e){return Hs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const Df=typeof window<"u"?k.useLayoutEffect:k.useEffect;function ov(e){const t=k.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function c3(e,t,n={},s={}){k.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 u3(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}function _o(e){const t=Hr();return k.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var er=Dw();const d3=Ow(er);function f3(e,t){const n=Hr(),[s,o]=k.useState(!1),u=k.useRef(!1),h=u3(t),{activeProps:a,inactiveProps:l,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:x,replace:C,startTransition:w,resetScroll:_,viewTransition:y,children:v,target:b,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:D,onMouseLeave:H,onTouchStart:z,ignoreBlocker:q,params:j,search:K,hash:$,state:V,mask:G,reloadDocument:U,unsafeRelative:P,from:B,_fromLocation:I,...W}=e,Y=Jn({select:me=>me.location.search,structuralSharing:!0}),J=e.from,Z=k.useMemo(()=>({...e,from:J}),[n,Y,J,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=k.useMemo(()=>n.buildLocation({...Z}),[n,Z]),X=k.useMemo(()=>{if(E)return;let me=ee.maskedLocation?ee.maskedLocation.url.href:ee.url.href,de=!1;return n.origin&&(me.startsWith(n.origin)?me=n.history.createHref(me.replace(n.origin,""))||"/":de=!0),{href:me,external:de}},[E,ee.maskedLocation,ee.url,n.origin,n.history]),F=k.useMemo(()=>{if(X?.external)return X.href;try{return new URL(p),p}catch{}},[p,X]),se=e.reloadDocument||F?!1:f??n.options.defaultPreload,ne=g??n.options.defaultPreloadDelay??0,re=Jn({select:me=>{if(F)return!1;if(d?.exact){if(!wA(me.location.pathname,ee.pathname,n.basepath))return!1}else{const de=xh(me.location.pathname,n.basepath),xe=xh(ee.pathname,n.basepath);if(!(de.startsWith(xe)&&(de.length===xe.length||de[xe.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ca(me.location.search,ee.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?me.location.hash===ee.hash:!0}}),oe=k.useCallback(()=>{n.preloadRoute({...Z}).catch(me=>{console.warn(me),console.warn(QA)})},[n,Z]),le=k.useCallback(me=>{me?.isIntersecting&&oe()},[oe]);c3(h,le,v3,{disabled:!!E||se!=="viewport"}),k.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const _e=me=>{const de=me.currentTarget.getAttribute("target"),xe=b!==void 0?b:de;if(!E&&!_3(me)&&!me.defaultPrevented&&(!xe||xe==="_self")&&me.button===0){me.preventDefault(),er.flushSync(()=>{o(!0)});const We=n.subscribe("onResolved",()=>{We(),o(!1)});n.navigate({...Z,replace:C,resetScroll:_,hashScrollIntoView:x,startTransition:w,viewTransition:y,ignoreBlocker:q})}};if(F)return{...W,ref:h,href:F,...v&&{children:v},...b&&{target:b},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...D&&{onMouseEnter:D},...H&&{onMouseLeave:H},...z&&{onTouchStart:z}};const ve=me=>{E||se&&oe()},he=ve,ue=me=>{if(!(E||!se))if(!ne)oe();else{const de=me.target;if(fu.has(de))return;const xe=setTimeout(()=>{fu.delete(de),oe()},ne);fu.set(de,xe)}},Ie=me=>{if(E||!se||!ne)return;const de=me.target,xe=fu.get(de);xe&&(clearTimeout(xe),fu.delete(de))},Me=re?to(a,{})??h3:av,Ae=re?av:to(l,{})??av,be=[A,Me.className,Ae.className].filter(Boolean).join(" "),Oe=(T||Me.style||Ae.style)&&{...T,...Me.style,...Ae.style};return{...W,...Me,...Ae,href:X?.href,ref:h,onClick:hu([M,_e]),onFocus:hu([L,ve]),onMouseEnter:hu([D,ue]),onMouseLeave:hu([H,Ie]),onTouchStart:hu([z,he]),disabled:!!E,target:b,...Oe&&{style:Oe},...be&&{className:be},...E&&p3,...re&&m3,...s&&g3}}const av={},h3={className:"active"},p3={role:"link","aria-disabled":!0},m3={"data-status":"active","aria-current":"page"},g3={"data-transitioning":"transitioning"},fu=new WeakMap,v3={rootMargin:"100px"},hu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},qn=k.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,ref:u,...h}=f3(s,t),a=typeof s.children=="function"?s.children({isActive:h["data-status"]==="active"}):s.children;return n===void 0&&delete h.disabled,k.createElement(n||"a",{...h,ref:u},a)});function _3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let y3=class extends Yw{constructor(t){super(t),this.useMatch=n=>Hs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Hs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>V_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>H_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>z_({...n,from:this.id}),this.useLoaderData=n=>B_({...n,from:this.id}),this.useNavigate=()=>_o({from:this.fullPath}),this.Link=Ne.forwardRef((n,s)=>S.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function b3(e){return new y3(e)}class x3 extends ZA{constructor(t){super(t),this.useMatch=n=>Hs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Hs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>V_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>H_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>z_({...n,from:this.id}),this.useLoaderData=n=>B_({...n,from:this.id}),this.useNavigate=()=>_o({from:this.fullPath}),this.Link=Ne.forwardRef((n,s)=>S.jsx(qn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function S3(e){return new x3(e)}function xs(e){return typeof e=="object"?new uS(e,{silent:!0}).createRoute(e):new uS(e,{silent:!0}).createRoute}class uS{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=b3(s);return o.isRoot=!1,o},this.silent=n?.silent}}class dS{constructor(t){this.useMatch=n=>Hs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Hs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>V_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>H_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>z_({...n,from:this.options.id}),this.useLoaderData=n=>B_({...n,from:this.options.id}),this.useNavigate=()=>{const n=Hr();return _o({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function fS(e){return typeof e=="object"?new dS(e):t=>new dS({id:e,...t})}function C3(){const e=Hr(),t=k.useRef({router:e,mounted:!1}),[n,s]=k.useState(!1),{hasPendingMatches:o,isLoading:u}=Jn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),h=ov(u),a=u||n||o,l=ov(a),d=u||o,p=ov(d);return e.startTransition=f=>{s(!0),k.startTransition(()=>{f(),s(!1)})},k.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 ua(e.latestLocation.href)!==ua(g.href)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),Df(()=>{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]),Df(()=>{h&&!u&&e.emit({type:"onLoad",...da(e.state)})},[h,e,u]),Df(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...da(e.state)})},[d,p,e]),Df(()=>{if(l&&!a){const f=da(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&MA(e)}},[a,l,e]),null}function w3(e){const t=Jn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return S.jsx(N_,{getResetKey:()=>t,onCatch:(n,s)=>{if(rs(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(rs(n))return e.fallback?.(n);throw n},children:e.children})}function E3(){return S.jsx("p",{children:"Not Found"})}function Cl(e){return S.jsx(S.Fragment,{children:e.children})}function Jw(e,t,n){return t.options.notFoundComponent?S.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?S.jsx(e.options.defaultNotFoundComponent,{...n}):S.jsx(E3,{})}function R3({children:e}){const t=Hr();return t.isServer?S.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function k3(){const e=Hr();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||Vv)(e.latestLocation),s=n!==Vv(e.latestLocation)?n:void 0,o={storageKey:Sh,shouldScrollRestoration:!0};return s&&(o.key=s),S.jsx(R3,{children:`(${Bw.toString()})(${JSON.stringify(o)})`})}const e2=k.memo(function({matchId:t}){const n=Hr(),s=Jn({select:y=>{const v=y.matches.find(b=>b.id===t);return yi(v),{routeId:v.routeId,ssr:v.ssr,_displayPending:v._displayPending}},structuralSharing:!0}),o=n.routesById[s.routeId],u=o.options.pendingComponent??n.options.defaultPendingComponent,h=u?S.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))?k.Suspense:Cl,g=a?N_:Cl,x=d?w3:Cl,C=Jn({select:y=>y.loadedAt}),w=Jn({select:y=>{const v=y.matches.findIndex(b=>b.id===t);return y.matches[v-1]?.routeId}}),_=o.isRoot?o.options.shellComponent??Cl:Cl;return S.jsxs(_,{children:[S.jsx(sp.Provider,{value:t,children:S.jsx(f,{fallback:h,children:S.jsx(g,{getResetKey:()=>C,errorComponent:a||rp,onCatch:(y,v)=>{if(rs(y))throw y;l?.(y,v)},children:S.jsx(x,{fallback:y=>{if(!d||y.routeId&&y.routeId!==s.routeId||!y.routeId&&!o.isRoot)throw y;return k.createElement(d,y)},children:p||s._displayPending?S.jsx(e3,{fallback:h,children:S.jsx(hS,{matchId:t})}):S.jsx(hS,{matchId:t})})})})}),w===Dr&&n.options.scrollRestoration?S.jsxs(S.Fragment,{children:[S.jsx(T3,{}),S.jsx(k3,{})]}):null]})});function T3(){const e=Hr(),t=k.useRef(void 0);return S.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...da(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const hS=k.memo(function({matchId:t}){const n=Hr(),{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=k.useMemo(()=>{const l=h.options.component??n.options.defaultComponent;return l?S.jsx(l,{},o):S.jsx(t2,{})},[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=zl();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 yi(rs(s.error)),Jw(n,h,s.error);if(s.status==="redirected")throw yi(vs(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const l=(h.options.errorComponent??n.options.defaultErrorComponent)||rp;return S.jsx(l,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),t2=k.memo(function(){const t=Hr(),n=k.useContext(sp),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 yi(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?S.jsx(t.options.defaultPendingComponent,{}):null;if(u)return Jw(t,o,void 0);if(!h)return null;const l=S.jsx(e2,{matchId:h});return s===Dr?S.jsx(k.Suspense,{fallback:a,children:l}):l});function L3(){const e=Hr(),n=e.routesById[Dr].options.pendingComponent??e.options.defaultPendingComponent,s=n?S.jsx(n,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?Cl:k.Suspense,u=S.jsxs(o,{fallback:s,children:[!e.isServer&&S.jsx(C3,{}),S.jsx(A3,{})]});return e.options.InnerWrap?S.jsx(e.options.InnerWrap,{children:u}):u}function A3(){const e=Hr(),t=Jn({select:o=>o.matches[0]?.id}),n=Jn({select:o=>o.loadedAt}),s=t?S.jsx(e2,{matchId:t}):null;return S.jsx(sp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:S.jsx(N_,{getResetKey:()=>n,errorComponent:rp,onCatch:o=>{o.message||o.toString()},children:s})})}const O3=e=>new M3(e);class M3 extends GA{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=xs,globalThis.createLazyFileRoute=fS):typeof window<"u"&&(window.createFileRoute=xs,window.createLazyFileRoute=fS);function D3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=Zw(),o=S.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?S.jsx(e.options.Wrap,{children:o}):o}function P3({router:e,...t}){return S.jsx(D3,{router:e,...t,children:S.jsx(L3,{})})}function I3(e){return Jn({select:t=>t.location})}var Xl=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(){}},j3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},N3=class{#e=j3;#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)}},ta=new N3;function B3(e){setTimeout(e,0)}var xa=typeof window>"u"||"Deno"in globalThis;function sr(){}function z3(e,t){return typeof e=="function"?e(t):e}function Uv(e){return typeof e=="number"&&e>=0&&e!==1/0}function n2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lo(e,t){return typeof e=="function"?e(t):e}function es(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!==F_(h,t.options))return!1}else if(!Pu(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 mS(e,t){const{exact:n,status:s,predicate:o,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(n){if(Sa(t.options.mutationKey)!==Sa(u))return!1}else if(!Pu(t.options.mutationKey,u))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function F_(e,t){return(t?.queryKeyHashFn||Sa)(e)}function Sa(e){return JSON.stringify(e,(t,n)=>Wv(n)?Object.keys(n).sort().reduce((s,o)=>(s[o]=n[o],s),{}):n)}function Pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pu(e[n],t[n])):!1}var H3=Object.prototype.hasOwnProperty;function r2(e,t){if(e===t)return e;const n=gS(e)&&gS(t);if(!n&&!(Wv(e)&&Wv(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:H3.call(e,p))&&l++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const x=r2(f,g);a[p]=x,x===f&&l++}return o===h&&l===o?e:a}function Eh(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 gS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wv(e){if(!vS(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!vS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vS(e){return Object.prototype.toString.call(e)==="[object Object]"}function V3(e){return new Promise(t=>{ta.setTimeout(t,e)})}function qv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?r2(e,t):t}function F3(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function U3(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var U_=Symbol();function s2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===U_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function i2(e,t){return typeof e=="function"?e(...t):!!e}var W3=class extends Xl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!xa&&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"}},W_=new W3;function Gv(){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 q3=B3;function G3(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=q3;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=G3(),$3=class extends Xl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!xa&&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}},Rh=new $3;function K3(e){return Math.min(1e3*2**e,3e4)}function o2(e){return(e??"online")==="online"?Rh.isOnline():!0}var $v=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function a2(e){let t=!1,n=0,s;const o=Gv(),u=()=>o.status!=="pending",h=w=>{if(!u()){const _=new $v(w);g(_),e.onCancel?.(_)}},a=()=>{t=!0},l=()=>{t=!1},d=()=>W_.isFocused()&&(e.networkMode==="always"||Rh.isOnline())&&e.canRun(),p=()=>o2(e.networkMode)&&e.canRun(),f=w=>{u()||(s?.(),o.resolve(w))},g=w=>{u()||(s?.(),o.reject(w))},x=()=>new Promise(w=>{s=_=>{(u()||d())&&w(_)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),C=()=>{if(u())return;let w;const _=n===0?e.initialPromise:void 0;try{w=_??e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(f).catch(y=>{if(u())return;const v=e.retry??(xa?0:3),b=e.retryDelay??K3,E=typeof b=="function"?b(n,y):b,T=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!T){g(y);return}n++,e.onFail?.(n,y),V3(E).then(()=>d()?void 0:x()).then(()=>{t?g(y):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:l,canStart:p,start:()=>(p()?C():x().then(C),o)}}var l2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uv(this.gcTime)&&(this.#e=ta.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(xa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ta.clearTimeout(this.#e),this.#e=void 0)}},Y3=class extends l2{#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=yS(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=yS(this.options);t.data!==void 0&&(this.setState(_S(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=qv(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=>es(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===U_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>lo(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:!n2(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=s2(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=a2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof $v&&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 $v){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,...c2(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,..._S(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 c2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _S(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yS(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 X3=class extends Xl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Gv(),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),bS(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kv(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 es(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&&!Eh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&xS(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||es(this.options.enabled,this.#t)!==es(t.enabled,this.#t)||lo(this.options.staleTime,this.#t)!==lo(t.staleTime,this.#t))&&this.#g();const o=this.#v();s&&(this.#t!==n||es(this.options.enabled,this.#t)!==es(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 Z3(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=lo(this.options.staleTime,this.#t);if(xa||this.#s.isStale||!Uv(e))return;const n=n2(this.#s.dataUpdatedAt,e)+1;this.#c=ta.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,!(xa||es(this.options.enabled,this.#t)===!1||!Uv(this.#l)||this.#l===0)&&(this.#u=ta.setInterval(()=>{(this.options.refetchIntervalInBackground||W_.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(ta.clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(ta.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&&bS(e,t),H=L&&xS(e,n,t,s);(D||H)&&(p={...p,...c2(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:w}=p;g=p.data;let _=!1;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let L;o?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(L=o.data,_=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(w="success",g=qv(o?.data,L,t),f=!0)}if(t.select&&g!==void 0&&!_)if(o&&g===u?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=qv(o?.data,g,t),this.#f=g,this.#i=null}catch(L){this.#i=L}this.#i&&(x=this.#i,g=this.#f,C=Date.now(),w="error");const y=p.fetchStatus==="fetching",v=w==="pending",b=w==="error",E=v&&y,T=g!==void 0,M={status:w,fetchStatus:p.fetchStatus,isPending:v,isSuccess:w==="success",isError:b,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:p.dataUpdatedAt,error:x,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:y,isRefetching:y&&!v,isLoadingError:b&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&T,isStale:q_(e,t),refetch:this.refetch,promise:this.#a,isEnabled:es(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=z=>{M.status==="error"?z.reject(M.error):M.data!==void 0&&z.resolve(M.data)},D=()=>{const z=this.#a=M.promise=Gv();L(z)},H=this.#a;switch(H.status){case"pending":e.queryHash===n.queryHash&&L(H);break;case"fulfilled":(M.status==="error"||M.data!==H.value)&&D();break;case"rejected":(M.status!=="error"||M.error!==H.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),Eh(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 Q3(e,t){return es(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bS(e,t){return Q3(e,t)||e.state.data!==void 0&&Kv(e,t,t.refetchOnMount)}function Kv(e,t,n){if(es(t.enabled,e)!==!1&&lo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&q_(e,t)}return!1}function xS(e,t,n,s){return(e!==t||es(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&q_(e,n)}function q_(e,t){return es(t.enabled,e)!==!1&&e.isStaleByTime(lo(t.staleTime,e))}function Z3(e,t){return!Eh(e.getCurrentResult(),t)}function SS(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=s2(t.options,t.fetchOptions),x=async(C,w,_)=>{if(p)return Promise.reject();if(w==null&&C.pages.length)return Promise.resolve(C);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:_?"backward":"forward",meta:t.options.meta};return f(A),A})(),b=await g(v),{maxPages:E}=t.options,T=_?U3:F3;return{pages:T(C.pages,b,E),pageParams:T(C.pageParams,w,E)}};if(o&&u.length){const C=o==="backward",w=C?J3:CS,_={pages:u,pageParams:h},y=w(s,_);a=await x(_,y,C)}else{const C=e??u.length;do{const w=l===0?h[0]??s.initialPageParam:CS(s,a);if(l>0&&w==null)break;a=await x(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 CS(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 J3(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var eO=class extends l2{#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||u2(),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=a2({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 u2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tO=class extends Xl{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 eO({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=Pf(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=Pf(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=Pf(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=Pf(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=>mS(t,n))}findAll(e={}){return this.getAll().filter(t=>mS(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 Pf(e){return e.options.scope?.id}var nO=class extends Xl{#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),Eh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Sa(n.mutationKey)!==Sa(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??u2();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)})})}},rO=class extends Xl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,o=t.queryHash??F_(s,t);let u=this.get(o);return u||(u=new Y3({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()})})}},sO=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new rO,this.#t=e.mutationCache||new tO,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=W_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Rh.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(lo(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=z3(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(lo(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=SS(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sr).catch(sr)}ensureInfiniteQueryData(e){return e.behavior=SS(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rh.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(Sa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Pu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Sa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Pu(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=F_(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===U_&&(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()}},d2=k.createContext(void 0),$n=e=>{const t=k.useContext(d2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},iO=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),S.jsx(d2.Provider,{value:e,children:t})),f2=k.createContext(!1),oO=()=>k.useContext(f2);f2.Provider;function aO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lO=k.createContext(aO()),cO=()=>k.useContext(lO),uO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},dO=e=>{k.useEffect(()=>{e.clearReset()},[e])},fO=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||i2(n,[e.error,s])),hO=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))}},pO=(e,t)=>e.isLoading&&e.isFetching&&!t,mO=(e,t)=>e?.suspense&&t.isPending,wS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gO(e,t,n){const s=oO(),o=cO(),u=$n(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",hO(h),uO(h,o),dO(o);const a=!u.getQueryCache().get(h.queryHash),[l]=k.useState(()=>new t(u,h)),d=l.getOptimisticResult(h),p=!s&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(f=>{const g=p?l.subscribe(Dn.batchCalls(f)):sr;return l.updateResult(),g},[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setOptions(h)},[h,l]),mO(h,d))throw wS(h,l,o);if(fO({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&&!xa&&pO(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 gO(e,X3)}function Bn(e,t){const n=$n(),[s]=k.useState(()=>new nO(n,e));k.useEffect(()=>{s.setOptions(e)},[s,e]);const o=k.useSyncExternalStore(k.useCallback(h=>s.subscribe(Dn.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=k.useCallback((h,a)=>{s.mutate(h,a).catch(sr)},[s]);if(o.error&&i2(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function ip(){return typeof window<"u"}function yo(e){return G_(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Us(e){var t;return(t=(G_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function G_(e){return ip()?e instanceof Node||e instanceof Rn(e).Node:!1}function Nt(e){return ip()?e instanceof Element||e instanceof Rn(e).Element:!1}function en(e){return ip()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function Yv(e){return!ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}const vO=new Set(["inline","contents"]);function ka(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!vO.has(o)}const _O=new Set(["table","td","th"]);function yO(e){return _O.has(yo(e))}const bO=[":popover-open",":modal"];function op(e){return bO.some(t=>{try{return e.matches(t)}catch{return!1}})}const xO=["transform","translate","scale","rotate","perspective"],SO=["transform","translate","scale","rotate","perspective","filter"],CO=["paint","layout","strict","content"];function $_(e){const t=ap(),n=Nt(e)?zr(e):e;return xO.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)||SO.some(s=>(n.willChange||"").includes(s))||CO.some(s=>(n.contain||"").includes(s))}function wO(e){let t=Vs(e);for(;en(t)&&!Bs(t);){if($_(t))return t;if(op(t))return null;t=Vs(t)}return null}function ap(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const EO=new Set(["html","body","#document"]);function Bs(e){return EO.has(yo(e))}function zr(e){return Rn(e).getComputedStyle(e)}function lp(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(yo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yv(e)&&e.host||Us(e);return Yv(t)?t.host:t}function h2(e){const t=Vs(e);return Bs(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&ka(t)?t:h2(t)}function co(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=h2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=Rn(o);if(u){const a=Xv(h);return t.concat(h,h.visualViewport||[],ka(o)?o:[],a&&n?co(a):[])}return t.concat(o,co(o,[],n))}function Xv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ES={};function Gn(e,t){const n=k.useRef(ES);return n.current===ES&&(n.current=e(t)),n}const lv=Mw[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],RO=lv&&lv!==k.useLayoutEffect?lv:e=>e();function De(e){const t=Gn(kO).current;return t.next=e,RO(t.effect),t.trampoline}function kO(){const e={next:void 0,callback:TO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function TO(){}const LO=()=>{},He=typeof document<"u"?k.useLayoutEffect:LO;function Qv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Tu={};function Fs(e,t,n,s,o){let u={...Zv(e,Tu)};return t&&(u=Su(u,t)),n&&(u=Su(u,n)),s&&(u=Su(u,s)),o&&(u=Su(u,o)),u}function AO(e){if(e.length===0)return Tu;if(e.length===1)return Zv(e[0],Tu);let t={...Zv(e[0],Tu)};for(let n=1;n<e.length;n+=1)t=Su(t,e[n]);return t}function Su(e,t){return p2(t)?t(e):OO(e,t)}function OO(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Qv(e.style,s);break}case"className":{e[n]=m2(e.className,s);break}default:MO(n,s)?e[n]=DO(e[n],s):e[n]=s}}return e}function MO(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 p2(e){return typeof e=="function"}function Zv(e,t){return p2(e)?e(t):e??Tu}function DO(e,t){return t?e?n=>{if(PO(n)){const o=n;Jv(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function Jv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function m2(e,t){return t?e?t+" "+e:t:e}function PO(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 g2=k.createContext(void 0);function K_(e=!1){const t=k.useContext(g2);if(t===void 0&&!e)throw new Error(Pt(16));return t}function IO(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:k.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 yr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=k.useRef(null),h=K_(!0)!==void 0,a=De(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:l}=IO({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=k.useCallback(()=>{const g=u.current;jO(g)&&h&&t&&l.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,l.disabled,h]);He(d,[d]);const p=k.useCallback((g={})=>{const{onClick:x,onMouseDown:C,onKeyUp:w,onKeyDown:_,onPointerDown:y,...v}=g;return Fs({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}x?.(E)},onMouseDown(E){t||C?.(E)},onKeyDown(E){if(t||(Jv(E),_?.(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&&x?.(E))},onKeyUp(E){t||(Jv(E),w?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&x?.(E)},onPointerDown(E){if(t){E.preventDefault();return}y?.(E)}},o?void 0:{role:"button"},l,v)},[t,l,o,a]),f=De(g=>{u.current=g,d()});return{getButtonProps:p,buttonRef:f}}function jO(e){return en(e)&&e.tagName==="BUTTON"}function os(e,t,n,s){const o=Gn(v2).current;return BO(o,e,t,n,s)&&_2(o,[e,t,n,s]),o.callback}function NO(e){const t=Gn(v2).current;return zO(t,e)&&_2(t,e),t.callback}function v2(){return{callback:null,cleanup:null,refs:[]}}function BO(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function zO(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function _2(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 HO=parseInt(k.version,10);function Y_(e){return HO>=e}function RS(e){if(!k.isValidElement(e))return null;const t=e,n=t.props;return(Y_(19)?n?.ref:t.ref)??null}function VO(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 FO(e,t){return typeof e=="function"?e(t):e}function UO(e,t){return typeof e=="function"?e(t):e}function sn(){}const gr=Object.freeze([]),tn=Object.freeze({}),WO=500,qO=500,GO={style:{transition:"none"}},y2="data-base-ui-click-trigger",X_={fallbackAxisSide:"none"},$O={fallbackAxisSide:"end"},KO={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ct(e,t,n={}){const s=t.render,o=YO(t,n);if(n.enabled===!1)return null;const u=n.state??tn;return XO(e,s,o,u)}function YO(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?FO(n,u):void 0,f=d?UO(s,u):void 0,g=d?VO(u,l):tn,x=d?Qv(g,Array.isArray(a)?AO(a):a)??tn:tn;return typeof document<"u"&&(d?Array.isArray(h)?x.ref=NO([x.ref,RS(o),...h]):x.ref=os(x.ref,RS(o),h):os(null,null)),d?(p!==void 0&&(x.className=m2(x.className,p)),f!==void 0&&(x.style=Qv(x.style,f)),x):tn}function XO(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const o=Fs(n,t.props);return o.ref=n.ref,k.cloneElement(t,o)}if(e&&typeof e=="string")return QO(e,n);throw new Error(Pt(8))}function QO(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):k.createElement(e,t)}const ZO=k.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}=yr({disabled:d,focusableWhenDisabled:h,native:a}),g=k.useMemo(()=>({disabled:d}),[d]);return ct("button",t,{state:g,ref:[n,f],props:[l,p]})});function b2(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=b2(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function x2(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=b2(e))&&(s&&(s+=" "),s+=t);return s}const kS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TS=x2,Ta=(e,t)=>n=>{var s;if(t?.variants==null)return TS(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=kS(p)||kS(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,...x}=p;return Object.entries(x).every(C=>{let[w,_]=C;return Array.isArray(_)?_.includes({...u,...a}[w]):{...u,...a}[w]===_})?[...d,f,g]:d},[]);return TS(e,h,l,n?.class,n?.className)},JO=(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},eM=(e,t)=>({classGroupId:e,validator:t}),S2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kh="-",LS=[],tM="arbitrary..",nM=e=>{const t=sM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return rM(h);const a=h.split(kh),l=a[0]===""&&a.length>1?1:0;return C2(a,l,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const l=s[h],d=n[h];return l?d?JO(d,l):l:d||LS}return n[h]||LS}}},C2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=C2(e,t+1,u);if(d)return d}const h=n.validators;if(h===null)return;const a=t===0?e.join(kh):e.slice(t).join(kh),l=h.length;for(let d=0;d<l;d++){const p=h[d];if(p.validator(a))return p.classGroupId}},rM=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?tM+s:void 0})(),sM=e=>{const{theme:t,classGroups:n}=e;return iM(n,t)},iM=(e,t)=>{const n=S2();for(const s in e){const o=e[s];Q_(o,n,s,t)}return n},Q_=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];oM(h,t,n,s)}},oM=(e,t,n,s)=>{if(typeof e=="string"){aM(e,t,n);return}if(typeof e=="function"){lM(e,t,n,s);return}cM(e,t,n,s)},aM=(e,t,n)=>{const s=e===""?t:w2(t,e);s.classGroupId=n},lM=(e,t,n,s)=>{if(uM(e)){Q_(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(eM(n,e))},cM=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,l]=o[h];Q_(l,w2(t,a),n,s)}},w2=(e,t)=>{let n=e;const s=t.split(kh),o=s.length;for(let u=0;u<o;u++){const h=s[u];let a=n.nextPart.get(h);a||(a=S2(),n.nextPart.set(h,a)),n=a}return n},uM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dM=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)}}},e_="!",AS=":",fM=[],OS=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),hM=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 _=o[w];if(h===0&&a===0){if(_===AS){u.push(o.slice(l,w)),l=w+1;continue}if(_==="/"){d=w;continue}}_==="["?h++:_==="]"?h--:_==="("?a++:_===")"&&a--}const f=u.length===0?o:o.slice(l);let g=f,x=!1;f.endsWith(e_)?(g=f.slice(0,-1),x=!0):f.startsWith(e_)&&(g=f.slice(1),x=!0);const C=d&&d>l?d-l:void 0;return OS(u,x,g,C)};if(t){const o=t+AS,u=s;s=h=>h.startsWith(o)?u(h.slice(o.length)):OS(fM,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},pM=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}},mM=e=>({cache:dM(e.cacheSize),parseClassName:hM(e),sortModifiers:pM(e),...nM(e)}),gM=/\s+/,vM=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(gM);let l="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:f,modifiers:g,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(f){l=p+(l.length>0?" "+l:l);continue}let _=!!w,y=s(_?C.substring(0,w):C);if(!y){if(!_){l=p+(l.length>0?" "+l:l);continue}if(y=s(C),!y){l=p+(l.length>0?" "+l:l);continue}_=!1}const v=g.length===0?"":g.length===1?g[0]:u(g).join(":"),b=x?v+e_:v,E=b+y;if(h.indexOf(E)>-1)continue;h.push(E);const T=o(y,_);for(let A=0;A<T.length;++A){const M=T[A];h.push(b+M)}l=p+(l.length>0?" "+l:l)}return l},_M=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=E2(n))&&(o&&(o+=" "),o+=s);return o},E2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=E2(e[s]))&&(n&&(n+=" "),n+=t);return n},yM=(e,...t)=>{let n,s,o,u;const h=l=>{const d=t.reduce((p,f)=>f(p),e());return n=mM(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=vM(l,n);return o(l,p),p};return u=h,(...l)=>u(_M(...l))},bM=[],Ln=e=>{const t=n=>n[e]||bM;return t.isThemeGetter=!0,t},R2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,k2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xM=/^\d+\/\d+$/,SM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CM=/\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$/,wM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xl=e=>xM.test(e),St=e=>!!e&&!Number.isNaN(Number(e)),Zi=e=>!!e&&Number.isInteger(Number(e)),cv=e=>e.endsWith("%")&&St(e.slice(0,-1)),gi=e=>SM.test(e),kM=()=>!0,TM=e=>CM.test(e)&&!wM.test(e),T2=()=>!1,LM=e=>EM.test(e),AM=e=>RM.test(e),OM=e=>!$e(e)&&!Ke(e),MM=e=>Ql(e,O2,T2),$e=e=>R2.test(e),Wo=e=>Ql(e,M2,TM),uv=e=>Ql(e,NM,St),MS=e=>Ql(e,L2,T2),DM=e=>Ql(e,A2,AM),If=e=>Ql(e,D2,LM),Ke=e=>k2.test(e),pu=e=>Zl(e,M2),PM=e=>Zl(e,BM),DS=e=>Zl(e,L2),IM=e=>Zl(e,O2),jM=e=>Zl(e,A2),jf=e=>Zl(e,D2,!0),Ql=(e,t,n)=>{const s=R2.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Zl=(e,t,n=!1)=>{const s=k2.exec(e);return s?s[1]?t(s[1]):n:!1},L2=e=>e==="position"||e==="percentage",A2=e=>e==="image"||e==="url",O2=e=>e==="length"||e==="size"||e==="bg-size",M2=e=>e==="length",NM=e=>e==="number",BM=e=>e==="family-name",D2=e=>e==="shadow",zM=()=>{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"),x=Ln("drop-shadow"),C=Ln("blur"),w=Ln("perspective"),_=Ln("aspect"),y=Ln("ease"),v=Ln("animate"),b=()=>["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(),Ke,$e],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[Ke,$e,l],D=()=>[xl,"full","auto",...L()],H=()=>[Zi,"none","subgrid",Ke,$e],z=()=>["auto",{span:["full",Zi,Ke,$e]},Zi,Ke,$e],q=()=>[Zi,"auto",Ke,$e],j=()=>["auto","min","max","fr",Ke,$e],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...L()],G=()=>[xl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],U=()=>[e,Ke,$e],P=()=>[...E(),DS,MS,{position:[Ke,$e]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",IM,MM,{size:[Ke,$e]}],W=()=>[cv,pu,Wo],Y=()=>["","none","full",d,Ke,$e],J=()=>["",St,pu,Wo],Z=()=>["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"],X=()=>[St,cv,DS,MS],F=()=>["","none",C,Ke,$e],se=()=>["none",St,Ke,$e],ne=()=>["none",St,Ke,$e],re=()=>[St,Ke,$e],oe=()=>[xl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gi],breakpoint:[gi],color:[kM],container:[gi],"drop-shadow":[gi],ease:["in","out","in-out"],font:[OM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gi],shadow:[gi],spacing:["px",St],text:[gi],"text-shadow":[gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xl,$e,Ke,_]}],container:["container"],columns:[{columns:[St,$e,Ke,a]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:[Zi,"auto",Ke,$e]}],basis:[{basis:[xl,"full","auto",a,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,xl,"auto","initial","none",$e]}],grow:[{grow:["",St,Ke,$e]}],shrink:[{shrink:["",St,Ke,$e]}],order:[{order:[Zi,"first","last","none",Ke,$e]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],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:G()}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,pu,Wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ke,uv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cv,$e]}],"font-family":[{font:[PM,$e,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,Ke,$e]}],"line-clamp":[{"line-clamp":[St,"none",Ke,uv]}],leading:[{leading:[u,...L()]}],"list-image":[{"list-image":["none",Ke,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",Ke,Wo]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[St,"auto",Ke,$e]}],"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",Ke,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zi,Ke,$e],radial:["",Ke,$e],conic:[Zi,Ke,$e]},jM,DM]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,Ke,$e]}],"outline-w":[{outline:["",St,pu,Wo]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,jf,If]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,jf,If]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[St,Wo]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,jf,If]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[St,Ke,$e]}],"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":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ke,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ke,$e]}],filter:[{filter:["","none",Ke,$e]}],blur:[{blur:F()}],brightness:[{brightness:[St,Ke,$e]}],contrast:[{contrast:[St,Ke,$e]}],"drop-shadow":[{"drop-shadow":["","none",x,jf,If]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",St,Ke,$e]}],"hue-rotate":[{"hue-rotate":[St,Ke,$e]}],invert:[{invert:["",St,Ke,$e]}],saturate:[{saturate:[St,Ke,$e]}],sepia:[{sepia:["",St,Ke,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,$e]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[St,Ke,$e]}],"backdrop-contrast":[{"backdrop-contrast":[St,Ke,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,Ke,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,Ke,$e]}],"backdrop-invert":[{"backdrop-invert":["",St,Ke,$e]}],"backdrop-opacity":[{"backdrop-opacity":[St,Ke,$e]}],"backdrop-saturate":[{"backdrop-saturate":[St,Ke,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",St,Ke,$e]}],"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",Ke,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",Ke,$e]}],ease:[{ease:["linear","initial",y,Ke,$e]}],delay:[{delay:[St,Ke,$e]}],animate:[{animate:["none",v,Ke,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ke,$e]}],"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:[Ke,$e,"","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:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Ke,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":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",Ke,$e]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[St,pu,Wo,uv]}],stroke:[{stroke:["none",...U()]}],"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"]}},HM=yM(zM);function ze(...e){return HM(x2(e))}const VM=Ta("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 je({className:e,variant:t="default",size:n="default",...s}){return S.jsx(ZO,{"data-slot":"button",className:ze(VM({variant:t,size:n,className:e})),...s})}const FM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},Se=k.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 x=n!==void 0?s?Number(n)*24/Number(t):n:void 0,C=x!==void 0?{strokeWidth:x,stroke:"currentColor"}:{},w={ref:g,...FM,width:t,height:t,color:l||e,className:o,...C,...f},y=[...h&&u?u:a].sort(([,v],[,b])=>{const E=v.opacity!==void 0;return b.opacity!==void 0?1:E?-1:0}).map(([v,b])=>{const E=b.opacity!==void 0,T=E&&!p?b.opacity:void 0,A=d?{...b.stroke!==void 0?{stroke:E?d:l||e}:{fill:E?d:l||e}}:{};return k.createElement(v,{...b,...C,...A,opacity:T,key:b.key})});return k.createElement("svg",w,y)});Se.displayName="HugeiconsIcon";const Jl=[["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"}]],P2=[["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"}]],I2=[["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"}]],j2=[["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"}]],UM=[["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"}]],PS=[["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"}]],N2=[["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"}]],B2=[["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"}]],z2=[["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"}]],H2=[["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"}]],WM=[["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"}]],vo=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],qM=[["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"}]],GM=[["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"}]],$M=[["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"}]],KM=[["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"}]],Z_=[["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"}]],YM=[["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"}]],V2=[["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"}]],Xu=[["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"}]],XM=[["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"}]],QM=[["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"}]],F2=[["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"}]],Ss=[["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"}]],U2=[["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"}]],W2=[["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"}]],t_=[["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"}]],J_=[["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"}]],Th=[["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"}]],ZM=[["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"}]],JM=[["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"}]],e4=[["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"}]],t4=[["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"}]],r4=[["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"}]],s4=[["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"}]],Nr=[["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"}]],i4=[["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"}]],o4=[["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"}]],q2=[["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"}]],ec=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],a4=[["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"}]],qo=[["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"}]],l4=[["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"}]],G2=[["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"}]],$2=[["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"}]],e0=[["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"}]],Nf=[["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"}]],c4=[["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"}]],La=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],u4=[["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"}]],t0=[["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"}]],n0=k.createContext(void 0);function Si(e){const t=k.useContext(n0);if(e===!1&&t===void 0)throw new Error(Pt(27));return t}let Lh=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const d4={[Lh.startingStyle]:""},f4={[Lh.endingStyle]:""},Ws={transitionStatus(e){return e==="starting"?d4:e==="ending"?f4:null}};let na=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Lh.startingStyle]="startingStyle",e[e.endingStyle=Lh.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),n_=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const h4={[n_.popupOpen]:""},p4={[n_.popupOpen]:"",[n_.pressed]:""},m4={[na.open]:""},g4={[na.closed]:""},v4={[na.anchorHidden]:""},r0={open(e){return e?h4:null}},Iu={open(e){return e?p4:null}},bo={open(e){return e?m4:g4},anchorHidden(e){return e?v4:null}},_4={...bo,...Ws},K2=k.forwardRef(function(t,n){const{render:s,className:o,forceRender:u=!1,...h}=t,{store:a}=Si(),l=a.useState("open"),d=a.useState("nested"),p=a.useState("mounted"),f=a.useState("transitionStatus"),g=k.useMemo(()=>({open:l,transitionStatus:f}),[l,f]);return ct("div",t,{state:g,ref:[a.context.backdropRef,n],stateAttributesMapping:_4,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},h],enabled:u||!d})}),Mn="none",fa="trigger-press",jr="trigger-hover",Ah="trigger-focus",s0="outside-press",ha="item-press",y4="close-press",IS="clear-press",ra="input-change",eo="input-clear",Ca="focus-out",cp="escape-key",Lu="list-navigation",Y2="cancel-open",Cu="sibling-open",X2="imperative-action",b4="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 mu(e,t,n){const s=n??tn;return{reason:e,event:t??new Event("base-ui"),...s}}const up=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{store:l}=Si(),d=l.useState("open");function p(C){d&&l.setOpen(!1,Ue(y4,C.nativeEvent))}const{getButtonProps:f,buttonRef:g}=yr({disabled:u,native:h}),x=k.useMemo(()=>({disabled:u}),[u]);return ct("button",t,{state:x,ref:[n,g],props:[{onClick:p},a,f]})}),x4={...Mw};let jS=0;function S4(e,t="mui"){const[n,s]=k.useState(e),o=e||n;return k.useEffect(()=>{n==null&&(jS+=1,s(`${t}-${jS}`))},[n,t]),o}const NS=x4.useId;function Aa(e,t){if(NS!==void 0){const n=NS();return e??(t?`${t}-${n}`:n)}return S4(e,t)}function vr(e){return Aa(e,"base-ui")}const Q2=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=Si(),l=vr(u);return a.useSyncedValueWithCleanup("descriptionElementId",l),ct("p",t,{ref:n,props:[{id:l},h]})}),C4=[];function Z2(e){k.useEffect(e,C4)}const gu=0;class wa{static create(){return new wa}currentId=gu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=gu,n()},t)}isStarted(){return this.currentId!==gu}clear=()=>{this.currentId!==gu&&(clearTimeout(this.currentId),this.currentId=gu)};disposeEffect=()=>this.clear}function Qt(){const e=Gn(wa.create).current;return Z2(e.disposeEffect),e}function hn(e){const t=Gn(w4,e).current;return t.next=e,He(t.effect),t}function w4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Oa=typeof navigator<"u",dv=k4(),J2=L4(),i0=T4(),o0=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),E4=dv.platform==="MacIntel"&&dv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(dv.platform),BS=Oa&&/firefox/i.test(i0),eE=Oa&&/apple/i.test(navigator.vendor),Oh=Oa&&/android/i.test(J2)||/android/i.test(i0),R4=Oa&&J2.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,tE=i0.includes("jsdom/");function k4(){if(!Oa)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 T4(){if(!Oa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function L4(){if(!Oa)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const r_="data-base-ui-focusable",nE="active",rE="selected",sE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",uo="ArrowLeft",fo="ArrowRight",a0="ArrowUp",Qu="ArrowDown";function ms(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&&Yv(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 ps(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 A4(e){return e.matches("html,body")}function dn(e){return e?.ownerDocument||document}function l0(e){return en(e)&&e.matches(sE)}function s_(e){return e?e.getAttribute("role")==="combobox"&&l0(e):!1}function O4(e){if(!e||tE)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ju(e){return e?e.hasAttribute(r_)?e:e.querySelector(`[${r_}]`)||e:null}function pa(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...pa(e,o.id,n)])}function zS(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 M4(e){return"nativeEvent"in e}function iE(e){return e.mozInputSource===0&&e.isTrusted?!0:Oh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oE(e){return tE?!1:!Oh&&e.width===0&&e.height===0||Oh&&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 Vl(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 D4=["top","right","bottom","left"],Fl=Math.min,Pr=Math.max,Mh=Math.round,wl=Math.floor,zs=e=>({x:e,y:e}),P4={left:"right",right:"left",bottom:"top",top:"bottom"},I4={start:"end",end:"start"};function i_(e,t,n){return Pr(e,Fl(t,n))}function bi(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function xo(e){return e.split("-")[1]}function c0(e){return e==="x"?"y":"x"}function u0(e){return e==="y"?"height":"width"}const j4=new Set(["top","bottom"]);function ts(e){return j4.has(Br(e))?"y":"x"}function d0(e){return c0(ts(e))}function N4(e,t,n){n===void 0&&(n=!1);const s=xo(e),o=d0(e),u=u0(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=Dh(h)),[h,Dh(h)]}function B4(e){const t=Dh(e);return[o_(e),t,o_(t)]}function o_(e){return e.replace(/start|end/g,t=>I4[t])}const HS=["left","right"],VS=["right","left"],z4=["top","bottom"],H4=["bottom","top"];function V4(e,t,n){switch(e){case"top":case"bottom":return n?t?VS:HS:t?HS:VS;case"left":case"right":return t?z4:H4;default:return[]}}function F4(e,t,n,s){const o=xo(e);let u=V4(Br(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(o_)))),u}function Dh(e){return e.replace(/left|right|bottom|top/g,t=>P4[t])}function U4(e){return{top:0,right:0,bottom:0,left:0,...e}}function lE(e){return typeof e!="number"?U4(e):{top:e,right:e,bottom:e,left:e}}function Ph(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 Bf(e,t,n){return Math.floor(e/t)!==n}function kl(e,t){return t<0||t>=e.current.length}function uh(e,t){return Wn(e,{disabledIndices:t})}function a_(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&&ho(e,u,s));return u}function cE(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=[],x={};let C=!1;{let y=null,v=-1;e.current.forEach((b,E)=>{if(b==null)return;const T=b.closest('[role="row"]');T&&(C=!0),(T!==y||v===-1)&&(y=T,v+=1,g[v]=[]),g[v].push(E),x[E]=v})}const w=C&&g.length>0&&g.some(y=>y.length!==u);function _(y){if(!w||d===-1)return;const v=x[d];if(v==null)return;const b=g[v].indexOf(d);let E=y==="up"?v-1:v+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=y==="up"?E-1:E+1;continue}const M=Math.min(b,A.length-1);for(let L=M;L>=0;L-=1){const D=A[L];if(!ho(e,D,h))return D}E=y==="up"?E-1:E+1,s&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===a0){const y=_("up");if(y!==void 0)p&&fn(t),f=y;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 v=d%u,b=l%u,E=l-(b-v);b===v?f=l:f=b>v?E:E-u}kl(e,f)&&(f=d)}}if(t.key===Qu){const y=_("down");y!==void 0?(p&&fn(t),f=y):(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}))),kl(e,f)&&(f=d))}if(n==="both"){const y=wl(d/u);t.key===(o?uo:fo)&&(p&&fn(t),d%u!==u-1?(f=Wn(e,{startingIndex:d,disabledIndices:h}),s&&Bf(f,u,y)&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Wn(e,{startingIndex:d-d%u-1,disabledIndices:h})),Bf(f,u,y)&&(f=d)),t.key===(o?fo:uo)&&(p&&fn(t),d%u!==0?(f=Wn(e,{startingIndex:d,decrement:!0,disabledIndices:h}),s&&Bf(f,u,y)&&(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})),Bf(f,u,y)&&(f=d));const v=wl(l/u)===y;kl(e,f)&&(s&&v?f=t.key===(o?fo:uo)?l:Wn(e,{startingIndex:d-d%u-1,disabledIndices:h}):f=d)}return f}function uE(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 dE(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 fE(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function ho(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 W4=["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])"],Ih=W4.join(","),hE=typeof Element>"u",Ul=hE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,jh=!hE&&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},Nu=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&&Nu(t.parentNode);return h},q4=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},pE=function(t,n,s){if(Nu(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ih));return n&&Ul.call(t,Ih)&&o.unshift(t),o=o.filter(s),o},Nh=function(t,n,s){for(var o=[],u=Array.from(t);u.length;){var h=u.shift();if(!Nu(h,!1))if(h.tagName==="SLOT"){var a=h.assignedElements(),l=a.length?a:h.children,d=Nh(l,!0,s);s.flatten?o.push.apply(o,d):o.push({scopeParent:h,candidates:d})}else{var p=Ul.call(h,Ih);p&&s.filter(h)&&(n||!t.includes(h))&&o.push(h);var f=h.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(h),g=!Nu(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(h));if(f&&g){var x=Nh(f===!0?h.children:f.children,!0,s);s.flatten?o.push.apply(o,x):o.push({scopeParent:h,candidates:x})}else u.unshift.apply(u,h.children)}}return o},mE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||q4(t))&&!mE(t)?0:t.tabIndex},G4=function(t,n){var s=gE(t);return s<0&&n&&!mE(t)?0:s},$4=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},vE=function(t){return t.tagName==="INPUT"},K4=function(t){return vE(t)&&t.type==="hidden"},Y4=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},X4=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},Q4=function(t){if(!t.name)return!0;var n=t.form||jh(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=X4(o,t.form);return!u||u===t},Z4=function(t){return vE(t)&&t.type==="radio"},J4=function(t){return Z4(t)&&!Q4(t)},eD=function(t){var n,s=t&&jh(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=jh(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},FS=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},tD=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=Ul.call(t,"details>summary:first-of-type"),a=h?t.parentElement:t;if(Ul.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=jh(t);if(d&&!d.shadowRoot&&o(d)===!0)return FS(t);t.assignedSlot?t=t.assignedSlot:!d&&p!==t.ownerDocument?t=p.host:t=d}t=l}if(eD(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return FS(t);return!1},nD=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 Ul.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},l_=function(t,n){return!(n.disabled||Nu(n)||K4(n)||tD(n,t)||Y4(n)||nD(n))},c_=function(t,n){return!(J4(n)||gE(n)<0||!l_(t,n))},rD=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},_E=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,l=G4(a,h),d=h?_E(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($4).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},Zu=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Nh([t],n.includeContainer,{filter:c_.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:rD}):s=pE(t,n.includeContainer,c_.bind(null,n)),_E(s)},sD=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Nh([t],n.includeContainer,{filter:l_.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=pE(t,n.includeContainer,l_.bind(null,n)),s},yE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ul.call(t,Ih)===!1?!1:c_(n,t)};const tc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bE(e,t){const n=Zu(e,tc()),s=n.length;if(s===0)return;const o=ms(dn(e)),u=n.indexOf(o),h=u===-1?t===1?0:s-1:u+t;return n[h]}function f0(e){return bE(dn(e).body,1)||e}function xE(e){return bE(dn(e).body,-1)||e}function SE(e,t){if(!e)return null;const n=Zu(dn(e).body,tc()),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 iD(e){return SE(e,1)}function oD(e){return SE(e,-1)}function Tl(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!ft(n,s)}function aD(e){Zu(e,tc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function US(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 CE(){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 h0{nodesRef={current:[]};events=CE();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 wE=k.createContext(null),EE=k.createContext(null),Ci=()=>k.useContext(wE)?.id||null,So=e=>{const t=k.useContext(EE);return e??t};function RE(e){const t=Aa(),n=So(e),s=Ci();return He(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function lD(e){const{children:t,id:n}=e,s=Ci();return S.jsx(wE.Provider,{value:k.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function cD(e){const{children:t,externalTree:n}=e,s=Gn(()=>n??new h0).current;return S.jsx(EE.Provider,{value:s,children:t})}function Wl(e){return`data-base-ui-${e}`}function fv(e,t,n){if(n&&!Vl(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 nc={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},zf=null;class uD{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 Hf=new uD;class Is{static create(){return new Is}static request(t){return Hf.request(t)}static cancel(t){return Hf.cancel(t)}currentId=zf;request(t){this.cancel(),this.currentId=Hf.request(()=>{this.currentId=zf,t()})}cancel=()=>{this.currentId!==zf&&(Hf.cancel(this.currentId),this.currentId=zf)};disposeEffect=()=>this.cancel}function Ju(){const e=Gn(Is.create).current;return Z2(e.disposeEffect),e}function _r(e){return e?.ownerDocument||document}const ql=k.forwardRef(function(t,n){const[s,o]=k.useState();He(()=>{eE&&o("button")},[]);const u={tabIndex:0,role:s};return S.jsx("span",{...t,ref:n,style:nc,"aria-hidden":s?void 0:!0,...u,"data-base-ui-focus-guard":""})});let WS=0;function dh(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(WS);const u=()=>e?.focus({preventScroll:n});o?u():WS=requestAnimationFrame(u)}const Ll={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function qS(e){return e==="inert"?Ll.inert:e==="aria-hidden"?Ll["aria-hidden"]:Ll.none}let Vf=new WeakSet,Ff={},hv=0;const kE=e=>e&&(e.host||kE(e.parentNode)),dD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=kE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function fD(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=dD(t,e),a=new Set,l=new Set(h),d=[];Ff[o]||(Ff[o]=new WeakMap);const p=Ff[o];h.forEach(f),g(t),a.clear();function f(x){!x||a.has(x)||(a.add(x),x.parentNode&&f(x.parentNode))}function g(x){!x||l.has(x)||[].forEach.call(x.children,C=>{if(yo(C)!=="script")if(a.has(C))g(C);else{const w=u?C.getAttribute(u):null,_=w!==null&&w!=="false",y=qS(u),v=(y.get(C)||0)+1,b=(p.get(C)||0)+1;y.set(C,v),p.set(C,b),d.push(C),v===1&&_&&Vf.add(C),b===1&&C.setAttribute(o,""),!_&&u&&C.setAttribute(u,u==="inert"?"":"true")}})}return hv+=1,()=>{d.forEach(x=>{const C=qS(u),_=(C.get(x)||0)-1,y=(p.get(x)||0)-1;C.set(x,_),p.set(x,y),_||(!Vf.has(x)&&u&&x.removeAttribute(u),Vf.delete(x)),y||x.removeAttribute(o)}),hv-=1,hv||(Ll.inert=new WeakMap,Ll["aria-hidden"]=new WeakMap,Ll.none=new WeakMap,Vf=new WeakSet,Ff={})}}function hD(e,t=!1,n=!1){const s=dn(e[0]).body;return fD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const TE=k.createContext(null),LE=()=>k.useContext(TE),pD=Wl("portal");function mD(e={}){const{ref:t,container:n,componentProps:s=tn,elementProps:o,elementState:u}=e,h=Aa(),l=LE()?.portalNode,[d,p]=k.useState(null),[f,g]=k.useState(null),x=k.useRef(null);He(()=>{if(n===null){x.current&&(x.current=null,g(null),p(null));return}if(h==null)return;const _=(n&&(G_(n)?n:n.current))??l??document.body;if(_==null){x.current&&(x.current=null,g(null),p(null));return}x.current!==_&&(x.current=_,g(null),p(_))},[n,l,h]);const C=ct("div",s,{ref:[t,g],state:u,props:[{id:h,[pD]:""},o]});return{portalNode:f,portalSubtree:d&&C?er.createPortal(C,d):null}}const dp=k.forwardRef(function(t,n){const{children:s,container:o,className:u,render:h,renderGuards:a,...l}=t,{portalNode:d,portalSubtree:p}=mD({container:o,ref:n,componentProps:t,elementProps:l}),f=k.useRef(null),g=k.useRef(null),x=k.useRef(null),C=k.useRef(null),[w,_]=k.useState(null),y=w?.modal,v=w?.open,b=typeof a=="boolean"?a:!!w&&!w.modal&&w.open&&!!d;k.useEffect(()=>{if(!d||y)return;function T(A){d&&Tl(A)&&(A.type==="focusin"?US:aD)(d)}return d.addEventListener("focusin",T,!0),d.addEventListener("focusout",T,!0),()=>{d.removeEventListener("focusin",T,!0),d.removeEventListener("focusout",T,!0)}},[d,y]),k.useEffect(()=>{!d||v||US(d)},[v,d]);const E=k.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:x,afterInsideRef:C,portalNode:d,setFocusManagerState:_}),[d]);return S.jsxs(k.Fragment,{children:[p,S.jsxs(TE.Provider,{value:E,children:[b&&d&&S.jsx(ql,{"data-type":"outside",ref:f,onFocus:T=>{if(Tl(T,d))x.current?.focus();else{const A=w?w.domReference:null;xE(A)?.focus()}}}),b&&d&&S.jsx("span",{"aria-owns":d.id,style:KO}),d&&er.createPortal(s,d),b&&d&&S.jsx(ql,{"data-type":"outside",ref:g,onFocus:T=>{if(Tl(T,d))C.current?.focus();else{const A=w?w.domReference:null;f0(A)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Ue(Ca,T.nativeEvent))}}})]})]})});function Yo(e){return e==null?e:"current"in e?e.current:e}function gD(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 GS=20;let ro=[];function p0(){ro=ro.filter(e=>e.isConnected)}function vD(e){p0(),e&&yo(e)!=="body"&&(ro.push(e),ro.length>GS&&(ro=ro.slice(-GS)))}function pv(){return p0(),ro[ro.length-1]}function _D(e){if(!e)return null;const t=tc();return yE(e,t)?e:Zu(e,t)[0]||e}function yD(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():zr(e).display!=="none"}function $S(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=tc(),o=sD(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return yE(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 fp(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:x,beforeContentFocusGuardRef:C,externalTree:w}=e,_="rootStore"in t?t.rootStore:t,y=_.useState("open"),v=_.useState("domReferenceElement"),b=_.useState("floatingElement"),{events:E,dataRef:T}=_.context,A=De(()=>T.current.floatingContext?.nodeId),M=De(f),L=u===!1,D=s_(v)&&L,H=hn(o),z=hn(u),q=hn(h),j=hn(p),K=So(w),$=LE(),V=k.useRef(null),G=k.useRef(null),U=k.useRef(!1),P=k.useRef(!1),B=k.useRef(!1),I=k.useRef(-1),W=k.useRef(""),Y=k.useRef(""),J=Qt(),Z=Qt(),ee=Ju(),X=$!=null,F=ju(b),se=De((he=F)=>he?Zu(he,tc()):[]),ne=De(he=>{const ue=se(he);return H.current.map(()=>ue).filter(Boolean).flat()});k.useEffect(()=>{if(s||!l)return;function he(Ie){Ie.key==="Tab"&&ft(F,ms(dn(F)))&&se().length===0&&!D&&fn(Ie)}const ue=dn(F);return ue.addEventListener("keydown",he),()=>{ue.removeEventListener("keydown",he)}},[s,v,F,l,H,D,se,ne]),k.useEffect(()=>{if(s||!b)return;function he(ue){const Ie=Pn(ue),Ae=se().indexOf(Ie);Ae!==-1&&(I.current=Ae)}return b.addEventListener("focusin",he),()=>{b.removeEventListener("focusin",he)}},[s,b,se]),k.useEffect(()=>{if(s||!y)return;const he=dn(F);function ue(){B.current=!1}function Ie(Ae){const be=Pn(Ae),Oe=ft(b,be)||ft(v,be)||ft($?.portalNode,be);B.current=!Oe,Y.current=Ae.pointerType||"keyboard"}function Me(){Y.current="keyboard"}return he.addEventListener("pointerdown",Ie,!0),he.addEventListener("pointerup",ue,!0),he.addEventListener("pointercancel",ue,!0),he.addEventListener("keydown",Me,!0),()=>{he.removeEventListener("pointerdown",Ie,!0),he.removeEventListener("pointerup",ue,!0),he.removeEventListener("pointercancel",ue,!0),he.removeEventListener("keydown",Me,!0)}},[s,b,v,F,y,$]),k.useEffect(()=>{if(s||!d)return;function he(){P.current=!0,Z.start(0,()=>{P.current=!1})}function ue(be){const Oe=be.relatedTarget,me=be.currentTarget,de=Pn(be);queueMicrotask(()=>{const xe=A(),We=_.context.triggerElements,nt=!(ft(v,Oe)||ft(b,Oe)||ft(Oe,b)||ft($?.portalNode,Oe)||Oe!=null&&We.hasElement(Oe)||We.hasMatchingElement(Ve=>ft(Ve,Oe))||Oe?.hasAttribute(Wl("focus-guard"))||K&&(pa(K.nodesRef.current,xe).find(Ve=>ft(Ve.context?.elements.floating,Oe)||ft(Ve.context?.elements.domReference,Oe))||zS(K.nodesRef.current,xe).find(Ve=>[Ve.context?.elements.floating,ju(Ve.context?.elements.floating)].includes(Oe)||Ve.context?.elements.domReference===Oe)));if(me===v&&F&&$S(F,H),a&&me!==v&&!yD(de)&&ms(dn(F))===dn(F).body){if(en(F)&&(F.focus(),a==="popup")){ee.request(()=>{F.focus()});return}const Ve=I.current,rt=se(),Je=rt[Ve]||rt[rt.length-1]||F;en(Je)&&Je.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(D||!l)&&Oe&&nt&&!P.current&&(D||Oe!==pv())&&(U.current=!0,_.setOpen(!1,Ue(Ca,be)))})}function Ie(){B.current||(T.current.insideReactTree=!0,J.start(0,()=>{T.current.insideReactTree=!1}))}const Me=en(v)?v:null,Ae=[];if(!(!b&&!Me))return Me&&(Me.addEventListener("focusout",ue),Me.addEventListener("pointerdown",he),Ae.push(()=>{Me.removeEventListener("focusout",ue),Me.removeEventListener("pointerdown",he)})),b&&(b.addEventListener("focusout",ue),$&&(b.addEventListener("focusout",Ie,!0),Ae.push(()=>{b.removeEventListener("focusout",Ie,!0)})),Ae.push(()=>{b.removeEventListener("focusout",ue)})),()=>{Ae.forEach(be=>{be()})}},[s,v,b,F,l,K,$,_,d,a,se,D,A,H,T,J,Z,ee]);const re=k.useRef(null),oe=k.useRef(null),le=os(re,C,$?.beforeInsideRef),_e=os(oe,$?.afterInsideRef);k.useEffect(()=>{if(s||!b||!y)return;const he=Array.from($?.portalNode?.querySelectorAll(`[${Wl("portal")}]`)||[]),Ie=(K?zS(K.nodesRef.current,A()):[]).find(be=>s_(be.context?.elements.domReference||null))?.context?.elements.domReference,Me=[b,Ie,...he,...M(),V.current,G.current,re.current,oe.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Yo(x),Yo(g),D?v:null].filter(be=>be!=null),Ae=hD(Me,l||D);return()=>{Ae()}},[y,s,v,b,l,H,$,D,K,A,M,g,x]),He(()=>{if(!y||s||!en(F))return;const he=dn(F),ue=ms(he);queueMicrotask(()=>{const Ie=ne(F),Me=z.current,Ae=typeof Me=="function"?Me(j.current||""):Me;if(Ae===void 0||Ae===!1)return;let be;Ae===!0||Ae===null?be=Ie[0]||F:be=Yo(Ae),be=be||Ie[0]||F,!ft(F,ue)&&dh(be,{preventScroll:be===F})})},[s,y,F,L,ne,z,j]),He(()=>{if(s||!F)return;const he=dn(F),ue=ms(he);vD(ue);function Ie(be){if(be.open||(W.current=gD(be.nativeEvent,Y.current)),be.reason===jr&&be.nativeEvent.type==="mouseleave"&&(U.current=!0),be.reason===s0)if(be.nested)U.current=!1;else if(iE(be.nativeEvent)||oE(be.nativeEvent))U.current=!1;else{let Oe=!1;document.createElement("div").focus({get preventScroll(){return Oe=!0,!1}}),Oe?U.current=!1:U.current=!0}}E.on("openchange",Ie);const Me=he.createElement("span");Me.setAttribute("tabindex","-1"),Me.setAttribute("aria-hidden","true"),Object.assign(Me.style,nc),X&&v&&v.insertAdjacentElement("afterend",Me);function Ae(){const be=q.current;let Oe=typeof be=="function"?be(W.current):be;if(Oe===void 0||Oe===!1)return null;if(Oe===null&&(Oe=!0),typeof Oe=="boolean"){const de=v||pv();return de&&de.isConnected?de:Me}const me=v||pv()||Me;return Yo(Oe)||me}return()=>{E.off("openchange",Ie);const be=ms(he),Oe=ft(b,be)||K&&pa(K.nodesRef.current,A(),!1).some(de=>ft(de.context?.elements.floating,be)),me=Ae();queueMicrotask(()=>{const de=_D(me),xe=typeof q.current!="boolean";q.current&&!U.current&&en(de)&&(!(!xe&&de!==be&&be!==he.body)||Oe)&&de.focus({preventScroll:!0}),Me.remove()})}},[s,b,F,q,T,E,K,X,v,A]),k.useEffect(()=>{queueMicrotask(()=>{U.current=!1})},[s]),k.useEffect(()=>{if(s||!y)return;function he(Ie){Pn(Ie)?.closest(`[${y2}]`)&&(P.current=!0)}const ue=dn(F);return ue.addEventListener("pointerdown",he,!0),()=>{ue.removeEventListener("pointerdown",he,!0)}},[s,y,F]),He(()=>{if(!s&&$)return $.setFocusManagerState({modal:l,closeOnFocusOut:d,open:y,onOpenChange:_.setOpen,domReference:v}),()=>{$.setFocusManagerState(null)}},[s,$,l,y,_,d,v]),He(()=>{if(!(s||!F))return $S(F,H),()=>{queueMicrotask(p0)}},[s,F,H]);const ve=!s&&(l?!D:!0)&&(X||l);return S.jsxs(k.Fragment,{children:[ve&&S.jsx(ql,{"data-type":"inside",ref:le,onFocus:he=>{if(l){const ue=ne();dh(ue[ue.length-1])}else $?.portalNode&&(U.current=!1,Tl(he,$.portalNode)?f0(v)?.focus():Yo(x??$.beforeOutsideRef)?.focus())}}),n,ve&&S.jsx(ql,{"data-type":"inside",ref:_e,onFocus:he=>{l?dh(ne()[0]):$?.portalNode&&(d&&(U.current=!0),Tl(he,$.portalNode)?xE(v)?.focus():Yo(g??$.afterOutsideRef)?.focus())}})]})}function ed(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=k.useRef(void 0),f=Ju(),g=Qt(),x=k.useMemo(()=>({onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const w=p.current,_=C.nativeEvent,y=n.select("open");if(C.button!==0||u==="click"||Vl(w,!0)&&a)return;const v=s.current.openEvent,b=v?.type,E=n.select("domReferenceElement")!==C.currentTarget,T=y&&E||!(y&&h&&(!(v&&l)||b==="click"||b==="mousedown"));if(l0(_.target)){const M=Ue(fa,_,_.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(fa,_,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(Vl(w,!0)&&a)return;const _=n.select("open"),y=s.current.openEvent,v=n.select("domReferenceElement")!==C.currentTarget,b=_&&v||!(_&&h&&(!(y&&l)||aE(y))),E=Ue(fa,C.nativeEvent,C.currentTarget);b&&w==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(b,E)},onKeyDown(){p.current=void 0}}),[s,u,a,n,l,h,f,g,d]);return k.useMemo(()=>o?{reference:x}:tn,[o,x])}function KS(e,t,n){let{reference:s,floating:o}=e;const u=ts(t),h=d0(t),a=u0(h),l=Br(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 x;switch(l){case"top":x={x:p,y:s.y-o.height};break;case"bottom":x={x:p,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:f};break;case"left":x={x:s.x-o.width,y:f};break;default:x={x:s.x,y:s.y}}switch(xo(t)){case"start":x[h]-=g*(n&&d?-1:1);break;case"end":x[h]+=g*(n&&d?-1:1);break}return x}const bD=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}=KS(d,s,l),g=s,x={},C=0;for(let w=0;w<a.length;w++){const{name:_,fn:y}=a[w],{x:v,y:b,data:E,reset:T}=await y({x:p,y:f,initialPlacement:s,placement:g,strategy:o,middlewareData:x,rects:d,platform:h,elements:{reference:e,floating:t}});p=v??p,f=b??f,x={...x,[_]:{...x[_],...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}=KS(d,g,l)),w=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:x}};async function Bu(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:x=0}=bi(t,e),C=lE(x),_=a[g?f==="floating"?"reference":"floating":f],y=Ph(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(_)))==null||n?_:_.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:l})),v=f==="floating"?{x:s,y:o,width:h.floating.width,height:h.floating.height}:h.reference,b=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(b))?await(u.getScale==null?void 0:u.getScale(b))||{x:1,y:1}:{x:1,y:1},T=Ph(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(y.top-T.top+C.top)/E.y,bottom:(T.bottom-y.bottom+C.bottom)/E.y,left:(y.left-T.left+C.left)/E.x,right:(T.right-y.right+C.right)/E.x}}const xD=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:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,..._}=bi(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const y=Br(o),v=ts(a),b=Br(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(d.floating)),T=g||(b||!w?[Dh(a)]:B4(a)),A=C!=="none";!g&&A&&T.push(...F4(a,w,C,E));const M=[a,...T],L=await Bu(t,_),D=[];let H=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&D.push(L[y]),f){const K=N4(o,h,E);D.push(L[K[0]],L[K[1]])}if(H=[...H,{placement:o,overflows:D}],!D.every(K=>K<=0)){var z,q;const K=(((z=u.flip)==null?void 0:z.index)||0)+1,$=M[K];if($&&(!(f==="alignment"?v!==ts($):!1)||H.every(U=>ts(U.placement)===v?U.overflows[0]>0:!0)))return{data:{index:K,overflows:H},reset:{placement:$}};let V=(q=H.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(x){case"bestFit":{var j;const G=(j=H.filter(U=>{if(A){const P=ts(U.placement);return P===v||P==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(P=>P>0).reduce((P,B)=>P+B,0)]).sort((U,P)=>U[1]-P[1])[0])==null?void 0:j[0];G&&(V=G);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function YS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function XS(e){return D4.some(t=>e[t]>=0)}const SD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...o}=bi(e,t);switch(s){case"referenceHidden":{const u=await Bu(t,{...o,elementContext:"reference"}),h=YS(u,n.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:XS(h)}}}case"escaped":{const u=await Bu(t,{...o,altBoundary:!0}),h=YS(u,n.floating);return{data:{escapedOffsets:h,escaped:XS(h)}}}default:return{}}}}},AE=new Set(["left","top"]);async function CD(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),h=Br(n),a=xo(n),l=ts(n)==="y",d=AE.has(h)?-1:1,p=u&&l?-1:1,f=bi(t,e);let{mainAxis:g,crossAxis:x,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"&&(x=a==="end"?C*-1:C),l?{x:x*p,y:g*d}:{x:g*d,y:x*p}}const wD=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 CD(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}}}}},ED=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:_=>{let{x:y,y:v}=_;return{x:y,y:v}}},...l}=bi(e,t),d={x:n,y:s},p=await Bu(t,l),f=ts(Br(o)),g=c0(f);let x=d[g],C=d[f];if(u){const _=g==="y"?"top":"left",y=g==="y"?"bottom":"right",v=x+p[_],b=x-p[y];x=i_(v,x,b)}if(h){const _=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=C+p[_],b=C-p[y];C=i_(v,C,b)}const w=a.fn({...t,[g]:x,[f]:C});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[g]:u,[f]:h}}}}}},RD=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}=bi(e,t),p={x:n,y:s},f=ts(o),g=c0(f);let x=p[g],C=p[f];const w=bi(a,t),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const b=g==="y"?"height":"width",E=u.reference[g]-u.floating[b]+_.mainAxis,T=u.reference[g]+u.reference[b]-_.mainAxis;x<E?x=E:x>T&&(x=T)}if(d){var y,v;const b=g==="y"?"width":"height",E=AE.has(Br(o)),T=u.reference[f]-u.floating[b]+(E&&((y=h.offset)==null?void 0:y[f])||0)+(E?0:_.crossAxis),A=u.reference[f]+u.reference[b]+(E?0:((v=h.offset)==null?void 0:v[f])||0)-(E?_.crossAxis:0);C<T?C=T:C>A&&(C=A)}return{[g]:x,[f]:C}}}},kD=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}=bi(e,t),p=await Bu(t,d),f=Br(o),g=xo(o),x=ts(o)==="y",{width:C,height:w}=u.floating;let _,y;f==="top"||f==="bottom"?(_=f,y=g===(await(h.isRTL==null?void 0:h.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,_=g==="end"?"top":"bottom");const v=w-p.top-p.bottom,b=C-p.left-p.right,E=Fl(w-p[_],v),T=Fl(C-p[y],b),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=b),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=v),A&&!g){const H=Pr(p.left,0),z=Pr(p.right,0),q=Pr(p.top,0),j=Pr(p.bottom,0);x?L=C-2*(H!==0||z!==0?H+z:Pr(p.left,p.right)):M=w-2*(q!==0||j!==0?q+j:Pr(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 OE(e){const t=zr(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=Mh(n)!==u||Mh(s)!==h;return a&&(n=u,s=h),{width:n,height:s,$:a}}function m0(e){return Nt(e)?e:e.contextElement}function Al(e){const t=m0(e);if(!en(t))return zs(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=OE(t);let h=(u?Mh(n.width):n.width)/s,a=(u?Mh(n.height):n.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!a||!Number.isFinite(a))&&(a=1),{x:h,y:a}}const TD=zs(0);function ME(e){const t=Rn(e);return!ap()||!t.visualViewport?TD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rn(e)?!1:t}function Ea(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=m0(e);let h=zs(1);t&&(s?Nt(s)&&(h=Al(s)):h=Al(e));const a=LD(u,n,s)?ME(u):zs(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),x=s&&Nt(s)?Rn(s):s;let C=g,w=Xv(C);for(;w&&s&&x!==C;){const _=Al(w),y=w.getBoundingClientRect(),v=zr(w),b=y.left+(w.clientLeft+parseFloat(v.paddingLeft))*_.x,E=y.top+(w.clientTop+parseFloat(v.paddingTop))*_.y;l*=_.x,d*=_.y,p*=_.x,f*=_.y,l+=b,d+=E,C=Rn(w),w=Xv(C)}}return Ph({width:p,height:f,x:l,y:d})}function hp(e,t){const n=lp(e).scrollLeft;return t?t.left+n:Ea(Us(e)).left+n}function DE(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-hp(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function AD(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",h=Us(s),a=t?op(t.floating):!1;if(s===h||a&&u)return n;let l={scrollLeft:0,scrollTop:0},d=zs(1);const p=zs(0),f=en(s);if((f||!f&&!u)&&((yo(s)!=="body"||ka(h))&&(l=lp(s)),en(s))){const x=Ea(s);d=Al(s),p.x=x.x+s.clientLeft,p.y=x.y+s.clientTop}const g=h&&!f&&!u?DE(h,l):zs(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 OD(e){return Array.from(e.getClientRects())}function MD(e){const t=Us(e),n=lp(e),s=e.ownerDocument.body,o=Pr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=Pr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+hp(e);const a=-n.scrollTop;return zr(s).direction==="rtl"&&(h+=Pr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const QS=25;function DD(e,t){const n=Rn(e),s=Us(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=ap();(!p||p&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=hp(s);if(d<=0){const p=s.ownerDocument,f=p.body,g=getComputedStyle(f),x=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(s.clientWidth-f.clientWidth-x);C<=QS&&(u-=C)}else d<=QS&&(u+=d);return{width:u,height:h,x:a,y:l}}const PD=new Set(["absolute","fixed"]);function ID(e,t){const n=Ea(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=en(e)?Al(e):zs(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 ZS(e,t,n){let s;if(t==="viewport")s=DD(e,n);else if(t==="document")s=MD(Us(e));else if(Nt(t))s=ID(t,n);else{const o=ME(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ph(s)}function PE(e,t){const n=Vs(e);return n===t||!Nt(n)||Bs(n)?!1:zr(n).position==="fixed"||PE(n,t)}function jD(e,t){const n=t.get(e);if(n)return n;let s=co(e,[],!1).filter(a=>Nt(a)&&yo(a)!=="body"),o=null;const u=zr(e).position==="fixed";let h=u?Vs(e):e;for(;Nt(h)&&!Bs(h);){const a=zr(h),l=$_(h);!l&&a.position==="fixed"&&(o=null),(u?!l&&!o:!l&&a.position==="static"&&!!o&&PD.has(o.position)||ka(h)&&!l&&PE(e,h))?s=s.filter(p=>p!==h):o=a,h=Vs(h)}return t.set(e,s),s}function ND(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?op(t)?[]:jD(t,this._c):[].concat(n),s],a=h[0],l=h.reduce((d,p)=>{const f=ZS(t,p,o);return d.top=Pr(f.top,d.top),d.right=Fl(f.right,d.right),d.bottom=Fl(f.bottom,d.bottom),d.left=Pr(f.left,d.left),d},ZS(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function BD(e){const{width:t,height:n}=OE(e);return{width:t,height:n}}function zD(e,t,n){const s=en(t),o=Us(t),u=n==="fixed",h=Ea(e,!0,u,t);let a={scrollLeft:0,scrollTop:0};const l=zs(0);function d(){l.x=hp(o)}if(s||!s&&!u)if((yo(t)!=="body"||ka(o))&&(a=lp(t)),s){const x=Ea(t,!0,u,t);l.x=x.x+t.clientLeft,l.y=x.y+t.clientTop}else o&&d();u&&!s&&o&&d();const p=o&&!s&&!u?DE(o,a):zs(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 mv(e){return zr(e).position==="static"}function JS(e,t){if(!en(e)||zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Us(e)===n&&(n=n.ownerDocument.body),n}function IE(e,t){const n=Rn(e);if(op(e))return n;if(!en(e)){let o=Vs(e);for(;o&&!Bs(o);){if(Nt(o)&&!mv(o))return o;o=Vs(o)}return n}let s=JS(e,t);for(;s&&yO(s)&&mv(s);)s=JS(s,t);return s&&Bs(s)&&mv(s)&&!$_(s)?n:s||wO(e)||n}const HD=async function(e){const t=this.getOffsetParent||IE,n=this.getDimensions,s=await n(e.floating);return{reference:zD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function VD(e){return zr(e).direction==="rtl"}const FD={convertOffsetParentRelativeRectToViewportRelativeRect:AD,getDocumentElement:Us,getClippingRect:ND,getOffsetParent:IE,getElementRects:HD,getClientRects:OD,getDimensions:BD,getScale:Al,isElement:Nt,isRTL:VD};function jE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UD(e,t){let n=null,s;const o=Us(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:x}=d;if(a||t(),!g||!x)return;const C=wl(f),w=wl(o.clientWidth-(p+g)),_=wl(o.clientHeight-(f+x)),y=wl(p),b={rootMargin:-C+"px "+-w+"px "+-_+"px "+-y+"px",threshold:Pr(0,Fl(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&&!jE(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return h(!0),u}function eC(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=m0(e),p=o||u?[...d?co(d):[],...co(t)]:[];p.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),u&&y.addEventListener("resize",n)});const f=d&&a?UD(d,n):null;let g=-1,x=null;h&&(x=new ResizeObserver(y=>{let[v]=y;v&&v.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),d&&!l&&x.observe(d),x.observe(t));let C,w=l?Ea(e):null;l&&_();function _(){const y=Ea(e);w&&!jE(w,y)&&n(),w=y,C=requestAnimationFrame(_)}return n(),()=>{var y;p.forEach(v=>{o&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),f?.(),(y=x)==null||y.disconnect(),x=null,l&&cancelAnimationFrame(C)}}const WD=wD,qD=ED,GD=xD,$D=kD,KD=SD,YD=RD,XD=(e,t,n)=>{const s=new Map,o={platform:FD,...n},u={...o.platform,_c:s};return bD(e,t,{...o,platform:u})};var QD=typeof document<"u",ZD=function(){},fh=QD?k.useLayoutEffect:ZD;function Bh(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(!Bh(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)&&!Bh(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function NE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tC(e,t){const n=NE(e);return Math.round(t*n)/n}function gv(e){const t=k.useRef(e);return fh(()=>{t.current=e}),t}function JD(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]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=k.useState(s);Bh(g,s)||x(s);const[C,w]=k.useState(null),[_,y]=k.useState(null),v=k.useCallback(U=>{U!==A.current&&(A.current=U,w(U))},[]),b=k.useCallback(U=>{U!==M.current&&(M.current=U,y(U))},[]),E=u||C,T=h||_,A=k.useRef(null),M=k.useRef(null),L=k.useRef(p),D=l!=null,H=gv(l),z=gv(o),q=gv(d),j=k.useCallback(()=>{if(!A.current||!M.current)return;const U={placement:t,strategy:n,middleware:g};z.current&&(U.platform=z.current),XD(A.current,M.current,U).then(P=>{const B={...P,isPositioned:q.current!==!1};K.current&&!Bh(L.current,B)&&(L.current=B,er.flushSync(()=>{f(B)}))})},[g,t,n,z,q]);fh(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[d]);const K=k.useRef(!1);fh(()=>(K.current=!0,()=>{K.current=!1}),[]),fh(()=>{if(E&&(A.current=E),T&&(M.current=T),E&&T){if(H.current)return H.current(E,T,j);j()}},[E,T,j,H,D]);const $=k.useMemo(()=>({reference:A,floating:M,setReference:v,setFloating:b}),[v,b]),V=k.useMemo(()=>({reference:E,floating:T}),[E,T]),G=k.useMemo(()=>{const U={position:n,left:0,top:0};if(!V.floating)return U;const P=tC(V.floating,p.x),B=tC(V.floating,p.y);return a?{...U,transform:"translate("+P+"px, "+B+"px)",...NE(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:B}},[n,a,V.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:j,refs:$,elements:V,floatingStyles:G}),[p,j,$,V,G])}const e6=(e,t)=>({...WD(e),options:[e,t]}),t6=(e,t)=>({...qD(e),options:[e,t]}),n6=(e,t)=>({...YD(e),options:[e,t]}),r6=(e,t)=>({...GD(e),options:[e,t]}),s6=(e,t)=>({...$D(e),options:[e,t]}),i6=(e,t)=>({...KD(e),options:[e,t]}),o6={intentional:"onClick",sloppy:"onPointerDown"};function a6(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function pp(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:x=!1,referencePressEvent:C="sloppy",ancestorScroll:w=!1,bubbles:_,externalTree:y}=t,v=So(y),b=De(typeof f=="function"?f:()=>!1),E=typeof f=="function"?b:f,T=k.useRef(!1),{escapeKey:A,outsidePress:M}=a6(_),L=k.useRef(null),D=Qt(),H=Qt(),z=De(()=>{H.clear(),l.current.insideReactTree=!1}),q=k.useRef(!1),j=k.useRef(""),K=De(re=>{j.current=re.pointerType}),$=De(()=>{const re=j.current,oe=re==="pen"||!re?"mouse":re,le=typeof g=="function"?g():g;return typeof le=="string"?le:le[oe]}),V=De(re=>{if(!s||!d||!p||re.key!=="Escape"||q.current)return;const oe=l.current.floatingContext?.nodeId,le=v?pa(v.nodesRef.current,oe):[];if(!A&&le.length>0){let he=!0;if(le.forEach(ue=>{ue.context?.open&&!ue.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const _e=M4(re)?re.nativeEvent:re,ve=Ue(cp,_e);n.setOpen(!1,ve),!A&&!ve.isPropagationAllowed&&re.stopPropagation()}),G=De(re=>{const oe=$();return oe==="intentional"&&re.type!=="click"||oe==="sloppy"&&re.type==="click"}),U=De(()=>{l.current.insideReactTree=!0,H.start(0,z)}),P=De((re,oe=!1)=>{if(G(re)){z();return}if(l.current.insideReactTree){z();return}if($()==="intentional"&&oe||typeof E=="function"&&!E(re))return;const le=Pn(re),_e=`[${Wl("inert")}]`,ve=dn(n.select("floatingElement")).querySelectorAll(_e),he=n.context.triggerElements;if(le&&(he.hasElement(le)||he.hasMatchingElement(be=>ft(be,le))))return;let ue=Nt(le)?le:null;for(;ue&&!Bs(ue);){const be=Vs(ue);if(Bs(be)||!Nt(be))break;ue=be}if(ve.length&&Nt(le)&&!A4(le)&&!ft(le,n.select("floatingElement"))&&Array.from(ve).every(be=>!ft(ue,be)))return;if(en(le)&&!("touches"in re)){const be=Bs(le),Oe=zr(le),me=/auto|scroll/,de=be||me.test(Oe.overflowX),xe=be||me.test(Oe.overflowY),We=de&&le.clientWidth>0&&le.scrollWidth>le.clientWidth,nt=xe&&le.clientHeight>0&&le.scrollHeight>le.clientHeight,Ve=Oe.direction==="rtl",rt=nt&&(Ve?re.offsetX<=le.offsetWidth-le.clientWidth:re.offsetX>le.clientWidth),Je=We&&re.offsetY>le.clientHeight;if(rt||Je)return}const Ie=l.current.floatingContext?.nodeId,Me=v&&pa(v.nodesRef.current,Ie).some(be=>ps(re,be.context?.elements.floating));if(ps(re,n.select("floatingElement"))||ps(re,n.select("domReferenceElement"))||Me)return;const Ae=v?pa(v.nodesRef.current,Ie):[];if(Ae.length>0){let be=!0;if(Ae.forEach(Oe=>{Oe.context?.open&&!Oe.context.dataRef.current.__outsidePressBubbles&&(be=!1)}),!be)return}n.setOpen(!1,Ue(s0,re)),z()}),B=De(re=>{$()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!d||ps(re,n.select("floatingElement"))||ps(re,n.select("domReferenceElement"))||P(re)}),I=De(re=>{if($()!=="sloppy"||!n.select("open")||!d||ps(re,n.select("floatingElement"))||ps(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)}))}),W=De(re=>{const oe=Pn(re);function le(){I(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),Y=De(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"?B(re):P(re,oe),le?.removeEventListener(re.type,_e)}le?.addEventListener(re.type,_e)}),J=De(re=>{if($()!=="sloppy"||!L.current||ps(re,n.select("floatingElement"))||ps(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),ve=Math.sqrt(le*le+_e*_e);ve>5&&(L.current.dismissOnTouchEnd=!0),ve>10&&(P(re),D.clear(),L.current=null)}),Z=De(re=>{const oe=Pn(re);function le(){J(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)}),ee=De(re=>{$()!=="sloppy"||!L.current||ps(re,n.select("floatingElement"))||ps(re,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&P(re),D.clear(),L.current=null)}),X=De(re=>{const oe=Pn(re);function le(){ee(re),oe?.removeEventListener(re.type,le)}oe?.addEventListener(re.type,le)});k.useEffect(()=>{if(!s||!d)return;l.current.__escapeKeyBubbles=A,l.current.__outsidePressBubbles=M;const re=new wa;function oe(ue){n.setOpen(!1,Ue(Mn,ue))}function le(){re.clear(),q.current=!0}function _e(){re.start(ap()?5:0,()=>{q.current=!1})}const ve=dn(o);ve.addEventListener("pointerdown",K,!0),p&&(ve.addEventListener("keydown",V),ve.addEventListener("compositionstart",le),ve.addEventListener("compositionend",_e)),E&&(ve.addEventListener("click",Y,!0),ve.addEventListener("pointerdown",Y,!0),ve.addEventListener("touchstart",W,!0),ve.addEventListener("touchmove",Z,!0),ve.addEventListener("touchend",X,!0),ve.addEventListener("mousedown",Y,!0));let he=[];return w&&(Nt(h)&&(he=co(h)),Nt(o)&&(he=he.concat(co(o))),!Nt(u)&&u&&u.contextElement&&(he=he.concat(co(u.contextElement)))),he=he.filter(ue=>ue!==ve.defaultView?.visualViewport),he.forEach(ue=>{ue.addEventListener("scroll",oe,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",K,!0),p&&(ve.removeEventListener("keydown",V),ve.removeEventListener("compositionstart",le),ve.removeEventListener("compositionend",_e)),E&&(ve.removeEventListener("click",Y,!0),ve.removeEventListener("pointerdown",Y,!0),ve.removeEventListener("touchstart",W,!0),ve.removeEventListener("touchmove",Z,!0),ve.removeEventListener("touchend",X,!0),ve.removeEventListener("mousedown",Y,!0)),he.forEach(ue=>{ue.removeEventListener("scroll",oe)}),re.clear()}},[l,o,u,h,p,E,s,a,w,d,A,M,V,P,Y,B,W,Z,X,K,n]),k.useEffect(z,[E,z]);const F=k.useMemo(()=>({onKeyDown:V,...x&&{[o6[C]]:re=>{n.setOpen(!1,Ue(fa,re.nativeEvent))},...C!=="intentional"&&{onClick(re){n.setOpen(!1,Ue(fa,re.nativeEvent))}}}}),[V,n,x,C]),se=De(re=>{const oe=Pn(re.nativeEvent);!ft(n.select("floatingElement"),oe)||re.button!==0||(T.current=!0)}),ne=k.useMemo(()=>({onKeyDown:V,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:U,onMouseDownCapture:U,onPointerDownCapture:U,onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[V,se,U]);return k.useMemo(()=>d?{reference:F,floating:ne,trigger:F}:{},[d,F,ne])}var zh=Symbol("NOT_FOUND");function l6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function c6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function u6(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 nC=e=>Array.isArray(e)?e:[e];function d6(e){const t=Array.isArray(e[0])?e[0]:e;return u6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function f6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function h6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:zh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function p6(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 zh}function o(a,l){s(a)===zh&&(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 m6=(e,t)=>e===t;function g6(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 v6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=m6,maxSize:o=1,resultEqualityCheck:u}=n,h=g6(s);let a=0;const l=o<=1?h6(h):p6(o,h);function d(){let p=l.get(arguments);if(p===zh){if(p=e.apply(null,arguments),a++,u){const g=l.getEntries().find(x=>u(x.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 _6=class{constructor(e){this.value=e}deref(){return this.value}},y6=typeof WeakRef<"u"?WeakRef:_6,b6=0,rC=1;function Uf(){return{s:b6,v:void 0,o:null,p:null}}function BE(e,t={}){let n=Uf();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 x=arguments[f];if(typeof x=="function"||typeof x=="object"&&x!==null){let C=a.o;C===null&&(a.o=C=new WeakMap);const w=C.get(x);w===void 0?(a=Uf(),C.set(x,a)):a=w}else{let C=a.p;C===null&&(a.p=C=new Map);const w=C.get(x);w===void 0?(a=Uf(),C.set(x,a)):a=w}}const d=a;let p;if(a.s===rC)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 y6(p):p}return d.s=rC,d.v=p,p}return h.clearCache=()=>{n=Uf(),h.resetResultsCount()},h.resultsCount=()=>u,h.resetResultsCount=()=>{u=0},h}function zE(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()),l6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...l},{memoize:f,memoizeOptions:g=[],argsMemoize:x=BE,argsMemoizeOptions:C=[]}=p,w=nC(g),_=nC(C),y=d6(o),v=f(function(){return u++,d.apply(null,arguments)},...w),b=x(function(){h++;const T=f6(y,arguments);return a=v.apply(null,T),a},..._);return Object.assign(b,{resultFunc:d,memoizedResultFunc:v,dependencies:y,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var x6=zE(BE),S6=Object.assign((e,t=x6)=>{c6(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:()=>S6});zE({memoize:v6,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 C6=Xw();const w6=Y_(19),E6=w6?R6:k6;function Le(e,t,n,s,o){return E6(e,t,n,s,o)}function R6(e,t,n,s,o){const u=k.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return C6.useSyncExternalStore(e.subscribe,u,u)}function k6(e,t,n,s,o){return Qw.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>t(u,n,s,o))}class ma{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])){ma.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||ma.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};ma.prototype.setState.call(this,t)}}class g0 extends ma{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){k.useDebugValue(t),He(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){He(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);He(()=>{this.update(t)},n)}useControlledProp(t,n,s){k.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})),He(()=>{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)=>{k.useDebugValue(t);const u=this.selectors[t];return Le(this,u,n,s,o)};useContextCallback(t,n){k.useDebugValue(t);const s=De(n??sn);this.context[t]=s}useStateSetter(t){const n=k.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 T6={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 v0 extends g0{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:CE(),nested:n,noEmit:s,triggerElements:u},T6)}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 wi(e,t=!1,n=!1){const[s,o]=k.useState(e&&t?"idle":void 0),[u,h]=k.useState(e);return e&&!u&&(h(!0),o("starting")),!e&&u&&s!=="ending"&&!n&&o("ending"),!e&&!u&&s==="ending"&&o(void 0),He(()=>{if(!e&&u&&s!=="ending"&&n){const a=Is.request(()=>{o("ending")});return()=>{Is.cancel(a)}}},[e,u,s,n]),He(()=>{if(!e||t)return;const a=Is.request(()=>{o(void 0)});return()=>{Is.cancel(a)}},[t,e]),He(()=>{if(!e||!t)return;e&&u&&s!=="idle"&&o("starting");const a=Is.request(()=>{o("idle")});return()=>{Is.cancel(a)}},[t,e,u,o,s]),k.useMemo(()=>({mounted:u,setMounted:h,transitionStatus:s}),[u,s])}function L6(e,t=!1,n=!0){const s=Ju();return De((o,u=null)=>{s.cancel();const h=Yo(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 Vr(e){const{enabled:t=!0,open:n,ref:s,onComplete:o}=e,u=hn(n),h=De(o),a=L6(s,n);k.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function A6(e,t){const n=k.useRef(null);return k.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 HE(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=A6(e,n),h=De(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return He(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function VE(e){const t=e.useState("open");He(()=>{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 FE(e,t,n){const{mounted:s,setMounted:o,transitionStatus:u}=wi(e);t.useSyncedValues({mounted:s,transitionStatus:u});const h=De(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Vr({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:u}}class mp{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 O6(){return new v0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new mp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function UE(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:O6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tn,inactiveTriggerProps:tn,popupProps:tn}}const WE={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 _0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Aa(),u=Ci()!=null,h=Gn(()=>new v0({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new mp,floatingId:o,nested:u,noEmit:e.noEmit||!1})).current;return He(()=>{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 M6(e={}){const{nodeId:t,externalTree:n}=e,s=_0(e),o=e.rootContext||s,u={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[h,a]=k.useState(null),l=k.useRef(null),d=So(n);He(()=>{u.domReference&&(l.current=u.domReference)},[u.domReference]);const p=JD({...e,elements:{...u,...h&&{reference:h}}}),f=k.useCallback(M=>{const L=Nt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;a(L),p.refs.setReference(L)},[p.refs]),[g,x]=k.useState(null),[C,w]=k.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Nt(g)?g:null),o.useSyncedValue("floatingElement",C);const _=k.useCallback(M=>{(Nt(M)||M===null)&&(l.current=M,x(M)),(Nt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!Nt(M))&&p.refs.setReference(M)},[p.refs,x]),y=k.useCallback(M=>{w(M),p.refs.setFloating(M)},[p.refs]),v=k.useMemo(()=>({...p.refs,setReference:_,setFloating:y,setPositionReference:f,domReference:l}),[p.refs,_,y,f]),b=k.useMemo(()=>({...p.elements,domReference:u.domReference}),[p.elements,u.domReference]),E=o.useState("open"),T=o.useState("floatingId"),A=k.useMemo(()=>({...p,dataRef:o.context.dataRef,open:E,onOpenChange:o.setOpen,events:o.context.events,floatingId:T,refs:v,elements:b,nodeId:t,rootStore:o}),[p,v,b,t,o,E,T]);return He(()=>{o.context.dataRef.current.floatingContext=A;const M=d?.nodesRef.current.find(L=>L.id===t);M&&(M.context=A)}),k.useMemo(()=>({...p,context:A,refs:v,elements:b,rootStore:o}),[p,v,b,A,o])}function qE(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:o}=e,u=Aa(),h=Ci()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),d=t.useState(s?"popupElement":"positionerElement"),p=t.context.triggerElements,f=Gn(()=>new v0({open:a,referenceElement:l,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return He(()=>{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 vv=R4&&eE;function D6(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:s,dataRef:o}=n.context,{enabled:u=!0,visibleOnly:h=!0}=t,a=k.useRef(!1),l=Qt(),d=k.useRef(!0);k.useEffect(()=>{const f=n.select("domReferenceElement");if(!u)return;const g=Rn(f);function x(){!n.select("open")&&en(f)&&f===ms(dn(f))&&(a.current=!0)}function C(){d.current=!0}function w(){d.current=!1}return g.addEventListener("blur",x),vv&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",w,!0)),()=>{g.removeEventListener("blur",x),vv&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",w,!0))}},[n,u]),k.useEffect(()=>{if(!u)return;function f(g){(g.reason===fa||g.reason===cp)&&(a.current=!0)}return s.on("openchange",f),()=>{s.off("openchange",f)}},[s,u]);const p=k.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=Pn(f.nativeEvent);if(h&&Nt(g)){if(vv&&!f.relatedTarget){if(!d.current&&!l0(g))return}else if(!O4(g))return}n.setOpen(!0,Ue(Ah,f.nativeEvent,f.currentTarget))},onBlur(f){a.current=!1;const g=f.relatedTarget,x=f.nativeEvent,C=Nt(g)&&g.hasAttribute(Wl("focus-guard"))&&g.getAttribute("data-type")==="outside";l.start(0,()=>{const w=n.select("domReferenceElement"),_=ms(w?w.ownerDocument:document);!g&&_===w||ft(o.current.floatingContext?.refs.floating.current,_)||ft(w,_)||C||n.context.triggerElements.hasElement(f.relatedTarget)||n.setOpen(!1,Ue(Ah,x))})}}),[o,n,h,l]);return k.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const u_=Wl("safe-polygon"),P6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${sE}`;function I6(e){return e?!!e.closest(P6):!1}function GE(e){const t=k.useRef(void 0),n=k.useRef(!1),s=k.useRef(void 0),o=k.useRef(!0),u=k.useRef(!1),h=k.useRef(()=>{}),a=k.useRef(!1),l=Qt(),d=Qt(),p=k.useRef(void 0);return k.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 j6=new Set(["click","mousedown"]);function N6(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:x,unbindMouseMoveRef:C,restTimeoutPendingRef:w,openChangeTimeout:_,handleCloseOptionsRef:y}=GE(n),v=So(d),b=Ci(),E=De(()=>f.current?!0:h.current.openEvent?j6.has(h.current.openEvent.type):!1),T=De(()=>{const H=h.current.openEvent?.type;return H?.includes("mouse")&&H!=="mousedown"}),A=k.useCallback((H,z=!0)=>{const q=B6(l,p.current);q&&!g.current?_.start(q,()=>n.setOpen(!1,Ue(jr,H))):z&&(_.clear(),n.setOpen(!1,Ue(jr,H)))},[l,g,n,p,_]),M=De(()=>{C.current(),g.current=void 0}),L=De(()=>{if(x.current){const H=dn(o).body;H.style.pointerEvents="",H.removeAttribute(u_),x.current=!1}}),D=De(H=>{const z=Pn(H);if(!I6(z)){f.current=!1;return}f.current=!0});He(()=>{s||(p.current=void 0,w.current=!1,f.current=!1,M(),L())},[s,p,w,f,M,L]),k.useEffect(()=>()=>{M()},[M]),k.useEffect(()=>L,[L]),He(()=>{if(a&&s&&y.current?.blockPointerEvents&&T()&&Nt(u)&&o){x.current=!0;const H=dn(o).body;H.setAttribute(u_,"");const z=u,q=o,j=v?.nodesRef.current.find(K=>K.id===b)?.context?.elements.floating;return j&&(j.style.pointerEvents=""),H.style.pointerEvents="none",z.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{H.style.pointerEvents="",z.style.pointerEvents="",q.style.pointerEvents=""}}},[a,s,u,o,y,T,v,b,x]),k.useEffect(()=>{if(!a)return;function H(K){if(E()||!h.current.floatingContext||!n.select("open"))return;const $=n.context.triggerElements;K.relatedTarget&&$.hasElement(K.relatedTarget)||(L(),M(),E()||A(K))}function z(K){_.clear(),L(),g.current?.(K),M()}function q(K){E()||A(K,!1)}const j=o;return j&&(j.addEventListener("mouseleave",H),j.addEventListener("mouseenter",z),j.addEventListener("mouseleave",q),j.addEventListener("pointerdown",D,!0)),()=>{j&&(j.removeEventListener("mouseleave",H),j.removeEventListener("mouseenter",z),j.removeEventListener("mouseleave",q),j.removeEventListener("pointerdown",D,!0))}})}function B6(e,t){return t&&!Vl(t)?0:typeof e=="function"?e():e}function _v(e){return typeof e=="function"?e():e}const z6={current:null};function H6(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=z6,externalTree:g,isActiveTrigger:x=!0}=t,C=So(g),{pointerTypeRef:w,interactedInsideRef:_,handlerRef:y,blockMouseMoveRef:v,performedPointerEventsMutationRef:b,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=GE(n),D=hn(a),H=hn(h),z=hn(d);x&&(L.current=D.current?.__options);const q=De(()=>_.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),j=k.useCallback((G,U=!0)=>{const P=fv(H.current,"close",w.current);P&&!y.current?A.start(P,()=>n.setOpen(!1,Ue(jr,G))):U&&(A.clear(),n.setOpen(!1,Ue(jr,G)))},[H,y,n,w,A]),K=De(()=>{E.current(),y.current=void 0}),$=De(()=>{if(b.current){const G=dn(n.select("domReferenceElement")).body;G.style.pointerEvents="",G.removeAttribute(u_),b.current=!1}});k.useEffect(()=>{if(!u)return;function G(U){U.open||(A.clear(),M.clear(),v.current=!0,T.current=!1)}return o.on("openchange",G),()=>{o.off("openchange",G)}},[u,o,A,M,v,T]);const V=De(G=>{if(q()||!s.current.floatingContext)return;const U=n.context.triggerElements;if(G.relatedTarget&&U.hasElement(G.relatedTarget))return;const P=f.current;D.current?.({...s.current.floatingContext,tree:C,x:G.clientX,y:G.clientY,onClose(){$(),K(),!q()&&P===n.select("domReferenceElement")&&j(G)}})(G)});return k.useEffect(()=>{if(!u)return;const G=f.current??(x?n.select("domReferenceElement"):null);if(!Nt(G))return;function U(I){if(A.clear(),v.current=!1,l&&!Vl(w.current)||_v(z.current)>0&&!fv(H.current,"open"))return;const W=fv(H.current,"open",w.current),Y=n.select("domReferenceElement"),J=n.context.triggerElements,Z=(J.hasElement(I.target)||J.hasMatchingElement(F=>ft(F,I.target)))&&(!Y||!ft(Y,I.target)),ee=I.currentTarget??null,X=!n.select("open")||Z;W?A.start(W,()=>{X&&n.setOpen(!0,Ue(jr,I,ee))}):X&&n.setOpen(!0,Ue(jr,I,ee))}function P(I){if(q()){$();return}E.current();const W=n.select("domReferenceElement"),Y=dn(W);M.clear(),T.current=!1;const J=n.context.triggerElements;if(I.relatedTarget&&J.hasElement(I.relatedTarget))return;if(D.current&&s.current.floatingContext){n.select("open")||A.clear();const ee=f.current;y.current=D.current({...s.current.floatingContext,tree:C,x:I.clientX,y:I.clientY,onClose(){$(),K(),!q()&&ee===n.select("domReferenceElement")&&j(I,!0)}});const X=y.current;X(I),Y.addEventListener("mousemove",X),E.current=()=>{Y.removeEventListener("mousemove",X)};return}(w.current!=="touch"||!ft(n.select("floatingElement"),I.relatedTarget))&&j(I)}function B(I){V(I)}return n.select("open")&&G.addEventListener("mouseleave",B),p&&G.addEventListener("mousemove",U,{once:!0}),G.addEventListener("mouseenter",U),G.addEventListener("mouseleave",P),()=>{G.removeEventListener("mouseleave",B),p&&G.removeEventListener("mousemove",U),G.removeEventListener("mouseenter",U),G.removeEventListener("mouseleave",P)}},[K,$,v,s,H,j,n,u,D,V,x,q,l,p,w,z,M,T,A,f,C,E,y]),k.useMemo(()=>{function G(U){w.current=U.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(U){const{nativeEvent:P}=U,B=U.currentTarget,I=n.select("domReferenceElement"),W=n.context.triggerElements,Y=n.select("open"),J=(W.hasElement(U.target)||W.hasMatchingElement(ee=>ft(ee,U.target)))&&(!I||!ft(I,U.target));if(l&&!Vl(w.current)||Y&&!J||_v(z.current)===0||!J&&T.current&&U.movementX**2+U.movementY**2<2)return;M.clear();function Z(){!v.current&&(!Y||J)&&n.setOpen(!0,Ue(jr,P,B))}w.current==="touch"?er.flushSync(()=>{Z()}):J&&Y?Z():(T.current=!0,M.start(_v(z.current),Z))}}},[v,l,n,w,z,M,T])}function rc(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=k.useCallback(d=>Wf(d,e,"reference"),t),h=k.useCallback(d=>Wf(d,e,"floating"),n),a=k.useCallback(d=>Wf(d,e,"item"),s),l=k.useCallback(d=>Wf(d,e,"trigger"),o);return k.useMemo(()=>({getReferenceProps:u,getFloatingProps:h,getItemProps:a,getTriggerProps:l}),[u,h,a,l])}function Wf(e,t,n){const s=new Map,o=n==="item",u={};n==="floating"&&(u.tabIndex=-1,u[r_]="");for(const h in e)o&&e&&(h===nE||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&&sC(u,a,o,s)}return sC(u,e,o,s),u}function sC(e,t,n,s){for(const o in t){const u=t[o];n&&(o===nE||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 V6="Escape";function gp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qf(e,t){return gp(t,e===a0||e===Qu,e===uo||e===fo)}function yv(e,t,n){return gp(t,e===Qu,n?e===uo:e===fo)||e==="Enter"||e===" "||e===""}function F6(e,t,n){return gp(t,n?e===uo:e===fo,e===Qu)}function U6(e,t,n,s){const o=n?e===fo:e===uo,u=e===a0;return t==="both"||t==="horizontal"&&s&&s>1?e===V6:gp(t,o,u)}function y0(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:x=!1,nested:C=!1,rtl:w=!1,virtual:_=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:D,dense:H=!1,id:z,resetOnPointerLeave:q=!0,externalTree:j}=t,K=ju(o),$=hn(K),V=Ci(),G=So(j);He(()=>{h.current.orientation=T},[h,T]);const U=s_(u),P=k.useRef(y),B=k.useRef(f??-1),I=k.useRef(null),W=k.useRef(!0),Y=De(me=>{d(B.current===-1?null:B.current,me)}),J=k.useRef(Y),Z=k.useRef(!!o),ee=k.useRef(s),X=k.useRef(!1),F=k.useRef(!1),se=hn(E),ne=hn(s),re=hn(L),oe=hn(f),le=hn(q),_e=De(()=>{function me(nt){_?G?.events.emit("virtualfocus",nt):dh(nt,{sync:X.current,preventScroll:!0})}const de=a.current[B.current],xe=F.current;de&&me(de),(X.current?nt=>nt():requestAnimationFrame)(()=>{const nt=a.current[B.current]||de;if(!nt)return;de||me(nt);const Ve=re.current;Ve&&he&&(xe||!W.current)&&nt.scrollIntoView?.(typeof Ve=="boolean"?{block:"nearest",inline:"nearest"}:Ve)})});He(()=>{p&&(s&&o?(B.current=f??-1,P.current&&f!=null&&(F.current=!0,Y())):Z.current&&(B.current=-1,J.current()))},[p,s,o,f,Y]),He(()=>{if(p){if(!s){X.current=!1;return}if(o)if(l==null){if(X.current=!1,oe.current!=null)return;if(Z.current&&(B.current=-1,_e()),(!ee.current||!Z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let me=0;const de=()=>{a.current[0]==null?(me<2&&(me?requestAnimationFrame:queueMicrotask)(de),me+=1):(B.current=I.current==null||yv(I.current,T,w)||C?uh(a):a_(a),I.current=null,Y())};de()}}else kl(a,l)||(B.current=l,_e(),F.current=!1)}},[p,s,o,l,oe,C,a,T,w,Y,_e,se]),He(()=>{if(!p||o||!G||_||!Z.current)return;const me=G.nodesRef.current,de=me.find(nt=>nt.id===V)?.context?.elements.floating,xe=ms(dn(o)),We=me.some(nt=>nt.context&&ft(nt.context.elements.floating,xe));de&&!We&&W.current&&de.focus({preventScroll:!0})},[p,o,G,V,_]),He(()=>{J.current=Y,ee.current=s,Z.current=!!o}),He(()=>{s||(I.current=null,P.current=y)},[s,y]);const ve=l!=null,he=k.useMemo(()=>{function me(xe){if(!ne.current)return;const We=a.current.indexOf(xe.currentTarget);We!==-1&&B.current!==We&&(B.current=We,Y(xe))}return{onFocus(xe){X.current=!0,me(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){X.current=!0,F.current=!1,v&&me(xe)},onPointerLeave(xe){if(!ne.current||!W.current||xe.pointerType==="touch")return;X.current=!0;const We=xe.relatedTarget;!v||a.current.includes(We)||le.current&&(B.current=-1,Y(xe),_||$.current?.focus({preventScroll:!0}))}}},[ne,$,v,a,Y,le,_]),ue=k.useCallback(()=>A??G?.nodesRef.current.find(me=>me.id===V)?.context?.dataRef?.current.orientation,[V,G,A]),Ie=De(me=>{if(W.current=!1,X.current=!0,me.which===229||!ne.current&&me.currentTarget===$.current)return;if(C&&U6(me.key,T,w,M)){qf(me.key,ue())||fn(me),n.setOpen(!1,Ue(Lu,me.nativeEvent)),en(u)&&(_?G?.events.emit("virtualfocus",u):u.focus());return}const de=B.current,xe=uh(a,E),We=a_(a,E);if(U||(me.key==="Home"&&(fn(me),B.current=xe,Y(me)),me.key==="End"&&(fn(me),B.current=We,Y(me))),M>1){const nt=D||Array.from({length:a.current.length},()=>({width:1,height:1})),Ve=uE(nt,M,H),rt=Ve.findIndex(Ce=>Ce!=null&&!ho(a,Ce,E)),Je=Ve.reduce((Ce,Be,Re)=>Be!=null&&!ho(a,Be,E)?Re:Ce,-1),dt=Ve[cE({current:Ve.map(Ce=>Ce!=null?a.current[Ce]:null)},{event:me,orientation:T,loopFocus:x,rtl:w,cols:M,disabledIndices:fE([...(typeof E!="function"?E:null)||a.current.map((Ce,Be)=>ho(a,Be,E)?Be:void 0),void 0],Ve),minIndex:rt,maxIndex:Je,prevIndex:dE(B.current>We?xe:B.current,nt,Ve,M,me.key===Qu?"bl":me.key===(w?uo:fo)?"tr":"tl"),stopEvent:!0})];if(dt!=null&&(B.current=dt,Y(me)),T==="both")return}if(qf(me.key,T)){if(fn(me),s&&!_&&ms(me.currentTarget.ownerDocument)===me.currentTarget){B.current=yv(me.key,T,w)?xe:We,Y(me);return}yv(me.key,T,w)?x?de>=We?g&&de!==a.current.length?B.current=-1:(X.current=!1,B.current=xe):B.current=Wn(a,{startingIndex:de,disabledIndices:E}):B.current=Math.min(We,Wn(a,{startingIndex:de,disabledIndices:E})):x?de<=xe?g&&de!==-1?B.current=a.current.length:(X.current=!1,B.current=We):B.current=Wn(a,{startingIndex:de,decrement:!0,disabledIndices:E}):B.current=Math.max(xe,Wn(a,{startingIndex:de,decrement:!0,disabledIndices:E})),kl(a,B.current)&&(B.current=-1),Y(me)}}),Me=k.useMemo(()=>_&&s&&ve&&{"aria-activedescendant":`${z}-${l}`},[_,s,ve,z,l]),Ae=k.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...U?{}:Me,onKeyDown(me){if(me.key==="Tab"&&me.shiftKey&&s&&!_){const de=Pn(me.nativeEvent);if(de&&!ft($.current,de))return;fn(me),n.setOpen(!1,Ue(Ca,me.nativeEvent)),en(u)&&u.focus();return}Ie(me)},onPointerMove(){W.current=!0}}),[Me,Ie,$,T,U,n,s,_,u]),be=k.useMemo(()=>{function me(xe){y==="auto"&&iE(xe.nativeEvent)&&(P.current=!_)}function de(xe){P.current=y,y==="auto"&&oE(xe.nativeEvent)&&(P.current=!0)}return{onKeyDown(xe){const We=n.select("open");W.current=!1;const nt=xe.key.startsWith("Arrow"),Ve=F6(xe.key,ue(),w),rt=qf(xe.key,T),Je=(C?Ve:rt)||xe.key==="Enter"||xe.key.trim()==="";if(_&&We)return Ie(xe);if(!(!We&&!b&&nt)){if(Je){const dt=qf(xe.key,ue());I.current=C&&dt?null:xe.key}if(C){Ve&&(fn(xe),We?(B.current=uh(a,se.current),Y(xe)):n.setOpen(!0,Ue(Lu,xe.nativeEvent,xe.currentTarget)));return}rt&&(oe.current!=null&&(B.current=oe.current),fn(xe),!We&&b?n.setOpen(!0,Ue(Lu,xe.nativeEvent,xe.currentTarget)):Ie(xe),We&&Y(xe))}},onFocus(xe){n.select("open")&&!_&&(B.current=-1,Y(xe))},onPointerDown:de,onPointerEnter:de,onMouseDown:me,onClick:me}},[Ie,se,y,a,C,Y,n,b,T,ue,w,oe,_]),Oe=k.useMemo(()=>({...Me,...be}),[Me,be]);return k.useMemo(()=>p?{reference:Oe,floating:Ae,item:he,trigger:be}:{},[p,Oe,Ae,be,he])}const W6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $E(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=Aa(),p=u?.id||d,f=k.useMemo(()=>ju(h)?.id||o,[h,o]),g=W6.get(l)??l,C=Ci()!=null,w=k.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]),_=k.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]),y=k.useMemo(()=>{const b={id:f,...g&&{role:g}};return g==="tooltip"||l==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,l]),v=k.useCallback(({active:b,selected:E})=>{const T={role:"option",...b&&{id:`${f}-fui-option`}};switch(l){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[f,l]);return k.useMemo(()=>a?{reference:_,floating:y,item:v,trigger:w}:{},[a,_,y,w,v])}function b0(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=gr,selectedIndex:x=null}=t,C=Qt(),w=k.useRef(""),_=k.useRef(x??h??-1),y=k.useRef(null);He(()=>{s&&(C.clear(),y.current=null,w.current="")},[s,C]),He(()=>{s&&w.current===""&&(_.current=x??h??-1)},[s,x,h]);const v=De(A=>{A?o.current.typing||(o.current.typing=A,l?.(A)):o.current.typing&&(o.current.typing=A,l?.(A))}),b=De(A=>{function M(q,j,K){const $=p?p(j,K):j.find(V=>V?.toLocaleLowerCase().indexOf(K.toLocaleLowerCase())===0);return $?q.indexOf($):-1}const L=u.current;if(w.current.length>0&&w.current[0]!==" "&&(M(L,L,w.current)===-1?v(!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),v(!0)),L.every(q=>q?q[0]?.toLocaleLowerCase()!==q[1]?.toLocaleLowerCase():!0)&&w.current===A.key&&(w.current="",_.current=y.current),w.current+=A.key,C.start(f,()=>{w.current="",_.current=y.current,v(!1)});const H=_.current,z=M(L,[...L.slice((H||0)+1),...L.slice(0,(H||0)+1)],w.current);z!==-1?(a?.(z),y.current=z):A.key!==" "&&(w.current="",v(!1))}),E=k.useMemo(()=>({onKeyDown:b}),[b]),T=k.useMemo(()=>({onKeyDown:b,onKeyUp(A){A.key===" "&&v(!1)}}),[b,v]);return k.useMemo(()=>d?{reference:E,floating:T}:{},[d,E,T])}function iC(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 q6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function G6(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,o=new wa;let u=!1,h=null,a=null,l=typeof performance<"u"?performance.now():0;function d(f,g){const x=performance.now(),C=x-l;if(h===null||a===null||C===0)return h=f,a=g,l=x,null;const w=f-h,_=g-a,v=Math.sqrt(w*w+_*_)/C;return h=f,a=g,l=x,v}const p=({x:f,y:g,placement:x,elements:C,onClose:w,nodeId:_,tree:y})=>function(b){function E(){o.clear(),w()}if(o.clear(),!C.domReference||!C.floating||x==null||f==null||g==null)return;const{clientX:T,clientY:A}=b,M=[T,A],L=Pn(b),D=b.type==="mouseleave",H=ft(C.floating,L),z=ft(C.domReference,L),q=C.domReference.getBoundingClientRect(),j=C.floating.getBoundingClientRect(),K=x.split("-")[0],$=f>j.right-j.width/2,V=g>j.bottom-j.height/2,G=q6(M,q),U=j.width>q.width,P=j.height>q.height,B=(U?q:j).left,I=(U?q:j).right,W=(P?q:j).top,Y=(P?q:j).bottom;if(H&&(u=!0,!D))return;if(z&&(u=!1),z&&!D){u=!0;return}if(D&&Nt(b.relatedTarget)&&ft(C.floating,b.relatedTarget)||y&&pa(y.nodesRef.current,_).some(({context:ee})=>ee?.open))return;if(K==="top"&&g>=q.bottom-1||K==="bottom"&&g<=q.top+1||K==="left"&&f>=q.right-1||K==="right"&&f<=q.left+1)return E();let J=[];switch(K){case"top":J=[[B,q.top+1],[B,j.bottom-1],[I,j.bottom-1],[I,q.top+1]];break;case"bottom":J=[[B,j.top+1],[B,q.bottom-1],[I,q.bottom-1],[I,j.top+1]];break;case"left":J=[[j.right-1,Y],[j.right-1,W],[q.left+1,W],[q.left+1,Y]];break;case"right":J=[[q.right-1,Y],[q.right-1,W],[j.left+1,W],[j.left+1,Y]];break}function Z([ee,X]){switch(K){case"top":{const F=[U?ee+t/2:$?ee+t*4:ee-t*4,X+t+1],se=[U?ee-t/2:$?ee+t*4:ee-t*4,X+t+1],ne=[[j.left,$||U?j.bottom-t:j.top],[j.right,$?U?j.bottom-t:j.top:j.bottom-t]];return[F,se,...ne]}case"bottom":{const F=[U?ee+t/2:$?ee+t*4:ee-t*4,X-t],se=[U?ee-t/2:$?ee+t*4:ee-t*4,X-t],ne=[[j.left,$||U?j.top+t:j.bottom],[j.right,$?U?j.top+t:j.bottom:j.top+t]];return[F,se,...ne]}case"left":{const F=[ee+t+1,P?X+t/2:V?X+t*4:X-t*4],se=[ee+t+1,P?X-t/2:V?X+t*4:X-t*4];return[...[[V||P?j.right-t:j.left,j.top],[V?P?j.right-t:j.left:j.right-t,j.bottom]],F,se]}case"right":{const F=[ee-t,P?X+t/2:V?X+t*4:X-t*4],se=[ee-t,P?X-t/2:V?X+t*4:X-t*4],ne=[[V||P?j.left+t:j.right,j.top],[V?P?j.left+t:j.right:j.left+t,j.bottom]];return[F,se,...ne]}default:return[]}}if(!iC([T,A],J)){if(u&&!G)return E();if(!D&&s){const ee=d(b.clientX,b.clientY);if(ee!==null&&ee<.1)return E()}iC([T,A],Z([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let $6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),K6=(function(e){return e[e.open=na.open]="open",e[e.closed=na.closed]="closed",e[e.startingStyle=na.startingStyle]="startingStyle",e[e.endingStyle=na.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const KE=k.createContext(void 0);function Y6(){const e=k.useContext(KE);if(e===void 0)throw new Error(Pt(26));return e}const Ol="ArrowUp",sa="ArrowDown",zu="ArrowLeft",Ml="ArrowRight",td="Home",nd="End",YE=new Set([zu,Ml]),X6=new Set([zu,Ml,td,nd]),XE=new Set([Ol,sa]),Q6=new Set([Ol,sa,td,nd]),QE=new Set([...YE,...XE]),Z6=new Set([...QE,td,nd]),x0=new Set([Ol,sa,zu,Ml,td,nd]),J6="Shift",e8="Control",t8="Alt",n8="Meta",r8=new Set([J6,e8,t8,n8]);function s8(e){return en(e)&&e.tagName==="INPUT"}function oC(e){return!!(s8(e)&&e.selectionStart!=null||en(e)&&e.tagName==="TEXTAREA")}function aC(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=Gf(e),p=Gf(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=Gf(e),p=Gf(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 Gf(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 i8={...bo,...Ws,nestedDialogOpen(e){return e?{[K6.nestedDialogOpen]:""}:null}},ZE=k.forwardRef(function(t,n){const{className:s,finalFocus:o,initialFocus:u,render:h,...a}=t,{store:l}=Si(),d=l.useState("descriptionElementId"),p=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),g=l.useState("popupProps"),x=l.useState("modal"),C=l.useState("mounted"),w=l.useState("nested"),_=l.useState("nestedOpenDialogCount"),y=l.useState("open"),v=l.useState("openMethod"),b=l.useState("titleElementId"),E=l.useState("transitionStatus"),T=l.useState("role");Y6(),Vr({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});function A(z){return z==="touch"?l.context.popupRef.current:!0}const M=u===void 0?A:u,L=_>0,D=k.useMemo(()=>({open:y,nested:w,transitionStatus:E,nestedDialogOpen:L}),[y,w,E,L]),H=ct("div",t,{state:D,props:[g,{"aria-labelledby":b??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!C,onKeyDown(z){x0.has(z.key)&&z.stopPropagation()},style:{[$6.nestedDialogs]:_}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:i8});return S.jsx(fp,{context:f,openInteractionType:v,disabled:!C,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:x!==!1,restoreFocus:"popup",children:H})});function vp(e){return Y_(19)?e:e?"true":void 0}const _p=k.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 S.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),JE=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Si(),h=u.useState("mounted"),a=u.useState("modal");return h||s?S.jsx(KE.Provider,{value:s,children:S.jsxs(dp,{ref:n,...o,children:[h&&a===!0&&S.jsx(_p,{ref:u.context.internalBackdropRef,inert:vp(!open)}),t.children]})}):null});let cC={},uC={},dC="";function o8(e){if(typeof document>"u")return!1;const t=_r(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function a8(e){const t=_r(e),n=t.documentElement,s=t.body,o=ka(n)?n:s,u=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=u}}function l8(e){const t=_r(e),n=t.documentElement,s=t.body,o=Rn(n);let u=0,h=0;const a=Is.create(),l=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(o0&&(o.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),x=o.getComputedStyle(s),_=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,h=n.scrollLeft,cC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dC=n.style.scrollBehavior,uC={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 y=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,b=g.overflowY==="scroll"||x.overflowY==="scroll",E=g.overflowX==="scroll"||x.overflowX==="scroll",T=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),M=parseFloat(x.marginTop)+parseFloat(x.marginBottom),L=parseFloat(x.marginLeft)+parseFloat(x.marginRight),D=ka(n)?n:s;if(l){n.style.scrollbarGutter=_,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:_,overflowY:"hidden",overflowX:"hidden"}),(y||b)&&(n.style.overflowY="scroll"),(v||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,cC),Object.assign(s.style,uC),l||(n.scrollTop=u,n.scrollLeft=h,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=dC)}function f(){p(),a.request(d)}return d(),o.addEventListener("resize",f),()=>{a.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class c8{lockCount=0;restore=null;timeoutLock=wa.create();timeoutUnlock=wa.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=_r(t).documentElement,o=Rn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=sn;return}const u=E4||!o8(t);this.restore=u?a8(t):l8(t)}}const u8=new c8;function yp(e=!0,t=null){He(()=>{if(e)return u8.acquire(t)},[e,t])}function d8(e){const t=k.useRef(""),n=k.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:k.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 bp(e){const[t,n]=k.useState(null),s=De((a,l)=>{e||n(l)}),o=k.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:h}=d8(s);return k.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function eR(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}=bp(o);VE(t);const{forceUnmount:f}=FE(o,t,()=>{p()}),g=De(H=>{const z=Ue(H);return z.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},z}),x=k.useCallback(()=>{t.setOpen(!1,g(X2))},[t,g]);k.useImperativeHandle(s,()=>({unmount:f,close:x}),[f,x]);const C=qE({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,_]=k.useState(0),y=w===0,v=$E(C),b=pp(C,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if("button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const z=Pn(H);if(y&&!u){const q=z;return h&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===q||t.context.backdropRef.current===q||ft(q,a)&&!q?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});yp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=rc([v,b]);t.useContextCallback("onNestedDialogOpen",H=>{_(H+1)}),t.useContextCallback("onNestedDialogClose",()=>{_(0)}),k.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,w]);const M=k.useMemo(()=>E(d),[E,d]),L=k.useMemo(()=>A(d),[A,d]),D=k.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:l,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:D,floatingRootContext:C,nestedOpenDialogCount:w})}const f8={...WE,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 tR extends g0{constructor(t){super(h8(t),{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),triggerElements:new mp,onOpenChange:void 0,onOpenChangeComplete:void 0},f8)}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 h8(e={}){return{...UE(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function p8(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=Si(!0),x=!!g,C=Gn(()=>d?.store??new tR({open:n??s,activeTriggerId:p!==void 0?p:f,modal:a,disablePointerDismissal:h,nested:x})).current;C.useControlledProp("open",n,s),C.useControlledProp("activeTriggerId",p,f),C.useSyncedValues({disablePointerDismissal:h,nested:x,modal:a}),C.useContextCallback("onOpenChange",o),C.useContextCallback("onOpenChangeComplete",u);const w=C.useState("payload");eR({store:C,actionsRef:l,parentContext:g?.store.context});const _=k.useMemo(()=>({store:C}),[C]);return S.jsx(n0.Provider,{value:_,children:typeof t=="function"?t({payload:w}):t})}const nR=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=Si(),l=vr(u);return a.useSyncedValueWithCleanup("titleElementId",l),ct("h2",t,{ref:n,props:[{id:l},h]})}),rR=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,payload:l,handle:d,...p}=t,f=Si(!0),g=d?.store??f?.store;if(!g)throw new Error(Pt(79));const x=vr(a),C=g.useState("floatingRootContext"),w=g.useState("isOpenedByTrigger",x),_=k.useRef(null),{registerTrigger:y,isMountedByThisTrigger:v}=HE(x,_,g,{payload:l}),{getButtonProps:b,buttonRef:E}=yr({disabled:u,native:h}),T=ed(C,{enabled:C!=null}),A=rc([T]),M=k.useMemo(()=>({disabled:u,open:w}),[u,w]),L=g.useState("triggerProps",v);return ct("button",t,{state:M,ref:[E,n,y,_],props:[A.getReferenceProps(),L,{[y2]:"",id:x},p,b],stateAttributesMapping:r0})});function _s({...e}){return S.jsx(p8,{"data-slot":"dialog",...e})}function sR({...e}){return S.jsx(rR,{"data-slot":"dialog-trigger",...e})}function m8({...e}){return S.jsx(JE,{"data-slot":"dialog-portal",...e})}function S0({...e}){return S.jsx(up,{"data-slot":"dialog-close",...e})}function g8({className:e,...t}){return S.jsx(K2,{"data-slot":"dialog-overlay",className:ze("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 ys({className:e,children:t,showCloseButton:n=!0,...s}){return S.jsxs(m8,{children:[S.jsx(g8,{}),S.jsxs(ZE,{"data-slot":"dialog-content",className:ze("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&&S.jsxs(up,{"data-slot":"dialog-close",render:S.jsx(je,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[S.jsx(Se,{icon:vo,strokeWidth:2}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function js({className:e,...t}){return S.jsx("div",{"data-slot":"dialog-header",className:ze("gap-1 flex flex-col",e),...t})}function po({className:e,showCloseButton:t=!1,children:n,...s}){return S.jsxs("div",{"data-slot":"dialog-footer",className:ze("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&S.jsx(up,{render:S.jsx(je,{variant:"outline"}),children:"Close"})]})}function Ns({className:e,...t}){return S.jsx(nR,{"data-slot":"dialog-title",className:ze("text-sm font-medium",e),...t})}function ia({className:e,...t}){return S.jsx(Q2,{"data-slot":"dialog-description",className:ze("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}let fC=(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 v8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ma={valid(e){return e===null?null:e?{[fC.valid]:""}:{[fC.invalid]:""}}},_8=k.createContext({invalid:void 0,name:void 0,validityData:{state:v8,errors:[],error:"",value:"",initialValue:null},setValidityData:sn,disabled:void 0,touched:!1,setTouched:sn,dirty:!1,setDirty:sn,filled:!1,setFilled:sn,focused:!1,setFocused:sn,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 as(e=!0){const t=k.useContext(_8);if(t.setValidityData===sn&&!e)throw new Error(Pt(28));return t}const y8=k.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:sn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function rd(){return k.useContext(y8)}const b8=k.createContext({controlId:void 0,setControlId:sn,labelId:void 0,setLabelId:sn,messageIds:[],setMessageIds:sn,getDescriptionProps:e=>e});function Co(){return k.useContext(b8)}function x8(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function ss({controlled:e,default:t,name:n,state:s="value"}){const{current:o}=k.useRef(e!==void 0),[u,h]=k.useState(t),a=o?e:u,l=k.useCallback(d=>{o||h(d)},[]);return[a,l]}function xp(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:o,setControlId:u}=Co(),h=vr(t);return He(()=>{if(!(!n&&!t||u===sn)){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 sd(e){const{enabled:t=!0,value:n,id:s,name:o,controlRef:u,commit:h}=e,{formRef:a}=rd(),{invalid:l,markedDirtyRef:d,validityData:p,setValidityData:f}=as(),g=De(e.getValue);He(()=>{if(!t)return;let x=n;x===void 0&&(x=g()),p.initialValue===null&&x!==null&&f(C=>({...C,initialValue:x}))},[t,f,n,p.initialValue,g]),He(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:x8(p,l),validate(){let x=n;x===void 0&&(x=g()),d.current=!0,er.flushSync(()=>h(x))}})},[h,u,t,a,g,s,l,d,o,p,n]),He(()=>{const x=a.current.fields;return()=>{s&&x.delete(s)}},[a,s])}const S8=k.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:x,disabled:C}=as(),w=C||l,_=x??h,y=k.useMemo(()=>({...g,disabled:w}),[g,w]),{setTouched:v,setDirty:b,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=as(),{labelId:D}=Co(),H=xp({id:u});He(()=>{const V=a!=null;L.inputRef.current?.value||V&&a!==""?A(!0):V&&a===""&&A(!1)},[L.inputRef,A,a]);const[z,q]=ss({controlled:a,default:p,name:"FieldControl",state:"value"}),j=a!==void 0,K=De((V,G)=>{d?.(V,G),!G.isCanceled&&q(V)});return sd({id:H,name:_,commit:L.commit,value:z,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),ct("input",t,{ref:n,state:y,props:[{id:H,disabled:w,name:_,ref:L.inputRef,"aria-labelledby":D,...j?{value:z}:{defaultValue:p},onChange(V){const G=V.currentTarget.value;K(G,Ue(Mn,V.nativeEvent)),b(G!==E.initialValue),A(G!=="")},onFocus(){T(!0)},onBlur(V){v(!0),T(!1),M==="onBlur"&&L.commit(V.currentTarget.value)},onKeyDown(V){V.currentTarget.tagName==="INPUT"&&V.key==="Enter"&&(v(!0),L.commit(V.currentTarget.value))}},L.getInputValidationProps(),f],stateAttributesMapping:Ma})}),C8=k.createContext({disabled:!1});function w8(){return k.useContext(C8)}const E8=k.createContext(void 0);function R8(e=!0){const t=k.useContext(E8);if(t===void 0&&!e)throw new Error(Pt(3));return t}const k8=k.forwardRef(function(t,n){return S.jsx(S8,{ref:n,...t})});function Wt({className:e,type:t,...n}){return S.jsx(k8,{type:t,"data-slot":"input",className:ze("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 Sp({className:e,...t}){return S.jsx("textarea",{"data-slot":"textarea",className:ze("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})}function T8({className:e,...t}){return S.jsx("label",{"data-slot":"label",className:ze("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 L8=k.forwardRef(function(t,n){const{className:s,render:o,orientation:u="horizontal",...h}=t,a=k.useMemo(()=>({orientation:u}),[u]);return ct("div",t,{state:a,ref:n,props:[{role:"separator","aria-orientation":u},h]})});function A8({className:e,orientation:t="horizontal",...n}){return S.jsx(L8,{"data-slot":"separator",orientation:t,className:ze("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 id({className:e,...t}){return S.jsx("div",{"data-slot":"field-group",className:ze("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 O8=Ta("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 S.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ze(O8({orientation:t}),e),...n})}function wn({className:e,...t}){return S.jsx(T8,{"data-slot":"field-label",className:ze("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 so({className:e,...t}){return S.jsx("p",{"data-slot":"field-description",className:ze("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 iR(e){const t=k.useRef(!0);t.current&&(t.current=!1,e())}const oR=k.createContext(null),aR=k.createContext(null);function qs(){const e=k.useContext(oR);if(e===null)throw new Error(Pt(60));return e}function lR(){const e=k.useContext(aR);if(e===null)throw new Error(Pt(61));return e}const cR=(e,t)=>Object.is(e,t);function xi(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function oa(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:xi(s,t,n))}function Gl(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:xi(s,t,n))}function uR(e,t,n){return e.filter(s=>!xi(s,t,n))}function d_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function dR(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 d_(e)}function gs(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?d_(e.value):d_(e)}function M8(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=dR(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 D8(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=>xi(u,n,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:xi(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?"":gs(n,s)})};function aa(e,t){const n=k.useRef(e),s=De(t);He(()=>{n.current!==e&&s(n.current)},[e,s]),He(()=>{n.current=e},[e])}function P8(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:x,inputRef:C,onOpenChangeComplete:w,items:_,multiple:y=!1,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E=cR,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=rd(),{setDirty:L,shouldValidateOnChange:D,validityData:H,setFilled:z,name:q,disabled:j,validation:K}=as(),{controlId:$}=Co(),V=xp({id:t}),G=j||d,U=q??l,[P,B]=ss({controlled:n,default:y?s??gr:s,name:"Select",state:"value"}),[I,W]=ss({controlled:u,default:h,name:"Select",state:"open"}),Y=k.useRef([]),J=k.useRef([]),Z=k.useRef(null),ee=k.useRef(null),X=k.useRef(0),F=k.useRef(null),se=k.useRef([]),ne=k.useRef(!1),re=k.useRef(!1),oe=k.useRef(null),le=k.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),_e=k.useRef(!1),{mounted:ve,setMounted:he,transitionStatus:ue}=wi(I),{openMethod:Ie,triggerProps:Me,reset:Ae}=bp(I),be=Gn(()=>new ma({id:V,modal:g,multiple:y,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E,value:P,open:I,mounted:ve,transitionStatus:ue,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Oe=Le(be,ht.activeIndex),me=Le(be,ht.selectedIndex),de=Le(be,ht.triggerElement),xe=Le(be,ht.positionerElement),We=k.useMemo(()=>y&&Array.isArray(P)&&P.length===0?"":gs(P,b),[y,P,b]),nt=k.useMemo(()=>y&&Array.isArray(P)?P.map(ot=>gs(ot,b)):gs(P,b),[y,P,b]),Ve=hn(be.state.triggerElement);sd({id:V,commit:K.commit,value:P,controlRef:Ve,name:U,getValue:()=>nt});const rt=k.useRef(P);He(()=>{P!==rt.current&&be.set("forceMount",!0)},[be,P]),He(()=>{z(P!==null)},[P,z]),He(function(){if(I)return;const wt=se.current;if(y){const xt=Array.isArray(P)?P:[];if(xt.length===0){be.set("selectedIndex",null);return}const Xe=xt[xt.length-1],Ht=Gl(wt,Xe,E);be.set("selectedIndex",Ht===-1?null:Ht);return}const bt=Gl(wt,P,E);be.set("selectedIndex",bt===-1?null:bt)},[y,I,P,se,E,be]),aa(P,()=>{M(U),L(P!==H.initialValue),D()?K.commit(P):K.commit(P,!0)});const Je=De((ot,wt)=>{if(a?.(ot,wt),!wt.isCanceled&&(W(ot),!ot&&be.state.activeIndex!==null)){const bt=Y.current[be.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),dt=De(()=>{he(!1),be.set("activeIndex",null),Ae(),w?.(!1)});Vr({enabled:!x,open:I,ref:Z,onComplete(){I||dt()}}),k.useImperativeHandle(x,()=>({unmount:dt}),[dt]);const Ce=De((ot,wt)=>{o?.(ot,wt),!wt.isCanceled&&B(ot)}),Be=De(()=>{const ot=be.state.listElement||Z.current;if(!ot)return;const wt=ot.scrollTop,bt=ot.scrollTop+ot.clientHeight,xt=wt>1,Xe=bt<ot.scrollHeight-1;be.state.scrollUpArrowVisible!==xt&&be.set("scrollUpArrowVisible",xt),be.state.scrollDownArrowVisible!==Xe&&be.set("scrollDownArrowVisible",Xe)}),Re=_0({open:I,onOpenChange:Je,elements:{reference:de,floating:xe}}),et=ed(Re,{enabled:!p&&!G,event:"mousedown"}),at=pp(Re,{bubbles:!1}),Ye=y0(Re,{enabled:!p&&!G,listRef:Y,activeIndex:Oe,selectedIndex:me,disabledIndices:gr,onNavigate(ot){ot===null&&!I||be.set("activeIndex",ot)},focusItemOnHover:!1}),st=b0(Re,{enabled:!p&&!G&&(I||!y),listRef:J,activeIndex:Oe,selectedIndex:me,onMatch(ot){I?be.set("activeIndex",ot):Ce(se.current[ot],Ue("none"))},onTypingChange(ot){ne.current=ot}}),{getReferenceProps:Ct,getFloatingProps:lt,getItemProps:nn}=rc([et,at,Ye,st]),kt=k.useMemo(()=>Fs(Ct(),Me),[Ct,Me]);iR(()=>{be.update({popupProps:lt(),triggerProps:kt})}),He(()=>{be.update({id:V,modal:g,multiple:y,value:P,open:I,mounted:ve,transitionStatus:ue,popupProps:lt(),triggerProps:kt,items:_,itemToStringLabel:v,itemToStringValue:b,isItemEqualToValue:E,openMethod:Ie})},[be,V,g,y,P,I,ve,ue,lt,kt,_,v,b,E,Ie]);const vt=k.useMemo(()=>({store:be,name:U,required:f,disabled:G,readOnly:p,multiple:y,itemToStringLabel:v,itemToStringValue:b,highlightItemOnHover:T,setValue:Ce,setOpen:Je,listRef:Y,popupRef:Z,scrollHandlerRef:ee,handleScrollArrowVisibility:Be,scrollArrowsMountedCountRef:X,getItemProps:nn,events:Re.context.events,valueRef:F,valuesRef:se,labelsRef:J,typingRef:ne,selectionRef:le,selectedItemTextRef:oe,validation:K,onOpenChangeComplete:w,keyboardActiveRef:re,alignItemWithTriggerActiveRef:_e,initialValueRef:rt}),[be,U,f,G,p,y,v,b,T,Ce,Je,nn,Re.context.events,K,w,Be]),Ze=os(C,K.inputRef),Ot=y&&Array.isArray(P)&&P.length>0,jt=k.useMemo(()=>!y||!Array.isArray(P)||!U?null:P.map(ot=>{const wt=gs(ot,b);return S.jsx("input",{type:"hidden",name:U,value:wt},wt)}),[y,P,U,b]);return S.jsx(oR.Provider,{value:vt,children:S.jsxs(aR.Provider,{value:Re,children:[A,S.jsx("input",{...K.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(y)return;const Xe=se.current.find(Ht=>gs(Ht,b).toLowerCase()===wt.toLowerCase());Xe!=null&&(L(Xe!==H.initialValue),Ce(Xe,bt),D()&&K.commit(Xe))}be.set("forceMount",!0),queueMicrotask(xt)}}),id:t||$||void 0,name:y?void 0:U,value:We,disabled:G,required:f&&!Ot,readOnly:p,ref:Ze,style:nc,tabIndex:-1,"aria-hidden":!0}),jt]})})}function C0(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 $f=2,I8={...Iu,...Ma,value:()=>null},j8=k.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}=as(),{labelId:x}=Co(),{store:C,setOpen:w,selectionRef:_,validation:y,readOnly:v,alignItemWithTriggerActiveRef:b,disabled:E,keyboardActiveRef:T}=qs(),A=g||E||u,M=Le(C,ht.open),L=Le(C,ht.value),D=Le(C,ht.triggerProps),H=Le(C,ht.positionerElement),z=Le(C,ht.listElement),q=Le(C,ht.serializedValue),j=hn(H),K=k.useRef(null),$=Qt(),V=Qt(),{getButtonProps:G,buttonRef:U}=yr({disabled:A,native:h}),P=De(ee=>{C.set("triggerElement",ee)}),B=os(n,K,U,P),I=Qt(),W=Qt();k.useEffect(()=>{if(M)return W.start(200,()=>{_.current.allowUnselectedMouseUp=!0,I.start(200,()=>{_.current.allowSelectedMouseUp=!0})}),()=>{I.clear(),W.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},V.clear()},[M,_,V,I,W]);const Y=k.useMemo(()=>z?.id??ju(H)?.id,[z,H]),J=Fs(D,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?Y:void 0,"aria-labelledby":x,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:B,onFocus(ee){d(!0),M&&b.current&&w(!1,Ue(Ca,ee.nativeEvent)),$.start(0,()=>{C.set("forceMount",!0)})},onBlur(){l(!0),d(!1),p==="onBlur"&&y.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(ee){if(M)return;const X=_r(ee.currentTarget);function F(se){if(!K.current)return;const ne=se.target;if(ft(K.current,ne)||ft(j.current,ne)||ne===K.current)return;const re=C0(K.current);se.clientX>=re.left-$f&&se.clientX<=re.right+$f&&se.clientY>=re.top-$f&&se.clientY<=re.bottom+$f||w(!1,Ue(Y2,se))}V.start(0,()=>{X.addEventListener("mouseup",F,{once:!0})})}},y.getValidationProps,a,G);J.role="combobox";const Z=k.useMemo(()=>({...f,open:M,disabled:A,value:L,readOnly:v,placeholder:!q}),[f,M,A,L,v,q]);return ct("button",t,{ref:[n,K],state:Z,stateAttributesMapping:I8,props:J})}),N8={value:()=>null},B8=k.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:l}=qs(),d=Le(a,ht.value),p=Le(a,ht.items),f=Le(a,ht.itemToStringLabel),g=Le(a,ht.serializedValue),x=k.useMemo(()=>({value:d,placeholder:!g}),[d,g]),C=typeof u=="function"?u(d):u??(Array.isArray(d)?D8(d,f):M8(d,p,f));return ct("span",t,{state:x,ref:[n,l],props:[{children:C},h],stateAttributesMapping:N8})}),z8=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=qs(),a=Le(h,ht.open),l=k.useMemo(()=>({open:a}),[a]);return ct("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:r0})}),H8=k.createContext(void 0),V8=k.forwardRef(function(t,n){const{store:s}=qs(),o=Le(s,ht.mounted),u=Le(s,ht.forceMount);return o||u?S.jsx(H8.Provider,{value:!0,children:S.jsx(dp,{ref:n,...t})}):null}),fR=k.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function F8(){return k.useContext(fR)}function od(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=De(o),h=k.useRef(0),a=Gn(W8).current,l=Gn(U8).current,[d,p]=k.useState(0),f=k.useRef(d),g=De((y,v)=>{l.set(y,v??null),f.current+=1,p(f.current)}),x=De(y=>{l.delete(y),f.current+=1,p(f.current)}),C=k.useMemo(()=>{const y=new Map;return Array.from(l.keys()).filter(b=>b.isConnected).sort(q8).forEach((b,E)=>{const T=l.get(b)??{};y.set(b,{...T,index:E})}),y},[l,d]);He(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const y=new MutationObserver(v=>{const b=new Set,E=T=>b.has(T)?b.delete(T):b.add(T);v.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),b.size===0&&(f.current+=1,p(f.current))});return C.forEach((v,b)=>{b.parentElement&&y.observe(b.parentElement,{childList:!0})}),()=>{y.disconnect()}},[C]),He(()=>{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]),He(()=>()=>{n.current=[]},[n]),He(()=>()=>{s&&(s.current=[])},[s]);const w=De(y=>(a.add(y),()=>{a.delete(y)}));He(()=>{a.forEach(y=>y(C))},[a,C]);const _=k.useMemo(()=>({register:g,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:h}),[g,x,w,n,s,h]);return S.jsx(fR.Provider,{value:_,children:t})}function U8(){return new Map}function W8(){return new Set}function q8(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 G8=k.createContext(void 0);function Da(){return k.useContext(G8)?.direction??"ltr"}const $8=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"}=bi(e,t)||{};if(d==null)return{};const g=lE(p),x={x:n,y:s},C=d0(o),w=u0(C),_=await h.getDimensions(d),y=C==="y",v=y?"top":"left",b=y?"bottom":"right",E=y?"clientHeight":"clientWidth",T=u.reference[w]+u.reference[C]-x[C]-u.floating[w],A=x[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,H=L/2-_[w]/2-1,z=Math.min(g[v],H),q=Math.min(g[b],H),j=z,K=L-_[w]-q,$=L/2-_[w]/2+D,V=i_(j,$,K),G=!l.arrow&&xo(o)!=null&&$!==V&&u.reference[w]/2-($<j?z:q)-_[w]/2<0,U=G?$<j?$-j:$-K:0;return{[C]:x[C]+U,data:{[C]:V,centerOffset:$-V-U,...G&&{alignmentOffset:U}},reset:G}}}),K8=(e,t)=>({...$8(e),options:[e,t]}),Y8={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 i6().fn(e)).data?.referenceHidden||u}}}},X8={sideX:"left",sideY:"top"};function hR(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 hC(e,t,n){const{rects:s,placement:o}=e;return{side:hR(t,Br(o),n),align:xo(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function w0(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:x,mounted:C,collisionAvoidance:w,shiftCrossAxis:_=!1,nodeId:y,adaptiveOrigin:v,lazyFlip:b=!1,externalTree:E}=e,[T,A]=k.useState(null);!C&&T!==null&&A(null);const M=w.side||"flip",L=w.align||"flip",D=w.fallbackAxisSide||"end",H=typeof t=="function"?t:void 0,z=De(H),q=H?z:t,j=hn(t),$=Da()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[s],G=u==="center"?V:`${V}-${u}`;let U=l;const P=1,B=s==="bottom"?P:0,I=s==="top"?P:0,W=s==="right"?P:0,Y=s==="left"?P:0;typeof U=="number"?U={top:U+B,right:U+Y,bottom:U+I,left:U+W}:U&&(U={top:(U.top||0)+B,right:(U.right||0)+Y,bottom:(U.bottom||0)+I,left:(U.left||0)+W});const J={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:U},Z=k.useRef(null),ee=hn(o),X=hn(h),ne=[e6(Ye=>{const st=hC(Ye,s,$),Ct=typeof ee.current=="function"?ee.current(st):ee.current,lt=typeof X.current=="function"?X.current(st):X.current;return{mainAxis:Ct,crossAxis:lt,alignmentAxis:lt}},[typeof o!="function"?o:0,typeof h!="function"?h:0,$,s])],re=L==="none"&&M!=="shift",oe=!re&&(d||_||M==="shift"),le=M==="none"?null:r6({...J,padding:{top:U.top+P,right:U.right+P,bottom:U.bottom+P,left:U.left+P},mainAxis:!_&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),_e=re?null:t6(Ye=>{const st=_r(Ye.elements.floating).documentElement;return{...J,rootBoundary:_?{x:0,y:0,width:st.clientWidth,height:st.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||_?void 0:n6(Ct=>{if(!Z.current)return{};const{width:lt,height:nn}=Z.current.getBoundingClientRect(),kt=ts(Br(Ct.placement)),vt=kt==="y"?lt:nn,Ze=kt==="y"?U.left+U.right:U.top+U.bottom;return{offset:vt/2+Ze/2}})}},[J,d,_,U,L]);M==="shift"||L==="shift"||u==="center"?ne.push(_e,le):ne.push(le,_e),ne.push(s6({...J,apply({elements:{floating:Ye},rects:{reference:st},availableWidth:Ct,availableHeight:lt}){Object.entries({"--available-width":`${Ct}px`,"--available-height":`${lt}px`,"--anchor-width":`${st.width}px`,"--anchor-height":`${st.height}px`}).forEach(([nn,kt])=>{Ye.style.setProperty(nn,kt)})}}),K8(()=>({element:Z.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Ye){const{elements:st,middlewareData:Ct,placement:lt,rects:nn,y:kt}=Ye,vt=Br(lt),Ze=ts(vt),Ot=Z.current,jt=Ct.arrow?.x||0,ot=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,xt=jt+wt/2,Xe=ot+bt/2,Ht=Math.abs(Ct.shift?.y||0),kn=nn.reference.height/2,Yn=typeof o=="function"?o(hC(Ye,s,$)):o,zn=Ht>Yn,Cs={top:`${xt}px calc(100% + ${Yn}px)`,bottom:`${xt}px ${-Yn}px`,left:`calc(100% + ${Yn}px) ${Xe}px`,right:`${-Yn}px ${Xe}px`}[vt],Ha=`${xt}px ${nn.reference.y+kn-kt}px`;return st.floating.style.setProperty("--transform-origin",oe&&Ze==="y"&&zn?Ha:Cs),{}}},Y8,v),He(()=>{!C&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[C,x]);const ve=k.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:ue,x:Ie,y:Me,middlewareData:Ae,update:be,placement:Oe,context:me,isPositioned:de,floatingStyles:xe}=M6({rootContext:x,placement:G,middleware:ne,strategy:n,whileElementsMounted:g?void 0:(...Ye)=>eC(...Ye,ve),nodeId:y,externalTree:E}),{sideX:We,sideY:nt}=Ae.adaptiveOrigin||X8,Ve=de?n:"fixed",rt=k.useMemo(()=>v?{position:Ve,[We]:Ie,[nt]:Me}:{position:Ve,...xe},[v,Ve,We,Ie,nt,Me,xe]),Je=k.useRef(null);He(()=>{if(!C)return;const Ye=j.current,st=typeof Ye=="function"?Ye():Ye,lt=(pC(st)?st.current:st)||null||null;lt!==Je.current&&(he.setPositionReference(lt),Je.current=lt)},[C,he,q,j]),k.useEffect(()=>{if(!C)return;const Ye=j.current;typeof Ye!="function"&&pC(Ye)&&Ye.current!==Je.current&&(he.setPositionReference(Ye.current),Je.current=Ye.current)},[C,he,q,j]),k.useEffect(()=>{if(g&&C&&ue.domReference&&ue.floating)return eC(ue.domReference,ue.floating,be,ve)},[g,C,ue,be,ve]);const dt=Br(Oe),Ce=hR(s,dt,$),Be=xo(Oe)||"center",Re=!!Ae.hide?.referenceHidden;He(()=>{b&&C&&de&&A(dt)},[b,C,de,dt]);const et=k.useMemo(()=>({position:"absolute",top:Ae.arrow?.y,left:Ae.arrow?.x}),[Ae.arrow]),at=Ae.arrow?.centerOffset!==0;return k.useMemo(()=>({positionerStyles:rt,arrowStyles:et,arrowRef:Z,arrowUncentered:at,side:Ce,align:Be,physicalSide:dt,anchorHidden:Re,refs:he,context:me,isPositioned:de,update:be}),[rt,et,Z,at,Ce,Be,dt,Re,he,me,de,be])}function pC(e){return e!=null&&"current"in e}const pR=k.createContext(void 0);function E0(){const e=k.useContext(pR);if(!e)throw new Error(Pt(59));return e}function Hh(e,t){e&&Object.assign(e.style,t)}const mR={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Q8={position:"fixed"},Z8=k.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:x=5,sticky:C=!1,disableAnchorTracking:w,alignItemWithTrigger:_=!0,collisionAvoidance:y=X_,...v}=t,{store:b,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:D,popupRef:H,setValue:z}=qs(),q=lR(),j=Le(b,ht.open),K=Le(b,ht.mounted),$=Le(b,ht.modal),V=Le(b,ht.value),G=Le(b,ht.openMethod),U=Le(b,ht.positionerElement),P=Le(b,ht.triggerElement),B=Le(b,ht.isItemEqualToValue),I=k.useRef(null),W=k.useRef(null),[Y,J]=k.useState(_),Z=K&&Y&&G!=="touch";!K&&Y!==_&&J(_),He(()=>{K||(ht.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),ht.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,K]),k.useImperativeHandle(A,()=>Z),yp((Z||$)&&j&&G!=="touch",P);const ee=w0({anchor:s,floatingRootContext:q,positionMethod:o,mounted:K,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:x,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w??Z,collisionAvoidance:y,keepMounted:!0}),X=Z?"none":ee.side,F=Z?Q8:ee.positionerStyles,se=k.useMemo(()=>{const he={};return j||(he.pointerEvents="none"),{role:"presentation",hidden:!K,style:{...F,...he}}},[j,K,F]),ne=k.useMemo(()=>({open:j,side:X,align:ee.align,anchorHidden:ee.anchorHidden}),[j,X,ee.align,ee.anchorHidden]),re=De(he=>{b.set("positionerElement",he)}),oe=ct("div",t,{ref:[n,re],state:ne,stateAttributesMapping:bo,props:[se,v]}),le=k.useRef(0),_e=De(he=>{if(he.size===0&&le.current===0||L.current.length===0)return;const ue=le.current;if(le.current=he.size,he.size===ue)return;const Ie=Ue(Mn);if(ue!==0&&!b.state.multiple&&V!==null&&Gl(L.current,V,B)===-1){const Ae=D.current,Oe=Ae!=null&&oa(L.current,Ae,B)?Ae:null;z(Oe,Ie),Oe===null&&(b.set("selectedIndex",null),M.current=null)}if(ue!==0&&b.state.multiple&&Array.isArray(V)){const Me=V.filter(Ae=>oa(L.current,Ae,B));(Me.length!==V.length||Me.some(Ae=>!oa(V,Ae,B)))&&(z(Me,Ie),Me.length===0&&(b.set("selectedIndex",null),M.current=null))}if(j&&Z){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Me={height:""};Hh(U,Me),Hh(H.current,Me)}}),ve=k.useMemo(()=>({...ee,side:X,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:I,scrollDownArrowRef:W}),[ee,X,Z,J]);return S.jsx(od,{elementsRef:E,labelsRef:T,onMapChange:_e,children:S.jsxs(pR.Provider,{value:ve,children:[K&&$&&S.jsx(_p,{inert:vp(!j),cutout:P}),oe]})})});function gR(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 Kf="base-ui-disable-scrollbar",Hu={className:Kf,element:S.jsx("style",{href:Kf,precedence:"base-ui:low",children:`.${Kf}{scrollbar-width:none}.${Kf}::-webkit-scrollbar{display:none}`})},J8=k.createContext(void 0);function R0(e){return k.useContext(J8)}function k0(e){return e==="starting"?GO:tn}const eP={...bo,...Ws},tP=k.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:x,handleScrollArrowVisibility:C,scrollHandlerRef:w}=qs(),{side:_,align:y,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:b,scrollDownArrowRef:E,scrollUpArrowRef:T}=E0(),A=R0()!=null,M=lR(),L=Qt(),D=Le(h,ht.id),H=Le(h,ht.open),z=Le(h,ht.mounted),q=Le(h,ht.popupProps),j=Le(h,ht.transitionStatus),K=Le(h,ht.triggerElement),$=Le(h,ht.positionerElement),V=Le(h,ht.listElement),G=k.useRef(0),U=k.useRef(!1),P=k.useRef(0),B=k.useRef(!1),I=k.useRef({}),W=Ju(),Y=De(X=>{if(!$||!a.current||!B.current)return;if(U.current||!v){C();return}const F=$.style.top==="0px",se=$.style.bottom==="0px",ne=$.getBoundingClientRect().height,re=_r($),oe=getComputedStyle($),le=parseFloat(oe.marginTop),_e=parseFloat(oe.marginBottom),ve=re.documentElement.clientHeight-le-_e,he=X.scrollTop,ue=X.scrollHeight,Ie=X.clientHeight,Me=ue-Ie;let Ae=null,be=null,Oe=!1;if(F){const me=Me-he,de=ne+me,xe=Math.min(de,ve);Ae=xe,xe!==ve?be=Me:Oe=!0}else if(se){const me=he-0,de=ne+me,xe=Math.min(de,ve),We=de-ve;Ae=xe,xe!==ve?be=0:(Oe=!0,he<Me&&(be=he-(me-We)))}Ae!=null&&($.style.height=`${Ae}px`),be!=null&&(X.scrollTop=be),Oe&&(U.current=!0),C()});k.useImperativeHandle(w,()=>Y,[Y]),Vr({open:H,ref:a,onComplete(){H&&l?.(!0)}});const J=k.useMemo(()=>({open:H,transitionStatus:j,side:_,align:y}),[H,j,_,y]);He(()=>{!$||!a.current||Object.keys(I.current).length||(I.current={top:$.style.top||"0",left:$.style.left||"0",right:$.style.right,height:$.style.height,bottom:$.style.bottom,minHeight:$.style.minHeight,maxHeight:$.style.maxHeight,marginTop:$.style.marginTop,marginBottom:$.style.marginBottom})},[a,$]),He(()=>{z||v||(B.current=!1,U.current=!1,G.current=0,P.current=0,Hh($,I.current))},[z,v,$,a]),He(()=>{const X=a.current;if(!(!z||!K||!$||!X)){if(!v){B.current=!0,W.request(C);return}queueMicrotask(()=>{const F=getComputedStyle($),se=getComputedStyle(X),ne=_r(K),re=Rn($),oe=K.getBoundingClientRect(),le=$.getBoundingClientRect(),_e=oe.left,ve=oe.height,he=V||X,ue=he.scrollHeight,Ie=parseFloat(se.borderBottomWidth),Me=parseFloat(F.marginTop)||10,Ae=parseFloat(F.marginBottom)||10,be=parseFloat(F.minHeight)||100,Oe=5,me=5,de=20,xe=ne.documentElement.clientHeight-Me-Ae,We=ne.documentElement.clientWidth,nt=xe-oe.bottom+ve,Ve=f.current,rt=p.current;let Je=0,dt=0;if(Ve&&rt){const vt=rt.getBoundingClientRect(),Ze=Ve.getBoundingClientRect(),Ot=vt.left-_e,jt=Ze.left-le.left,ot=vt.top-oe.top+vt.height/2,wt=Ze.top-le.top+Ze.height/2;Je=Ot-jt,dt=wt-ot}const Ce=nt+dt+Ae+Ie;let Be=Math.min(xe,Ce);const Re=xe-Me-Ae,et=Ce-Be,at=Math.max(Oe,_e+Je),Ye=We-me,st=Math.max(0,at+le.width-Ye);$.style.left=`${at-st}px`,$.style.height=`${Be}px`,$.style.maxHeight="auto",$.style.marginTop=`${Me}px`,$.style.marginBottom=`${Ae}px`,X.style.height="100%";const Ct=he.scrollHeight-he.clientHeight,lt=et>=Ct;lt&&(Be=Math.min(xe,le.height)-(et-Ct));const nn=oe.top<de||oe.bottom>xe-de||Be<Math.min(ue,be),kt=(re.visualViewport?.scale??1)!==1&&o0;if(nn||kt){B.current=!0,Hh($,I.current),er.flushSync(()=>b(!1));return}if(lt){const vt=Math.max(0,xe-Ce);$.style.top=le.height>=Re?"0":`${vt}px`,$.style.height=`${Be}px`,he.scrollTop=he.scrollHeight-he.clientHeight,G.current=Math.max(be,Be)}else $.style.bottom="0",G.current=Math.max(be,Be),he.scrollTop=et;G.current===xe&&(U.current=!0),C(),setTimeout(()=>{B.current=!0})})}},[h,z,$,K,p,f,a,C,v,b,W,E,T,V]),k.useEffect(()=>{if(!v||!$||!z)return;const X=Rn($);function F(se){d(!1,Ue(b4,se))}return X.addEventListener("resize",F),()=>{X.removeEventListener("resize",F)}},[d,v,$,z]);const Z={...V?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${D}-list`},onKeyDown(X){g.current=!0,A&&x0.has(X.key)&&X.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(X){if(gR(X)||X.pointerType==="touch")return;const F=X.currentTarget;L.start(0,()=>{h.set("activeIndex",null),F.focus({preventScroll:!0})})},onScroll(X){V||w.current?.(X.currentTarget)},...v&&{style:V?{height:"100%"}:mR}},ee=ct("div",t,{ref:[n,a],state:J,stateAttributesMapping:eP,props:[q,Z,k0(j),{className:!V&&v?Hu.className:void 0},u]});return S.jsxs(k.Fragment,{children:[Hu.element,S.jsx(fp,{context:M,modal:!1,disabled:!z,restoreFocus:!0,children:ee})]})}),nP=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=qs(),{alignItemWithTriggerActive:l}=E0(),d=Le(h,ht.hasScrollArrows),p=Le(h,ht.openMethod),f=Le(h,ht.multiple),x={id:`${Le(h,ht.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(w){a.current?.(w.currentTarget)},...l&&{style:mR},className:d&&p!=="touch"?Hu.className:void 0},C=De(w=>{h.set("listElement",w)});return ct("div",t,{ref:[n,C],props:[x,u]})});let T0=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ad(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}=F8(),g=k.useRef(-1),[x,C]=k.useState(u??(o===T0.GuessFromOrder?()=>{if(g.current===-1){const y=f.current;f.current+=1,g.current=y}return g.current}:-1)),w=k.useRef(null),_=k.useCallback(y=>{if(w.current=y,x!==-1&&y!==null&&(d.current[x]=y,p)){const v=t!==void 0;p.current[x]=v?t:s?.current?.textContent??y.textContent}},[x,d,p,t,s]);return He(()=>{if(u!=null)return;const y=w.current;if(y)return h(y,n),()=>{a(y)}},[u,h,a,n]),He(()=>{if(u==null)return l(y=>{const v=w.current?y.get(w.current)?.index:null;v!=null&&C(v)})},[u,l,C]),k.useMemo(()=>({ref:_,index:x}),[x,_])}const vR=k.createContext(void 0);function L0(){const e=k.useContext(vR);if(!e)throw new Error(Pt(57));return e}const rP=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,label:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=k.useRef(null),f=ad({label:h,textRef:p,indexGuessBehavior:T0.GuessFromOrder}),{store:g,getItemProps:x,setOpen:C,setValue:w,selectionRef:_,typingRef:y,valuesRef:v,keyboardActiveRef:b,multiple:E,highlightItemOnHover:T}=qs(),A=Qt(),M=Le(g,ht.isActive,f.index),L=Le(g,ht.isSelected,f.index,u),D=Le(g,ht.isSelectedByFocus,f.index),H=Le(g,ht.isItemEqualToValue),z=f.index,q=z!==-1,j=k.useRef(null),K=hn(z);He(()=>{if(!q)return;const ee=v.current;return ee[z]=u,()=>{delete ee[z]}},[q,z,u,v]),He(()=>{if(!q)return;const ee=g.state.value;let X=ee;E&&Array.isArray(ee)&&ee.length>0&&(X=ee[ee.length-1]),X!==void 0&&xi(X,u,H)&&g.set("selectedIndex",z)},[q,z,E,H,g,u]);const $=k.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),V=x({active:M,selected:L});V.onFocus=void 0,V.id=void 0;const G=k.useRef(null),U=k.useRef("mouse"),P=k.useRef(!1),{getButtonProps:B,buttonRef:I}=yr({disabled:a,focusableWhenDisabled:!0,native:l});function W(ee){const X=g.state.value;if(E){const F=Array.isArray(X)?X:[],se=L?uR(F,u,H):[...F,u];w(se,Ue(ha,ee))}else w(u,Ue(ha,ee)),C(!1,Ue(ha,ee))}const Y={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",z)},onMouseEnter(){!b.current&&g.state.selectedIndex===null&&g.set("activeIndex",z)},onMouseMove(){T&&g.set("activeIndex",z)},onMouseLeave(ee){!T||b.current||gR(ee)||A.start(0,()=>{g.state.activeIndex===z&&g.set("activeIndex",null)})},onTouchStart(){_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){G.current=ee.key,g.set("activeIndex",z)},onClick(ee){P.current=!1,!(ee.type==="keydown"&&G.current===null)&&(a||G.current===" "&&y.current||U.current!=="touch"&&!M||(G.current=null,W(ee.nativeEvent)))},onPointerEnter(ee){U.current=ee.pointerType},onPointerDown(ee){U.current=ee.pointerType,P.current=!0},onMouseUp(ee){if(a)return;if(P.current){P.current=!1;return}const X=!_.current.allowSelectedMouseUp&&L,F=!_.current.allowUnselectedMouseUp&&!L;X||F||U.current!=="touch"&&!M||W(ee.nativeEvent)}},J=ct("div",t,{ref:[I,n,f.ref,j],state:$,props:[V,Y,d,B]}),Z=k.useMemo(()=>({selected:L,indexRef:K,textRef:p,selectedByFocus:D,hasRegistered:q}),[L,K,p,D,q]);return S.jsx(vR.Provider,{value:Z,children:J})})),sP=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=L0();return s||o?S.jsx(iP,{...t,ref:n}):null}),iP=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=L0(),a=k.useRef(null),{transitionStatus:l,setMounted:d}=wi(h),p=k.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=ct("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Ws});return Vr({open:h,ref:a,onComplete(){h||d(!1)}}),f})),oP=k.memo(k.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=L0(),{selectedItemTextRef:a}=qs(),{className:l,render:d,...p}=t,f=k.useCallback(x=>{if(!x||!h)return;const C=a.current===null||!a.current.isConnected;(u||C&&s.current===0)&&(a.current=x)},[a,s,u,h]);return ct("div",t,{ref:[f,n,o],props:p})})),_R=k.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}=qs(),{side:x,scrollDownArrowRef:C,scrollUpArrowRef:w}=E0(),_=u==="up"?ht.scrollUpArrowVisible:ht.scrollDownArrowVisible,y=Le(l,_),v=Le(l,ht.openMethod),b=y&&v!=="touch",E=Qt(),T=u==="up"?w:C,{transitionStatus:A,setMounted:M}=wi(b);He(()=>(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]),Vr({open:b,ref:T,onComplete(){b||M(!1)}});const L=k.useMemo(()=>({direction:u,visible:b,side:x,transitionStatus:A}),[u,b,x,A]),H=ct("div",t,{ref:[n,T],state:L,props:[{"aria-hidden":!0,children:u==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(q){if(q.movementX===0&&q.movementY===0||E.isStarted())return;l.set("activeIndex",null);function j(){const K=l.state.listElement??d.current;if(!K)return;l.set("activeIndex",null),f();const $=K.scrollTop===0,V=Math.round(K.scrollTop+K.clientHeight)>=K.scrollHeight;if(p.current.length===0&&(u==="up"?l.set("scrollUpArrowVisible",!$):l.set("scrollDownArrowVisible",!V)),u==="up"&&$||u==="down"&&V){E.clear();return}if((l.state.listElement||d.current)&&p.current&&p.current.length>0){const U=p.current,P=T.current?.offsetHeight||0;if(u==="up"){let B=0;const I=K.scrollTop+P;for(let Y=0;Y<U.length;Y+=1){const J=U[Y];if(J&&J.offsetTop>=I){B=Y;break}}const W=Math.max(0,B-1);if(W<B){const Y=U[W];Y&&(K.scrollTop=Math.max(0,Y.offsetTop-P))}else K.scrollTop=0}else{let B=U.length-1;const I=K.scrollTop+K.clientHeight-P;for(let Y=0;Y<U.length;Y+=1){const J=U[Y];if(J&&J.offsetTop+J.offsetHeight>I){B=Math.max(0,Y-1);break}}const W=Math.min(U.length-1,B+1);if(W>B){const Y=U[W];Y&&(K.scrollTop=Y.offsetTop+Y.offsetHeight-K.clientHeight+P)}else K.scrollTop=K.scrollHeight-K.clientHeight}}E.start(40,j)}E.start(40,j)},onMouseLeave(){E.clear()}},a]});return b||h?H:null}),aP=k.forwardRef(function(t,n){return S.jsx(_R,{...t,ref:n,direction:"down"})}),lP=k.forwardRef(function(t,n){return S.jsx(_R,{...t,ref:n,direction:"up"})}),Dl=P8;function Pl({className:e,...t}){return S.jsx(B8,{"data-slot":"select-value",className:ze("flex flex-1 text-left",e),...t})}function Il({className:e,size:t="default",children:n,...s}){return S.jsxs(j8,{"data-slot":"select-trigger","data-size":t,className:ze("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,S.jsx(z8,{render:S.jsx(Se,{icon:u4,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function jl({className:e,children:t,side:n="bottom",sideOffset:s=4,align:o="center",alignOffset:u=0,alignItemWithTrigger:h=!0,...a}){return S.jsx(V8,{children:S.jsx(Z8,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:S.jsxs(tP,{"data-slot":"select-content",className:ze("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:[S.jsx(cP,{}),S.jsx(nP,{children:t}),S.jsx(uP,{})]})})})}function pr({className:e,children:t,...n}){return S.jsxs(rP,{"data-slot":"select-item",className:ze("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:[S.jsx(oP,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),S.jsx(sP,{render:S.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:S.jsx(Se,{icon:La,strokeWidth:2,className:"pointer-events-none"})})]})}function cP({className:e,...t}){return S.jsx(lP,{"data-slot":"select-scroll-up-button",className:ze("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:S.jsx(Se,{icon:B2,strokeWidth:2})})}function uP({className:e,...t}){return S.jsx(aP,{"data-slot":"select-scroll-down-button",className:ze("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:S.jsx(Se,{icon:P2,strokeWidth:2})})}const yR=k.createContext(void 0);function A0(){const e=k.useContext(yR);if(e===void 0)throw new Error(Pt(64));return e}let dP=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const O0={tabActivationDirection:e=>({[dP.activationDirection]:e})},fP=k.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:l,...d}=t,p=Da(),f=Object.hasOwn(t,"defaultValue"),g=k.useRef([]),[x,C]=k.useState(()=>new Map),[w,_]=ss({controlled:l,default:o,name:"Tabs",state:"value"}),y=l!==void 0,[v,b]=k.useState(()=>new Map),[E,T]=k.useState("none"),A=De((G,U)=>{u?.(G,U),!U.isCanceled&&(_(G),T(U.activationDirection))}),M=De((G,U)=>{C(P=>{if(P.get(G)===U)return P;const B=new Map(P);return B.set(G,U),B})}),L=De((G,U)=>{C(P=>{if(!P.has(G)||P.get(G)!==U)return P;const B=new Map(P);return B.delete(G),B})}),D=k.useCallback(G=>x.get(G),[x]),H=k.useCallback(G=>{for(const U of v.values())if(G===U?.value)return U?.id},[v]),z=k.useCallback(G=>{if(G===void 0)return null;for(const[U,P]of v.entries())if(P!=null&&G===(P.value??P.index))return U;return null},[v]),q=k.useMemo(()=>({direction:p,getTabElementBySelectedValue:z,getTabIdByPanelValue:H,getTabPanelIdByValue:D,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:b,unregisterMountedTabPanel:L,tabActivationDirection:E,value:w}),[p,z,H,D,A,h,M,b,L,E,w]),j=k.useMemo(()=>{for(const G of v.values())if(G!=null&&G.value===w)return G},[v,w]),K=k.useMemo(()=>{for(const G of v.values())if(G!=null&&!G.disabled)return G.value},[v]);He(()=>{if(y||v.size===0)return;const G=j?.disabled,U=j==null&&w!==null;if(f&&G&&w===o||!G&&!U)return;const B=K??null;w!==B&&(_(B),T("none"))},[o,K,f,y,j,T,_,v,w]);const V=ct("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:O0});return S.jsx(yR.Provider,{value:q,children:S.jsx(od,{elementsRef:g,children:V})})}),bR="data-composite-item-active";function xR(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=K_(),{ref:o,index:u}=ad(e),h=n===u,a=k.useRef(null),l=os(o,a);return{compositeProps:k.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 SR=k.createContext(void 0);function hP(){const e=k.useContext(SR);if(e===void 0)throw new Error(Pt(65));return e}const pP=k.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}=A0(),{activateOnFocus:x,highlightedTabIndex:C,onTabActivation:w,setHighlightedTabIndex:_,tabsListElement:y}=hP(),v=vr(a),b=k.useMemo(()=>({disabled:o,id:v,value:h}),[o,v,h]),{compositeProps:E,compositeRef:T,index:A}=xR({metadata:b}),M=h===p,L=k.useRef(!1);He(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&C!==A))return;const P=y;if(P!=null){const B=ms(_r(P));if(B&&ft(P,B))return}o||_(A)},[M,A,C,_,o,y]);const{getButtonProps:D,buttonRef:H}=yr({disabled:o,native:l,focusableWhenDisabled:!0}),z=f(h),q=k.useRef(!1),j=k.useRef(!1);function K(P){M||o||w(h,Ue(Mn,P.nativeEvent,void 0,{activationDirection:"none"}))}function $(P){M||(A>-1&&!o&&_(A),!o&&x&&(!q.current||q.current&&j.current)&&w(h,Ue(Mn,P.nativeEvent,void 0,{activationDirection:"none"})))}function V(P){if(M||o)return;q.current=!0;function B(){q.current=!1,j.current=!1}(!P.button||P.button===0)&&(j.current=!0,_r(P.currentTarget).addEventListener("pointerup",B,{once:!0}))}const G=k.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return ct("button",t,{state:G,ref:[n,H,T],props:[E,{role:"tab","aria-controls":z,"aria-selected":M,id:v,onClick:K,onFocus:$,onPointerDown:V,[bR]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,D]})});let mP=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const gP=k.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:x}=A0(),C=vr(),w=k.useMemo(()=>({id:C,value:o}),[C,o]),{ref:_,index:y}=ad({metadata:w}),v=o!==l,b=d(o),E=k.useMemo(()=>({hidden:v,orientation:p,tabActivationDirection:f}),[v,p,f]),T=ct("div",t,{state:E,ref:[n,_],props:[{"aria-labelledby":b,hidden:v,id:C??void 0,role:"tabpanel",tabIndex:v?-1:0,[mP.index]:y},a],stateAttributesMapping:O0});return He(()=>{if(!(v&&!h)&&C!=null)return g(o,C),()=>{x(o,C)}},[v,h,o,C,g,x]),!v||h?T:null});function vP(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const _P=[];function yP(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:x=_P}=e,[C,w]=k.useState(0),_=n>1,y=k.useRef(null),v=os(y,d),b=k.useRef([]),E=k.useRef(!1),T=a??C,A=De((D,H=!1)=>{if((l??w)(D),H){const z=b.current[D];aC(y.current,z,h,u)}}),M=De(D=>{if(D.size===0||E.current)return;E.current=!0;const H=Array.from(D.keys()),z=H.find(j=>j?.hasAttribute(bR))??null,q=z?H.indexOf(z):-1;q!==-1&&A(q),aC(y.current,z,h,u)}),L=k.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:v,onFocus(D){!y.current||!oC(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const H=p?Z6:QE;if(!H.has(D.key)||bP(D,x)||!y.current)return;const q=h==="rtl",j=q?zu:Ml,K={horizontal:j,vertical:sa,both:j}[u],$=q?Ml:zu,V={horizontal:$,vertical:Ol,both:$}[u];if(oC(D.target)&&!vP(D.target)){const Y=D.target.selectionStart,J=D.target.selectionEnd,Z=D.target.value??"";if(Y==null||D.shiftKey||Y!==J||D.key!==V&&Y<Z.length||D.key!==K&&Y>0)return}let G=T;const U=uh(b,g),P=a_(b,g);if(_){const Y=t||Array.from({length:b.current.length},()=>({width:1,height:1})),J=uE(Y,n,o),Z=J.findIndex(X=>X!=null&&!ho(b,X,g)),ee=J.reduce((X,F,se)=>F!=null&&!ho(b,F,g)?se:X,-1);G=J[cE({current:J.map(X=>X?b.current[X]:null)},{event:D,orientation:u,loopFocus:s,cols:n,disabledIndices:fE([...g||b.current.map((X,F)=>ho(b,F)?F:void 0),void 0],J),minIndex:Z,maxIndex:ee,prevIndex:dE(T>P?U:T,Y,J,n,D.key===sa?"bl":D.key===Ml?"tr":"tl"),rtl:q})]}const B={horizontal:[j],vertical:[sa],both:[j,sa]}[u],I={horizontal:[$],vertical:[Ol],both:[$,Ol]}[u],W=_?H:{horizontal:p?X6:YE,vertical:p?Q6:XE,both:H}[u];p&&(D.key===td?G=U:D.key===nd&&(G=P)),G===T&&(B.includes(D.key)||I.includes(D.key))&&(s&&G===P&&B.includes(D.key)?G=U:s&&G===U&&I.includes(D.key)?G=P:G=Wn(b,{startingIndex:G,decrement:I.includes(D.key),disabledIndices:g})),G!==T&&!kl(b,G)&&(f&&D.stopPropagation(),W.has(D.key)&&D.preventDefault(),A(G,!0),queueMicrotask(()=>{b.current[G]?.focus()}))}}),[n,o,h,g,b,p,T,_,t,s,v,x,A,u,f]);return k.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:b,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,b,g,M])}function bP(e,t){for(const n of r8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function CR(e){const{render:t,className:n,refs:s=gr,props:o=gr,state:u=tn,stateAttributesMapping:h,highlightedIndex:a,onHighlightedIndexChange:l,orientation:d,dense:p,itemSizes:f,loopFocus:g,cols:x,enableHomeAndEndKeys:C,onMapChange:w,stopEventPropagation:_=!0,rootRef:y,disabledIndices:v,modifierKeys:b,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=Da(),{props:L,highlightedIndex:D,onHighlightedIndexChange:H,elementsRef:z,onMapChange:q,relayKeyboardEvent:j}=yP({itemSizes:f,cols:x,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:l,rootRef:y,stopEventPropagation:_,enableHomeAndEndKeys:C,direction:M,disabledIndices:v,modifierKeys:b}),K=ct(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),$=k.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:H,highlightItemOnHover:E,relayKeyboardEvent:j}),[D,H,E,j]);return S.jsx(g2.Provider,{value:$,children:S.jsx(od,{elementsRef:z,onMapChange:V=>{w?.(V),q(V)},children:K})})}const xP=k.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:x}=A0(),[C,w]=k.useState(0),[_,y]=k.useState(null),v=SP(f,p,_,l),b=De((M,L)=>{if(M!==f){const D=v(M);L.activationDirection=D,d(M,L)}}),E=k.useMemo(()=>({orientation:p,tabActivationDirection:x}),[p,x]),T={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=k.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:C,onTabActivation:b,setHighlightedTabIndex:w,tabsListElement:_,value:f}),[s,C,b,w,_,f]);return S.jsx(SR.Provider,{value:A,children:S.jsx(CR,{render:h,className:o,state:E,refs:[n,y],props:[T,a],stateAttributesMapping:O0,highlightedIndex:C,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:w,onMapChange:g,disabledIndices:gr})})});function mC(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 SP(e,t,n,s){const[o,u]=k.useState(null);return He(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:l}=mC(h,n);u(t==="horizontal"?a:l)},[t,s,n,e]),k.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}=mC(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 Cp({className:e,orientation:t="horizontal",...n}){return S.jsx(fP,{"data-slot":"tabs","data-orientation":t,className:ze("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const CP=Ta("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 wp({className:e,variant:t="default",...n}){return S.jsx(xP,{"data-slot":"tabs-list","data-variant":t,className:ze(CP({variant:t}),e),...n})}function mo({className:e,...t}){return S.jsx(pP,{"data-slot":"tabs-trigger",className:ze("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 ga({className:e,...t}){return S.jsx(gP,{"data-slot":"tabs-content",className:ze("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function wP(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,actionsRef:h,handle:a,triggerId:l,defaultTriggerId:d=null}=e,p=Si(),f=!!p,g=Gn(()=>a?.store??new tR({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 x=g.useState("payload");eR({store:g,actionsRef:h,parentContext:p?.store.context});const C=k.useMemo(()=>({store:g}),[g]);return S.jsx(n0.Provider,{value:C,children:typeof t=="function"?t({payload:x}):t})}const wR=k.createContext(void 0),ER=k.createContext(void 0),RR=k.createContext(void 0),kR=k.createContext("");function Ei(){const e=k.useContext(wR);if(!e)throw new Error(Pt(22));return e}function Ep(){const e=k.useContext(ER);if(!e)throw new Error(Pt(23));return e}function Pa(){const e=k.useContext(RR);if(!e)throw new Error(Pt(24));return e}function M0(){return k.useContext(kR)}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=>xi(o,t,n)):xi(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 EP(e,t){return(n,s)=>{if(n==null)return!1;const o=An(n,t);return e.contains(o,s)}}function RP(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 gC=new Map;function TR(e){return Array.isArray(e)?e.map(t=>TR(t)).join(","):e==null?"":String(e)}function kP(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${TR(e.locale)}|${JSON.stringify(t)}`,s=gC.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 gC.set(n,u),u}const TP=kP,LR=Symbol("none"),Go={value:LR,index:-1};function LP(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:x=!1,inputRef:C,grid:w=!1,items:_,filteredItems:y,filter:v,openOnInputClick:b=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:D=cR,virtualized:H=!1,inline:z=!1,fillInputOnItemPress:q=!0,modal:j=!1,limit:K=-1,autoComplete:$="list",locale:V,submitOnItemClick:G=!1}=e,{clearErrors:U}=rd(),{setDirty:P,validityData:B,shouldValidateOnChange:I,setFilled:W,name:Y,disabled:J,validation:Z}=as(),ee=xp({id:t}),X=TP({locale:V}),[F,se]=k.useState(!1),[ne,re]=k.useState(null),oe=k.useRef([]),le=k.useRef([]),_e=k.useRef(null),ve=k.useRef(null),he=k.useRef(null),ue=k.useRef(!0),Ie=k.useRef(!1),Me=k.useRef(null),Ae=k.useRef(null),be=k.useRef(null),Oe=k.useRef(Go),me=k.useRef(null),de=k.useRef([]),xe=k.useRef([]),We=J||f,nt=Y??p,Ve=l==="multiple",rt=l==="single",Je=a!==void 0||h!==void 0,dt=_!==void 0,Ce=y!==void 0;let Be;E==="always"?Be="always":Be=E?"input-change":!1;const[Re,et]=ss({controlled:o,default:Ve?s??gr:s,name:"Combobox",state:"selectedValue"}),at=k.useMemo(()=>v===null?()=>!0:v!==void 0?v:rt&&!F?RP(X,M,Re):EP(X,M),[v,rt,Re,F,X,M]),Ye=Gn(()=>Je?h??"":rt?An(Re,M):"").current,[st,Ct]=ss({controlled:a,default:Ye,name:"Combobox",state:"inputValue"}),[lt,nn]=ss({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),kt=dR(_),vt=ne??(st===""?"":String(st).trim()),Ze=rt?An(Re,M):"",Ot=rt&&!F&&vt!==""&&Ze!==""&&Ze.length===vt.length&&X.contains(Ze,vt),jt=Ot?"":vt,ot=dt&&Ce&&Ot,wt=k.useMemo(()=>_?kt?_.flatMap(Fe=>Fe.items):_:gr,[_,kt]),bt=k.useMemo(()=>{if(y&&!ot)return y;if(!_)return gr;if(kt){const tt=_,mt=[];let $t=0;for(const rn of tt){if(K>-1&&$t>=K)break;const vn=jt===""?rn.items:rn.items.filter(Js=>at(Js,jt,M));if(vn.length===0)continue;const Qs=K>-1?K-$t:1/0,Zs=vn.slice(0,Qs);if(Zs.length>0){const Js={...rn,items:Zs};mt.push(Js),$t+=Zs.length}}return mt}if(jt==="")return K>-1?wt.slice(0,K):wt;const Fe=[];for(const tt of wt){if(K>-1&&Fe.length>=K)break;at(tt,jt,M)&&Fe.push(tt)}return Fe},[y,ot,_,kt,jt,K,at,M,wt]),xt=k.useMemo(()=>kt?bt.flatMap(tt=>tt.items):bt,[bt,kt]),Xe=Gn(()=>new ma({id:ee,selectedValue:Re,open:lt,filter:at,query:vt,items:_,selectionMode:l,listRef:oe,labelsRef:le,popupRef:_e,emptyRef:he,inputRef:ve,keyboardActiveRef:ue,chipsContainerRef:Me,clearRef:Ae,valuesRef:de,allValuesRef:xe,selectionEventRef:be,name:nt,disabled:We,readOnly:g,required:x,grid:w,isGrouped:kt,virtualized:H,openOnInputClick:b,itemToStringLabel:M,isItemEqualToValue:D,modal:j,autoHighlight:Be,submitOnItemClick:G,hasInputValue:Je,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:z,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||sn,setOpen:sn,setInputValue:sn,setSelectedValue:sn,setIndices:sn,onItemHighlighted:sn,handleSelection:sn,getItemProps:()=>tn,forceMount:sn,requestSubmit:sn})).current,Ht=l==="none"?st:Re,kn=k.useMemo(()=>l==="none"?Ht:Array.isArray(Re)?Re.map(Fe=>gs(Fe,L)):gs(Re,L),[Ht,L,l,Re]),Yn=De(d),zn=De(n),Cs=Le(Xe,qe.activeIndex),Ha=Le(Xe,qe.selectedIndex),xr=Le(Xe,qe.positionerElement),pn=Le(Xe,qe.listElement),mn=Le(Xe,qe.triggerElement),ws=Le(Xe,qe.inputElement),Sr=Le(Xe,qe.inline),Ks=Le(Xe,qe.inputInsidePopup),Np=hn(mn),{mounted:vc,setMounted:Eo,transitionStatus:Ro}=wi(lt),{openMethod:Ys,triggerProps:Es,reset:ko}=bp(lt);sd({id:ee,name:nt,commit:Z.commit,value:Ht,controlRef:Ks?Np:ve,getValue:()=>kn});const ls=De(()=>{_?le.current=xt.map(Fe=>An(Fe,M)):Xe.set("forceMounted",!0)}),gn=k.useRef(Re);He(()=>{Re!==gn.current&&ls()},[ls,Re]);const tr=De(Fe=>{Xe.update(Fe);const tt=Fe.type||"none";if(Fe.activeIndex!==void 0)if(Fe.activeIndex===null)Oe.current!==Go&&(Oe.current=Go,Yn(void 0,mu(tt,void 0,{index:-1})));else{const mt=de.current[Fe.activeIndex];Oe.current={value:mt,index:Fe.activeIndex},Yn(mt,mu(tt,void 0,{index:Fe.activeIndex}))}}),nr=De((Fe,tt)=>{if(Ie.current=tt.reason===eo,e.onInputValueChange?.(Fe,tt),!tt.isCanceled){if(tt.reason===ra){const mt=Fe.trim()!=="";mt&&se(!0),me.current={hasQuery:mt},mt&&Be&&Xe.state.activeIndex==null&&Xe.set("activeIndex",0)}Ct(Fe)}}),Cr=De((Fe,tt)=>{lt!==Fe&&(tt.reason==="escape-key"&&dt&&xt.length===0&&!Xe.state.emptyRef.current&&tt.allowPropagation(),e.onOpenChange?.(Fe,tt),!tt.isCanceled&&(!Fe&&F&&(rt?(re(vt),vt===""&&se(!1)):Ve&&(Sr||Ks?tr({activeIndex:null}):re(vt),nr("",Ue(eo,tt.event)))),nn(Fe)))}),cs=De((Fe,tt)=>{if(u?.(Fe,tt),tt.isCanceled)return;et(Fe),(l==="none"&&_e.current&&q||rt&&!Xe.state.inputInsidePopup)&&nr(An(Fe,M),Ue(tt.reason,tt.event)),rt&&Fe!=null&&tt.reason!==ra&&F&&re(vt)}),Bp=De((Fe,tt)=>{let mt=tt;if(mt===void 0){if(Cs===null)return;mt=de.current[Cs]}const $t=Pn(Fe),rn=be.current??Fe;be.current=null;const vn=Ue(ha,rn),Qs=$t?.closest("a")?.getAttribute("href");if(Qs){Qs.startsWith("#")&&Cr(!1,vn);return}if(Ve){const Zs=Array.isArray(Re)?Re:[],us=oa(Zs,mt,Xe.state.isItemEqualToValue)?uR(Zs,mt,Xe.state.isItemEqualToValue):[...Zs,mt];if(cs(us,vn),!(ve.current?ve.current.value.trim()!=="":!1))return;Xe.state.inputInsidePopup?nr("",Ue(eo,vn.event)):Cr(!1,vn)}else cs(mt,vn),Cr(!1,vn)}),Va=De(()=>{if(!Xe.state.submitOnItemClick)return;const Fe=Xe.state.inputElement?.form;Fe&&typeof Fe.requestSubmit=="function"&&Fe.requestSubmit()}),Fa=De(()=>{if(Eo(!1),zn?.(!1),se(!1),ko(),re(null),tr(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ve&&ve.current&&ve.current.value!==""&&!Ie.current&&nr("",Ue(eo)),rt)if(Xe.state.inputInsidePopup)ve.current&&ve.current.value!==""&&nr("",Ue(eo));else{const Fe=An(Re,M);ve.current&&ve.current.value!==Fe&&nr(Fe,Ue(Fe===""?eo:Mn))}}),zp=k.useMemo(()=>Sr&&xr?{current:xr.closest('[role="dialog"]')}:_e,[Sr,xr]);Vr({enabled:!e.actionsRef,open:lt,ref:zp,onComplete(){lt||Fa()}}),k.useImperativeHandle(e.actionsRef,()=>({unmount:Fa}),[Fa]),He(function(){if(lt||l==="none")return;const tt=_?wt:xe.current;if(Ve){const mt=Array.isArray(Re)?Re:[],$t=mt[mt.length-1],rn=Gl(tt,$t,D);tr({selectedIndex:rn===-1?null:rn})}else{const mt=Gl(tt,Re,D);tr({selectedIndex:mt===-1?null:mt})}},[lt,Re,_,l,wt,Ve,D,tr]),He(()=>{_&&(de.current=xt,oe.current.length=xt.length)},[_,xt]),He(()=>{const Fe=me.current;if(Fe&&(Fe.hasQuery?Be&&Xe.set("activeIndex",0):Be==="always"&&Xe.set("activeIndex",0),me.current=null),!lt&&!Sr)return;const mt=dt||Ce?xt:de.current,$t=Xe.state.activeIndex;if($t==null){if(Be==="always"&&mt.length>0){Xe.set("activeIndex",0);return}Oe.current!==Go&&(Oe.current=Go,Xe.state.onItemHighlighted(void 0,mu(Mn,void 0,{index:-1})));return}if($t>=mt.length){Oe.current!==Go&&(Oe.current=Go,Xe.state.onItemHighlighted(void 0,mu(Mn,void 0,{index:-1}))),Xe.set("activeIndex",null);return}const rn=mt[$t],vn=Oe.current.value,Qs=vn!==LR&&Xe.state.isItemEqualToValue(rn,vn);(Oe.current.index!==$t||!Qs)&&(Oe.current={value:rn,index:$t},Xe.state.onItemHighlighted(rn,mu(Mn,void 0,{index:$t})))},[Cs,Be,Ce,dt,xt,Sr,lt,Xe]),He(()=>{if(!_||l==="none")return;const Fe=wt;if(Ve){const $t=Array.isArray(Re)?Re:gr,rn=$t.filter(vn=>oa(Fe,vn,Xe.state.isItemEqualToValue));rn.length!==$t.length&&et(rn);return}if(Re==null?!0:oa(Fe,Re,Xe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&oa(Fe,s,Xe.state.isItemEqualToValue)&&(mt=s),et(mt),!Xe.state.inputInsidePopup){const $t=An(mt,M);ve.current&&ve.current.value!==$t&&nr($t,Ue(Mn))}},[_,wt,Ve,l,Re,s,et,M,Xe,nr]),He(()=>{if(l==="none"){W(String(st)!=="");return}W(Ve?Array.isArray(Re)&&Re.length>0:Re!=null)},[W,l,st,Re,Ve]),k.useEffect(()=>{dt&&Be&&xt.length===0&&tr({activeIndex:null})},[dt,Be,xt.length,tr]),aa(vt,()=>{!lt||vt===""||vt===String(Ye)||se(!0)}),aa(Re,()=>{if(l!=="none"&&(U(nt),P(Re!==B.initialValue),I()?Z.commit(Re):Z.commit(Re,!0),Ve&&Xe.state.selectedIndex!==null&&(!Array.isArray(Re)||Re.length===0)&&tr({activeIndex:null,selectedIndex:null}),rt&&!Je&&!Ks)){const Fe=An(Re,M);st!==Fe&&nr(Fe,Ue(Mn))}}),aa(st,()=>{l==="none"&&(U(nt),P(st!==B.initialValue),I()?Z.commit(st):Z.commit(st,!0))}),aa(_,()=>{if(!rt||Je||Ks||F)return;const Fe=An(Re,M);st!==Fe&&nr(Fe,Ue(Mn))});const Xs=_0({open:Sr?!0:lt,onOpenChange:Cr,elements:{reference:Ks?mn:ws,floating:xr}});let Ri,wr;Sr||(Ri=w?"grid":"listbox",wr=lt?"true":"false");const or=k.useMemo(()=>{const Fe=ws?.tagName==="INPUT",tt=Fe||lt,mt=Fe?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return tt&&(mt.role="combobox",mt["aria-expanded"]=wr,mt["aria-haspopup"]=Ri,mt["aria-controls"]=lt?pn?.id:void 0,mt["aria-autocomplete"]=$),{reference:mt,floating:{role:"presentation"}}},[ws,lt,wr,Ri,pn?.id,$]),gd=ed(Xs,{enabled:!g&&!We&&b,event:"mousedown-only",toggle:!1,touchOpenDelay:Ks?0:50}),Hp=pp(Xs,{enabled:!g&&!We&&!Sr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Sr?!0:void 0,outsidePress(Fe){const tt=Pn(Fe);return!ft(mn,tt)&&!ft(Ae.current,tt)&&!ft(Me.current,tt)}}),_c=y0(Xs,{enabled:!g&&!We,id:ee,listRef:oe,activeIndex:Cs,selectedIndex:Ha,virtual:!0,loopFocus:!0,allowEscape:!Be,focusItemOnOpen:F||l==="none"&&!Be?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:w?2:1,orientation:w?"horizontal":void 0,disabledIndices:gr,onNavigate(Fe,tt){!tt&&!lt||Ro==="ending"||tr(tt?{activeIndex:Fe,type:ue.current?"keyboard":"pointer"}:{activeIndex:Fe})}}),{getReferenceProps:Ua,getFloatingProps:ki,getItemProps:yc}=rc([or,gd,Hp,_c]);iR(()=>{Xe.update({inline:z,popupProps:ki(),inputProps:Ua(),triggerProps:Es,getItemProps:yc,setOpen:Cr,setInputValue:nr,setSelectedValue:cs,setIndices:tr,onItemHighlighted:Yn,handleSelection:Bp,forceMount:ls,requestSubmit:Va})}),He(()=>{Xe.update({id:ee,selectedValue:Re,open:lt,mounted:vc,transitionStatus:Ro,items:_,inline:z,popupProps:ki(),inputProps:Ua(),triggerProps:Es,openMethod:Ys,getItemProps:yc,selectionMode:l,name:nt,disabled:We,readOnly:g,required:x,grid:w,isGrouped:kt,virtualized:H,onOpenChangeComplete:zn,openOnInputClick:b,itemToStringLabel:M,modal:j,autoHighlight:Be,isItemEqualToValue:D,submitOnItemClick:G,hasInputValue:Je,requestSubmit:Va})},[Xe,ee,Re,lt,vc,Ro,_,ki,Ua,yc,Ys,Es,l,nt,We,g,x,Z,w,kt,H,zn,b,M,j,D,G,Je,z,Va,Be]);const ar=os(C,Z.inputRef),bc=k.useMemo(()=>({query:vt,filteredItems:bt,flatFilteredItems:xt}),[vt,bt,xt]),vd=k.useMemo(()=>Array.isArray(Ht)?"":gs(Ht,L),[Ht,L]),xc=Ve&&Array.isArray(Re)&&Re.length>0,Ti=k.useMemo(()=>!Ve||!Array.isArray(Re)||!nt?null:Re.map(Fe=>{const tt=gs(Fe,L);return S.jsx("input",{type:"hidden",name:nt,value:tt},tt)}),[Ve,Re,nt,L]),_d=S.jsxs(k.Fragment,{children:[e.children,S.jsx("input",{...Z.getInputValidationProps({onFocus(){if(Ks){mn?.focus();return}(ve.current||mn)?.focus()},onChange(Fe){if(Fe.nativeEvent.defaultPrevented)return;const tt=Fe.target.value,mt=Ue(ra,Fe.nativeEvent);function $t(){if(Ve)return;if(l==="none"){P(tt!==B.initialValue),nr(tt,mt),I()&&Z.commit(tt);return}const rn=de.current.find(vn=>gs(vn,L).toLowerCase()===tt.toLowerCase());rn!=null&&(P(rn!==B.initialValue),cs?.(rn,mt),I()&&Z.commit(rn))}_?$t():(ls(),queueMicrotask($t))}}),id:ee,name:Ve||l==="none"?void 0:nt,disabled:We,required:x&&!xc,readOnly:g,value:vd,ref:ar,style:nc,tabIndex:-1,"aria-hidden":!0}),Ti]});return S.jsx(wR.Provider,{value:Xe,children:S.jsx(ER.Provider,{value:Xs,children:S.jsx(RR.Provider,{value:bc,children:S.jsx(kR.Provider,{value:st,children:_d})})})})}const Yf=2,AP={...Iu,...Ma},OP=k.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:x}=as(),{labelId:C}=Co(),w=Ei(),_=Le(w,qe.selectionMode),y=Le(w,qe.disabled),v=Le(w,qe.readOnly),b=Le(w,qe.listElement),E=Le(w,qe.triggerProps),T=Le(w,qe.triggerElement),A=Le(w,qe.inputInsidePopup),M=Le(w,qe.open),L=Le(w,qe.selectedValue),D=Le(w,qe.activeIndex),H=Le(w,qe.selectedIndex),z=Ep(),q=M0(),j=Qt(),K=d||y||h,$=k.useRef("");function V(Z){$.current=Z.pointerType}const G=z.select("domReferenceElement");k.useEffect(()=>{A&&T&&T!==G&&z.set("domReferenceElement",T)},[T,G,z,A]);const{reference:U}=b0(z,{enabled:!M&&!v&&!y&&_==="single",listRef:w.state.labelsRef,activeIndex:D,selectedIndex:H,onMatch(Z){const ee=w.state.valuesRef.current[Z];ee!==void 0&&w.state.setSelectedValue(ee,Ue("none"))}}),{reference:P}=ed(z,{enabled:!v&&!y,event:"mousedown"}),{buttonRef:B,getButtonProps:I}=yr({native:u,disabled:K}),W=k.useMemo(()=>({...l,open:M,disabled:K}),[l,M,K]),Y=De(Z=>{w.set("triggerElement",Z)});return ct("button",t,{ref:[n,B,Y],state:W,props:[E,P,U,{tabIndex:A?0:-1,disabled:K,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?b?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":C,onPointerDown:V,onPointerEnter:V,onFocus(){f(!0),!(K||v)&&j.start(0,w.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const Z=_==="none"?q:L;x.commit(Z)}},onMouseDown(Z){if(K||v||(A||z.set("domReferenceElement",Z.currentTarget),w.state.forceMount(),$.current!=="touch"&&(w.state.inputRef.current?.focus(),A||Z.preventDefault()),M))return;const ee=_r(Z.currentTarget);function X(F){if(!T)return;const se=Pn(F),ne=w.state.positionerElement,re=w.state.listElement;if(ft(T,se)||ft(ne,se)||ft(re,se)||se===T)return;const oe=C0(T),le=F.clientX>=oe.left-Yf&&F.clientX<=oe.right+Yf,_e=F.clientY>=oe.top-Yf&&F.clientY<=oe.bottom+Yf;le&&_e||w.state.setOpen(!1,Ue("cancel-open",F))}A&&ee.addEventListener("mouseup",X,{once:!0})},onKeyDown(Z){K||v||(Z.key==="ArrowDown"||Z.key==="ArrowUp")&&(fn(Z),w.state.setOpen(!0,Ue(Lu,Z.nativeEvent)),w.state.inputRef.current?.focus())}},x?x.getValidationProps(a):a,I],stateAttributesMapping:AP})}),MP=k.createContext(void 0);function DP(){return k.useContext(MP)}const AR=k.createContext(void 0);function D0(e){const t=k.useContext(AR);if(t===void 0&&!e)throw new Error(Pt(21));return t}const PP={...Iu,...Ma,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},IP=k.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:x}=as(),{labelId:C}=Co(),w=DP(),y=!!D0(!0),v=Ei(),{filteredItems:b}=Pa(),E=M0(),T=vr(h),A=Da(),M=Le(v,qe.disabled),L=Le(v,qe.readOnly),D=Le(v,qe.name),H=Le(v,qe.selectionMode),z=Le(v,qe.autoHighlight),q=Le(v,qe.inputProps),j=Le(v,qe.triggerProps),K=Le(v,qe.open),$=Le(v,qe.mounted),V=Le(v,qe.selectedValue),G=Le(v,qe.popupSide),U=Le(v,qe.positionerElement),P=!!z,B=$&&U?G:null,I=d||M||u,W=b.length===0,[Y,J]=k.useState(null),Z=k.useRef(!1),ee=De(ne=>{const re=y||v.state.inline;re&&!v.state.hasInputValue&&v.state.setInputValue("",Ue(Mn)),v.update({inputElement:ne,inputInsidePopup:re})}),X=k.useMemo(()=>({...l,open:K,disabled:I,readOnly:L,popupSide:B,listEmpty:W}),[l,K,I,L,B,W]);function F(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,v.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&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),ne.preventDefault()),re}return ct("input",t,{state:X,ref:[n,v.state.inputRef,ee],props:[q,j,{type:"text",value:t.value??Y??E,"aria-readonly":L||void 0,"aria-labelledby":C,disabled:I,readOnly:L,...H==="none"&&D&&{name:D},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const ne=H==="none"?E:V;x.commit(ne)}},onCompositionStart(ne){Oh||(Z.current=!0,J(ne.currentTarget.value))},onCompositionEnd(ne){Z.current=!1;const re=ne.currentTarget.value;J(null),v.state.setInputValue(re,Ue(ra,ne.nativeEvent))},onChange(ne){if(Z.current){const _e=ne.currentTarget.value;J(_e),_e===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,Ue(eo,ne.nativeEvent));const ve=_e.trim(),he=P&&ve!=="";!L&&!I&&ve!==""&&(v.state.setOpen(!0,Ue(ra,ne.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!he&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(ne.currentTarget.value,Ue(ra,ne.nativeEvent));const re=ne.currentTarget.value==="",oe=Ue(eo,ne.nativeEvent);re&&!v.state.inputInsidePopup&&(H==="single"&&v.state.setSelectedValue(null,oe),v.state.openOnInputClick||v.state.setOpen(!1,oe));const le=ne.currentTarget.value.trim();!L&&!I&&le!==""&&(v.state.setOpen(!0,Ue(ra,ne.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),K&&v.state.activeIndex!==null&&!P&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(ne){if(I||L||ne.ctrlKey||ne.shiftKey||ne.altKey||ne.metaKey)return;v.state.keyboardActiveRef.current=!0;const re=ne.currentTarget,oe=re.scrollWidth-re.clientWidth,le=A==="rtl";if(ne.key==="Home"){fn(ne);const ve=BS&&le?re.value.length:0;re.setSelectionRange(ve,ve),re.scrollLeft=0;return}if(ne.key==="End"){fn(ne);const ve=BS&&le?0:re.value.length;re.setSelectionRange(ve,ve),re.scrollLeft=le?-oe:oe;return}if(!$&&ne.key==="Escape"){const ve=H==="multiple"&&Array.isArray(V)?V.length===0:V===null,he=Ue(cp,ne.nativeEvent),ue=H==="multiple"?[]:null;v.state.setInputValue("",he),v.state.setSelectedValue(ue,he),!ve&&!v.state.inline&&!he.isPropagationAllowed&&ne.stopPropagation();return}if(w&&ne.key==="Backspace"&&re.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(V)&&V.length>0){const ve=V.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(ve,Ue(Mn,ne.nativeEvent));return}const _e=F(ne);if(w?.setHighlightedChipIndex(_e),_e!==void 0?w?.chipsRef.current[_e]?.focus():v.state.inputRef.current?.focus(),ne.which!==229&&ne.key==="Enter"&&K){const ve=v.state.activeIndex,he=ne.nativeEvent;if(ve===null){v.state.setOpen(!1,Ue(Mn,he));return}fn(ne);const ue=v.state.listRef.current[ve];ue&&(v.state.selectionEventRef.current=he,ue.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},x?x.getValidationProps(a):a],stateAttributesMapping:PP})}),jP={...Ws,...r0},NP=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,keepMounted:a=!1,...l}=t,{disabled:d}=as(),p=Ei(),f=Le(p,qe.selectionMode),g=Le(p,qe.disabled),x=Le(p,qe.readOnly),C=Le(p,qe.open),w=Le(p,qe.selectedValue),_=M0();let y=!1;f==="none"?y=_!=="":f==="single"?y=w!=null:y=Array.isArray(w)&&w.length>0;const v=d||g||u,{buttonRef:b,getButtonProps:E}=yr({native:h,disabled:v}),{mounted:T,transitionStatus:A,setMounted:M}=wi(y),L=k.useMemo(()=>({disabled:v,open:C,transitionStatus:A}),[v,C,A]);Vr({open:y,ref:p.state.clearRef,onComplete(){y||M(!1)}});const D=ct("button",t,{state:L,ref:[n,b,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":x||void 0,onMouseDown(z){z.preventDefault()},onClick(z){if(v||x)return;const q=p.state.keyboardActiveRef;p.state.setInputValue("",Ue(IS,z.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,Ue(IS,z.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:q.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:q.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},l,E],stateAttributesMapping:jP});return a||T?D:null}),BP=k.createContext(null);function zP(){return k.useContext(BP)}function HP(e){const{children:t}=e,{filteredItems:n}=Pa(),s=zP(),o=s?s.items:n;return o?S.jsx(k.Fragment,{children:o.map(t)}):null}const VP=k.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,l=Ei(),d=Ep(),p=!!D0(!0),{filteredItems:f}=Pa(),g=Le(l,qe.items),x=Le(l,qe.labelsRef),C=Le(l,qe.listRef),w=Le(l,qe.selectionMode),_=Le(l,qe.grid),y=Le(l,qe.popupProps),v=Le(l,qe.disabled),b=Le(l,qe.readOnly),E=Le(l,qe.virtualized),T=w==="multiple",A=f.length===0,M=De(j=>{l.set("positionerElement",j)}),L=De(j=>{l.set("listElement",j)}),D=k.useMemo(()=>typeof h=="function"?s||(s=S.jsx(HP,{children:h})):h,[h]),H=k.useMemo(()=>({empty:A}),[A]),z=d.useState("floatingId"),q=ct("div",t,{state:H,ref:[n,L,p?null:M],props:[y,{children:D,tabIndex:-1,id:z,role:_?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(j){if(!(v||b)&&j.key==="Enter"){const K=l.state.activeIndex;if(K==null)return;fn(j);const $=j.nativeEvent,V=l.state.listRef.current[K];V&&(l.state.selectionEventRef.current=$,V.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return E?q:S.jsx(od,{elementsRef:C,labelsRef:g?void 0:x,children:q})}),OR=k.createContext(void 0);function FP(){const e=k.useContext(OR);if(e===void 0)throw new Error(Pt(20));return e}const UP=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ei(),h=Le(u,qe.mounted),a=Le(u,qe.forceMounted);return h||s||a?S.jsx(OR.Provider,{value:s,children:S.jsx(dp,{ref:n,...o})}):null}),WP=k.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:x=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:_=X_,...y}=t,v=Ei(),{filteredItems:b}=Pa(),E=Ep(),T=FP(),A=Le(v,qe.modal),M=Le(v,qe.open),L=Le(v,qe.mounted),D=Le(v,qe.openMethod),H=Le(v,qe.triggerElement),z=Le(v,qe.inputElement),q=Le(v,qe.inputInsidePopup),j=b.length===0,$=w0({anchor:u??(q?H:z),floatingRootContext:E,positionMethod:h,mounted:L,side:a,sideOffset:d,align:l,alignOffset:p,arrowPadding:x,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:w,keepMounted:T,collisionAvoidance:_,lazyFlip:!0});yp(M&&A&&D!=="touch",H);const V=k.useMemo(()=>{const I={...$.positionerStyles};return M||(I.pointerEvents="none"),{role:"presentation",hidden:!L,style:I}},[M,L,$.positionerStyles]),G=k.useMemo(()=>({open:M,side:$.side,align:$.align,anchorHidden:$.anchorHidden,empty:j}),[M,$.side,$.align,$.anchorHidden,j]);He(()=>{v.set("popupSide",$.side)},[v,$.side]);const U=k.useMemo(()=>({side:$.side,align:$.align,arrowRef:$.arrowRef,arrowUncentered:$.arrowUncentered,arrowStyles:$.arrowStyles,anchorHidden:$.anchorHidden,isPositioned:$.isPositioned}),[$.side,$.align,$.arrowRef,$.arrowUncentered,$.arrowStyles,$.anchorHidden,$.isPositioned]),P=De(I=>{v.set("positionerElement",I)}),B=ct("div",t,{state:G,ref:[n,P],props:[V,y],stateAttributesMapping:bo});return S.jsxs(AR.Provider,{value:U,children:[L&&A&&S.jsx(_p,{inert:vp(!M),cutout:z??H}),B]})}),qP={...bo,...Ws},GP=k.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,l=Ei(),d=D0(),p=Ep(),{filteredItems:f}=Pa(),g=Le(l,qe.mounted),x=Le(l,qe.open),C=Le(l,qe.openMethod),w=Le(l,qe.transitionStatus),_=Le(l,qe.inputInsidePopup),y=Le(l,qe.inputElement),v=f.length===0;Vr({open:x,ref:l.state.popupRef,onComplete(){x&&l.state.onOpenChangeComplete(!0)}});const b=k.useMemo(()=>({open:x,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:w,empty:v}),[x,d.side,d.align,d.anchorHidden,w,v]),E=ct("div",t,{state:b,ref:[n,l.state.popupRef],props:[{role:_?"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()}},k0(w),a],stateAttributesMapping:qP}),A=u===void 0?_?L=>L==="touch"?l.state.popupRef.current:y:!1:u;let M;return h!=null?M=h:M=_?void 0:!1,S.jsx(fp,{context:p,disabled:!g,modal:!_,openInteractionType:C,initialFocus:A,returnFocus:M,children:E})}),MR=k.createContext(void 0);function DR(){const e=k.useContext(MR);if(!e)throw new Error(Pt(19));return e}const $P=k.createContext(!1);function KP(){return k.useContext($P)}const YP=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,index:h,disabled:a=!1,nativeButton:l=!1,...d}=t,p=k.useRef(!1),f=k.useRef(null),g=ad({index:h,textRef:f,indexGuessBehavior:T0.GuessFromOrder}),x=Ei(),C=KP(),{flatFilteredItems:w}=Pa(),_=Le(x,qe.open),y=Le(x,qe.selectionMode),v=Le(x,qe.readOnly),b=Le(x,qe.virtualized),E=Le(x,qe.isItemEqualToValue),T=y!=="none",A=h??(b?Gl(w,u,E):g.index),M=g.index!==-1,L=Le(x,qe.id),D=Le(x,qe.isActive,A),H=Le(x,qe.isSelected,u),z=Le(x,qe.items),q=Le(x,qe.getItemProps),j=k.useRef(null),K=L!=null&&M?`${L}-${A}`:void 0,$=H&&T;He(()=>{if(!(M&&(b||h!=null)))return;const Z=x.state.listRef.current;return Z[A]=j.current,()=>{delete Z[A]}},[M,b,A,h,x]),He(()=>{if(!M||z)return;const J=x.state.valuesRef.current;return J[A]=u,y!=="none"&&x.state.allValuesRef.current.push(u),()=>{delete J[A]}},[M,z,A,u,x,y]),He(()=>{if(!_){p.current=!1;return}if(!M||z)return;const J=x.state.selectedValue,Z=Array.isArray(J)?J[J.length-1]:J;xi(Z,u,E)&&x.set("selectedIndex",A)},[M,z,_,x,A,u,E]);const V=k.useMemo(()=>({disabled:a,selected:$,highlighted:D}),[a,$,D]),G=q({active:D,selected:$});G.id=void 0,G.onFocus=void 0;const{getButtonProps:U,buttonRef:P}=yr({disabled:a,focusableWhenDisabled:!0,native:l});function B(J){function Z(){x.state.handleSelection(J,u)}x.state.submitOnItemClick?(er.flushSync(Z),x.state.requestSubmit()):Z()}const I={id:K,role:C?"gridcell":"option","aria-disabled":a||void 0,"aria-selected":T?$:void 0,tabIndex:void 0,onPointerDownCapture(J){p.current=!0,J.preventDefault()},onClick(J){a||v||B(J.nativeEvent)},onMouseUp(J){const Z=p.current;p.current=!1,!(a||v||J.button!==0||Z||!D)&&B(J.nativeEvent)}},W=ct("div",t,{ref:[P,n,g.ref,j],state:V,props:[G,I,d,U]}),Y=k.useMemo(()=>({selected:$,textRef:f}),[$,f]);return S.jsx(MR.Provider,{value:Y,children:W})})),XP=k.forwardRef(function(t,n){const{render:s,className:o,children:u,...h}=t,{filteredItems:a}=Pa(),l=Ei(),d=a.length===0?u:null;return ct("div",t,{ref:[n,l.state.emptyRef],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},h]})});let vC=(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 PR(e){return k.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[vC.checked]:""}:{[vC.unchecked]:""}},...Ma}),[e.indeterminate])}const IR=k.createContext(void 0);function QP(){const e=k.useContext(IR);if(e===void 0)throw new Error(Pt(14));return e}const ZP="data-parent",JP=k.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:x=!1,render:C,required:w=!1,uncheckedValue:_,value:y,nativeButton:v=!1,...b}=t,{clearErrors:E}=rd(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:D,setTouched:H,state:z,validationMode:q,validityData:j,shouldValidateOnChange:K,validation:$}=as(),V=w8(),{labelId:G,controlId:U,setControlId:P,getDescriptionProps:B}=Co(),I=R8(),W=I?.parent,Y=W&&I.allValues,J=T||V.disabled||I?.disabled||h,Z=A??p,ee=y??Z,X=vr(),F=vr();let se=U;Y?se=g?F:`${W.id}-${ee}`:a&&(se=a);let ne={};Y&&(g?ne=I.parent.getParentProps():ee&&(ne=I.parent.getChildProps(ee)));const re=De(f),{checked:oe=s,indeterminate:le=l,onCheckedChange:_e,...ve}=ne,he=I?.value,ue=I?.setValue,Ie=I?.defaultValue,Me=k.useRef(null),{getButtonProps:Ae,buttonRef:be}=yr({disabled:J,native:v}),Oe=I?.validation??$,[me,de]=ss({controlled:ee&&he&&!g?he.includes(ee):oe,default:ee&&Ie&&!g?Ie.includes(ee):u,name:"Checkbox",state:"checked"});He(()=>{if(P!==sn)return P(se),()=>{P(void 0)}},[se,I,P,g]),sd({enabled:!I,id:X,commit:Oe.commit,value:me,controlRef:Me,name:Z,getValue:()=>me});const xe=k.useRef(null),We=os(d,xe,Oe.inputRef);He(()=>{xe.current&&(xe.current.indeterminate=le,me&&L(!0))},[me,le,L]),aa(me,()=>{I&&!g||(E(Z),L(me),M(me!==j.initialValue),K()?Oe.commit(me):Oe.commit(me,!0))});const nt=Fs({checked:me,disabled:J,name:g?void 0:Z,id:se??void 0,required:w,ref:We,style:nc,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Be){if(Be.nativeEvent.defaultPrevented)return;const Re=Be.target.checked,et=Ue(Mn,Be.nativeEvent);if(_e?.(Re,et),re(Re,et),!et.isCanceled&&(de(Re),ee&&he&&ue&&!g)){const at=Re?[...he,ee]:he.filter(Ye=>Ye!==ee);ue(at,et)}},onFocus(){Me.current?.focus()}},y!==void 0?{value:(I?me&&y:y)||""}:tn,B,I?Oe.getValidationProps:Oe.getInputValidationProps),Ve=Y?!!oe:me,rt=Y&&le||l;k.useEffect(()=>{W&&ee&&W.disabledStatesRef.current.set(ee,J)},[W,J,ee]);const Je=k.useMemo(()=>({...z,checked:Ve,disabled:J,readOnly:x,required:w,indeterminate:rt}),[z,Ve,J,x,w,rt]),dt=PR(Je),Ce=ct("span",t,{state:Je,ref:[be,Me,n,I?.registerControlRef],props:[{id:X,role:"checkbox","aria-checked":le?"mixed":me,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":G,[ZP]:g?"":void 0,onFocus(){D(!0)},onBlur(){const Be=xe.current;Be&&(H(!0),D(!1),q==="onBlur"&&Oe.commit(I?he:Be.checked))},onClick(Be){x||J||(Be.preventDefault(),xe.current?.click())}},B,Oe.getValidationProps,b,ve,Ae],stateAttributesMapping:dt});return S.jsxs(IR.Provider,{value:Je,children:[Ce,!me&&!I&&Z&&!g&&_!==void 0&&S.jsx("input",{type:"hidden",name:Z,value:_}),S.jsx("input",{...nt})]})}),e9=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=QP(),l=a.checked||a.indeterminate,{transitionStatus:d,setMounted:p}=wi(l),f=k.useRef(null),g=k.useMemo(()=>({...a,transitionStatus:d}),[a,d]);Vr({open:l,ref:f,onComplete(){l||p(!1)}});const x=PR(a),C=k.useMemo(()=>({...x,...Ws,...Ma}),[x]),w=u||l,_=ct("span",t,{enabled:w,ref:[n,f],state:g,stateAttributesMapping:C,props:h});return w?_:null});function t9(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return S.jsx(LP,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const n9=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=DR();return s||o?S.jsx(r9,{...t,ref:n}):null}),r9=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=DR(),a=k.useRef(null),{transitionStatus:l,setMounted:d}=wi(h),p=k.useMemo(()=>({selected:h,transitionStatus:l}),[h,l]),f=ct("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Ws});return Vr({open:h,ref:a,onComplete(){h||d(!1)}}),f})),s9=k.createContext(void 0);function Rp(e=!0){const t=k.useContext(s9);if(t===void 0&&!e)throw new Error(Pt(25));return t}const jR=k.createContext(void 0);function NR(e){const t=k.useContext(jR);if(t===void 0&&!e)throw new Error(Pt(33));return t}const BR=k.createContext(void 0);function Ia(e){const t=k.useContext(BR);if(t===void 0&&!e)throw new Error(Pt(36));return t}const i9={type:"regular-item"};function o9(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:o,store:u,nativeButton:h,itemMetadata:a,nodeId:l}=e,d=k.useRef(null),p=Rp(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:x,buttonRef:C}=yr({disabled:n,focusableWhenDisabled:!0,native:h}),w=k.useCallback(y=>Fs({id:o,role:"menuitem",tabIndex:s?0:-1,onMouseMove(v){l&&g.emit("itemhover",{nodeId:l,target:v.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(v){v.key===" "&&u.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&g.emit("close",{domEvent:v,reason:ha})},onMouseUp(v){if(p){const b=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&b&&Math.abs(v.clientX-b.x)<=1&&Math.abs(v.clientY-b.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&d.current.click()}},y,x),[o,s,x,t,g,u,f,p,a,l]),_=os(d,C);return k.useMemo(()=>({getItemProps:w,itemRef:_}),[w,_])}let _C=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const zR={checked(e){return e?{[_C.checked]:""}:{[_C.unchecked]:""}},...Ws},a9={...bo,...Ws},l9=k.forwardRef(function(t,n){const{render:s,className:o,finalFocus:u,...h}=t,{store:a}=Ia(),{side:l,align:d}=NR(),p=R0()!=null,f=a.useState("open"),g=a.useState("transitionStatus"),x=a.useState("popupProps"),C=a.useState("mounted"),w=a.useState("instantType"),_=a.useState("activeTriggerElement"),y=a.useState("parent"),v=a.useState("lastOpenChangeReason"),b=a.useState("rootId"),E=a.useState("floatingRootContext"),T=a.useState("floatingTreeRoot"),A=a.useState("closeDelay"),M=a.useState("activeTriggerElement");Vr({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),k.useEffect(()=>{function j(K){a.setOpen(!1,Ue(K.reason,K.domEvent))}return T.events.on("close",j),()=>{T.events.off("close",j)}},[T.events,a]);const L=a.useState("hoverEnabled"),D=a.useState("disabled");N6(E,{enabled:L&&!D&&y.type!=="context-menu"&&y.type!=="menubar",closeDelay:A});const H=k.useMemo(()=>({transitionStatus:g,side:l,align:d,open:f,nested:y.type==="menu",instant:w}),[g,l,d,f,y.type,w]),z=ct("div",t,{state:H,ref:[n,a.context.popupRef],stateAttributesMapping:a9,props:[x,{onKeyDown(j){p&&x0.has(j.key)&&j.stopPropagation()}},k0(g),h,{"data-rootownerid":b}]});let q=y.type===void 0||y.type==="context-menu";return(_||y.type==="menubar"&&v!==s0)&&(q=!0),S.jsx(fp,{context:E,modal:!1,disabled:!C,returnFocus:u===void 0?q:u,initialFocus:y.type!=="menu",restoreFocus:!0,externalTree:y.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:y.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:z})}),HR=k.createContext(void 0);function c9(){const e=k.useContext(HR);if(e===void 0)throw new Error(Pt(32));return e}const u9=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Ia();return u.useState("mounted")||s?S.jsx(HR.Provider,{value:s,children:S.jsx(dp,{ref:n,...o})}):null}),d9=k.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:x=5,sticky:C=!1,disableAnchorTracking:w=!1,collisionAvoidance:_=X_,...y}=t,{store:v}=Ia(),b=c9(),E=Rp(!0),T=v.useState("parent"),A=v.useState("floatingRootContext"),M=v.useState("floatingTreeRoot"),L=v.useState("mounted"),D=v.useState("open"),H=v.useState("modal"),z=v.useState("activeTriggerElement"),q=v.useState("lastOpenChangeReason"),j=v.useState("floatingNodeId"),K=v.useState("floatingParentNodeId");let $=s,V=d,G=p,U=l,P=_;T.type==="context-menu"&&($=s??T.context?.anchor,U=U??"start",!a&&U!=="center"&&(G=t.alignOffset??2,V=t.sideOffset??-5));let B=a,I=U;T.type==="menu"?(B=B??"inline-end",I=I??"start",P=t.collisionAvoidance??$O):T.type==="menubar"&&(B=B??"bottom",I=I??"start");const W=T.type==="context-menu",Y=w0({anchor:$,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:B,sideOffset:V,align:I,alignOffset:G,arrowPadding:W?0:x,collisionBoundary:f,collisionPadding:g,sticky:C,nodeId:j,keepMounted:b,disableAnchorTracking:w,collisionAvoidance:P,shiftCrossAxis:W,externalTree:M}),J=k.useMemo(()=>{const ne={};return D||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Y.positionerStyles,...ne}}},[D,L,Y.positionerStyles]);k.useEffect(()=>{function ne(re){re.open?(re.parentNodeId===j&&v.set("hoverEnabled",!1),re.nodeId!==j&&re.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,Ue(Cu))):re.parentNodeId===j&&re.reason!==Cu&&v.set("hoverEnabled",!0)}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[v,M.events,j]),k.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function ne(re){if(re.open||re.nodeId!==v.select("floatingParentNodeId"))return;const oe=re.reason??Cu;v.setOpen(!1,Ue(oe))}return M.events.on("menuopenchange",ne),()=>{M.events.off("menuopenchange",ne)}},[M.events,v]),k.useEffect(()=>{function ne(re){!D||re.nodeId!==v.select("floatingParentNodeId")||re.target&&z&&z!==re.target&&v.setOpen(!1,Ue(Cu))}return M.events.on("itemhover",ne),()=>{M.events.off("itemhover",ne)}},[M.events,D,z,v]),k.useEffect(()=>{const ne={open:D,nodeId:j,parentNodeId:K,reason:v.select("lastOpenChangeReason")};M.events.emit("menuopenchange",ne)},[M.events,D,v,j,K]);const Z=k.useMemo(()=>({open:D,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,nested:T.type==="menu"}),[D,Y.side,Y.align,Y.anchorHidden,T.type]),ee=k.useMemo(()=>({side:Y.side,align:Y.align,arrowRef:Y.arrowRef,arrowUncentered:Y.arrowUncentered,arrowStyles:Y.arrowStyles,nodeId:Y.context.nodeId}),[Y.side,Y.align,Y.arrowRef,Y.arrowUncentered,Y.arrowStyles,Y.context.nodeId]),X=ct("div",t,{state:Z,stateAttributesMapping:bo,ref:[n,v.useStateSetter("positionerElement")],props:[J,y]}),F=L&&T.type!=="menu"&&(T.type!=="menubar"&&H&&q!==jr||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=z),S.jsxs(jR.Provider,{value:ee,children:[F&&S.jsx(_p,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:vp(!D),cutout:se}),S.jsx(lD,{id:j,children:S.jsx(od,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),VR=k.createContext(void 0);function f9(){const e=k.useContext(VR);if(e===void 0)throw new Error(Pt(34));return e}const h9=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u,defaultValue:h,onValueChange:a,disabled:l=!1,...d}=t,[p,f]=ss({controlled:u,default:h,name:"MenuRadioGroup"}),g=De(a),x=De((y,v)=>{g?.(y,v),!v.isCanceled&&f(y)}),C=k.useMemo(()=>({disabled:l}),[l]),w=ct("div",t,{state:C,ref:n,props:{role:"group","aria-disabled":l||void 0,...d}}),_=k.useMemo(()=>({value:p,setValue:x,disabled:l}),[p,x,l]);return S.jsx(VR.Provider,{value:_,children:w})})),FR=k.createContext(void 0);function p9(){const e=k.useContext(FR);if(e===void 0)throw new Error(Pt(35));return e}const m9=k.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=ad({label:h}),x=NR(!0),C=vr(u),{store:w}=Ia(),_=w.useState("isActive",g.index),y=w.useState("itemProps"),{value:v,setValue:b,disabled:E}=f9(),T=E||l,A=v===p,{getItemProps:M,itemRef:L}=o9({closeOnClick:d,disabled:T,highlighted:_,id:C,store:w,nativeButton:a,nodeId:x?.nodeId,itemMetadata:i9}),D=k.useMemo(()=>({disabled:T,highlighted:_,checked:A}),[T,_,A]),H=De(q=>{const j={...Ue(ha,q.nativeEvent),preventUnmountOnClose:()=>{}};b(p,j)}),z=ct("div",t,{state:D,stateAttributesMapping:zR,props:[y,{role:"menuitemradio","aria-checked":A,onClick:H},f,M],ref:[L,n,g.ref]});return S.jsx(FR.Provider,{value:D,children:z})}),g9=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=p9(),l=k.useRef(null),{transitionStatus:d,setMounted:p}=wi(a.checked);Vr({open:a.checked,ref:l,onComplete(){a.checked||p(!1)}});const f=k.useMemo(()=>({checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:d}),[a.checked,a.disabled,a.highlighted,d]);return ct("span",t,{state:f,stateAttributesMapping:zR,ref:[n,l],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),v9=k.createContext(null);function UR(e){return k.useContext(v9)}const _9={...WE,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 P0 extends g0{constructor(t){super({...y9(),...t},{positionerRef:k.createRef(),popupRef:k.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:k.createRef(),beforeContentFocusGuardRef:k.createRef(),onOpenChangeComplete:void 0,triggerElements:new mp},_9),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 P0(n)).current}unsubscribeParentListener=null}function y9(){return{...UE(),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 h0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tn,keyboardEventRelay:void 0,closeDelay:0}}const b9=k.createContext(void 0);function x9(){return k.useContext(b9)}function S9(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:x,defaultTriggerId:C=null,highlightItemOnHover:w=!0}=e,_=Rp(!0),y=Ia(!0),v=UR(),b=x9(),E=k.useMemo(()=>b&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:_&&!y?{type:"context-menu",context:_}:{type:void 0},[_,y,v,b]),T=P0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=RE(A),L=Ci();He(()=>{_&&!y?T.update({parent:{type:"context-menu",context:_},floatingNodeId:M,floatingParentNodeId:L}):y&&T.update({floatingNodeId:M,floatingParentNodeId:L})},[_,y,M,L,T]),T.useControlledProp("open",n,u),T.useControlledProp("activeTriggerId",x,C),T.useContextCallback("onOpenChangeComplete",o);const D=T.useState("open"),H=T.useState("activeTriggerElement"),z=T.useState("positionerElement"),q=T.useState("hoverEnabled"),j=T.useState("modal"),K=T.useState("disabled"),$=T.useState("lastOpenChangeReason"),V=T.useState("parent"),G=T.useState("activeIndex"),U=T.useState("payload"),P=T.useState("floatingParentNodeId"),B=k.useRef(null),I=P!=null;let W;T.useSyncedValues({disabled:h,modal:V.type===void 0?a:void 0,rootId:Aa()});const{openMethod:Y,triggerProps:J,reset:Z}=bp(D);VE(T);const{forceUnmount:ee}=FE(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0}),Z()}),X=k.useRef(V.type!=="context-menu"),F=Qt();k.useEffect(()=>{if(D||(B.current=null),V.type==="context-menu"){if(!D){F.clear(),X.current=!1;return}F.start(500,()=>{X.current=!0})}},[F,D,V.type]),yp(D&&j&&$!==jr&&Y!=="touch",z),He(()=>{!D&&!q&&T.set("hoverEnabled",!0)},[D,q,T]);const se=k.useRef(!0),ne=Qt(),re=De((Re,et)=>{const at=et.reason;if(D===Re&&et.trigger===H||(et.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!Re&&et.trigger==null&&(et.trigger=H??void 0),s?.(Re,et),et.isCanceled))return;const Ye={open:Re,nativeEvent:et.event,reason:et.reason,nested:I};W?.emit("openchange",Ye);const st=et.event;if(Re===!1&&st?.type==="click"&&st.pointerType==="touch"&&!se.current)return;if(!Re&&G!==null){const kt=T.context.itemDomElements.current[G];queueMicrotask(()=>{kt?.setAttribute("tabindex","-1")})}Re&&at===Ah?(se.current=!1,ne.start(300,()=>{se.current=!0})):(se.current=!0,ne.clear());const Ct=(at===fa||at===ha)&&st.detail===0&&st?.isTrusted,lt=!Re&&(at===cp||at==null);function nn(){const kt={open:Re,openChangeReason:at};B.current=et.event??null;const vt=et.trigger?.id??null;(vt||Re)&&(kt.activeTriggerId=vt,kt.activeTriggerElement=et.trigger??null),T.update(kt)}at===jr?er.flushSync(nn):nn(),V.type==="menubar"&&(at===Ah||at===Ca||at===jr||at===Lu||at===Cu)?T.set("instantType","group"):Ct||lt?T.set("instantType",Ct?"click":"dismiss"):T.set("instantType",void 0)}),oe=k.useCallback(Re=>{const et=Ue(Re);return et.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},et},[T]),le=k.useCallback(()=>{T.setOpen(!1,oe(X2))},[T,oe]);k.useImperativeHandle(p,()=>({unmount:ee,close:le}),[ee,le]);let _e;V.type==="context-menu"&&(_e=V.context),k.useImperativeHandle(_e?.positionerRef,()=>z,[z]),k.useImperativeHandle(_e?.actionsRef,()=>({setOpen:re}),[re]);const ve=qE({popupStore:T,onOpenChange:re});W=ve.context.events,k.useEffect(()=>{const Re=({open:et,eventDetails:at})=>re(et,at);return W.on("setOpen",Re),()=>{W?.off("setOpen",Re)}},[W,re]);const he=pp(ve,{enabled:!K,bubbles:f&&V.type==="menu",outsidePress(){return V.type!=="context-menu"||B.current?.type==="contextmenu"?!0:X.current},externalTree:I?A:void 0}),ue=$E(ve,{role:"menu"}),Ie=Da(),Me=k.useCallback(Re=>{T.select("activeIndex")!==Re&&T.set("activeIndex",Re)},[T]),Ae=y0(ve,{enabled:!K,listRef:T.context.itemDomElements,activeIndex:G,nested:V.type!==void 0,loopFocus:l,orientation:d,parentOrientation:V.type==="menubar"?V.context.orientation:void 0,rtl:Ie==="rtl",disabledIndices:gr,onNavigate:Me,openOnArrowKeyDown:V.type!=="context-menu",externalTree:I?A:void 0,focusItemOnHover:w}),be=k.useCallback(Re=>{T.context.typingRef.current=Re},[T]),Oe=b0(ve,{listRef:T.context.itemLabels,activeIndex:G,resetMs:WO,onMatch:Re=>{D&&Re!==G&&T.set("activeIndex",Re)},onTypingChange:be}),{getReferenceProps:me,getFloatingProps:de,getItemProps:xe,getTriggerProps:We}=rc([he,ue,Ae,Oe]),nt=k.useMemo(()=>{const Re=Fs(me(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},J);return delete Re.role,Re},[me,T,J]),Ve=k.useMemo(()=>{const Re=We();if(!Re)return Re;const et=Fs(Re,J);return delete et.role,delete et["aria-controls"],et},[We,J]),rt=Ju(),Je=k.useMemo(()=>de({onMouseEnter(){V.type==="menu"&&rt.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(Re){const et=T.select("keyboardEventRelay");et&&!Re.isPropagationStopped()&&et(Re)}}),[de,V.type,rt,T]),dt=k.useMemo(()=>xe(),[xe]);T.useSyncedValues({floatingRootContext:ve,activeTriggerProps:nt,inactiveTriggerProps:Ve,popupProps:Je,itemProps:dt});const Ce=k.useMemo(()=>({store:T,parent:E}),[T,E]),Be=S.jsx(BR.Provider,{value:Ce,children:typeof t=="function"?t({payload:U}):t});return V.type===void 0||V.type==="context-menu"?S.jsx(cD,{externalTree:A,children:Be}):Be}function WR(e){const{render:t,className:n,state:s=tn,props:o=gr,refs:u=gr,metadata:h,stateAttributesMapping:a,tag:l="div",...d}=e,{compositeProps:p,compositeRef:f}=xR({metadata:h});return ct(l,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function qR(e){if(en(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Bs(e))return qR(Vs(e))}function C9(e){const{enabled:t=!0,mouseDownAction:n,open:s}=e,o=k.useRef(!1);return k.useMemo(()=>t?{onMouseDown:u=>{(n==="open"&&!s||n==="close"&&s)&&(o.current=!0,_r(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:tn,[t,n,s])}const Xf=2,w9=k.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,...x}=t,C=Ia(!0),w=f?.store??C?.store;if(!w)throw new Error(Pt(85));const _=vr(a),y=w.useState("isTriggerActive",_),v=w.useState("floatingRootContext"),b=w.useState("isOpenedByTrigger",_),E=k.useRef(null),T=R9(),A=K_(!0),M=So(),L=k.useMemo(()=>M??new h0,[M]),D=RE(L),H=Ci(),{registerTrigger:z,isMountedByThisTrigger:q}=HE(_,E,w,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:D,floatingParentNodeId:H,keyboardEventRelay:A?.relayKeyboardEvent}),j=w.useState("disabled"),K=u||j||T.type==="menubar"&&T.context.disabled,{getButtonProps:$,buttonRef:V}=yr({disabled:K,native:h});k.useEffect(()=>{!b&&T.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,b,T.type]);const G=k.useRef(null),U=Qt(),P=De(ue=>{if(!G.current)return;U.clear(),w.context.allowMouseUpTriggerRef.current=!1;const Ie=ue.target;if(ft(G.current,Ie)||ft(w.select("positionerElement"),Ie)||Ie===G.current||Ie!=null&&qR(Ie)===w.select("rootId"))return;const Me=C0(G.current);ue.clientX>=Me.left-Xf&&ue.clientX<=Me.right+Xf&&ue.clientY>=Me.top-Xf&&ue.clientY<=Me.bottom+Xf||L.events.emit("close",{domEvent:ue,reason:Y2})});k.useEffect(()=>{b&&w.select("lastOpenChangeReason")===jr&&_r(G.current).addEventListener("mouseup",P,{once:!0})},[b,P,w]);const B=T.type==="menubar"&&T.context.hasSubmenuOpen,W=H6(v,{enabled:(l??B??!1)&&!K&&T.type!=="context-menu"&&(T.type!=="menubar"||B&&!q),handleClose:G6({blockPointerEvents:T.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:L,isActiveTrigger:y}),Y=E9(b,w.select("lastOpenChangeReason")),J=ed(v,{enabled:!K&&T.type!=="context-menu",event:b&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?Y:!1}),Z=D6(v,{enabled:!K&&(T.type!=="menubar"&&b||B)}),ee=C9({open:b,enabled:T.type==="menubar",mouseDownAction:"open"}),X=rc([J,Z]),F=T.type==="menubar",se=k.useMemo(()=>({disabled:K,open:b}),[K,b]),ne=w.useState("triggerProps",q),re=[G,n,V,z,E],oe=[X.getReferenceProps(),W??tn,ne,{"aria-haspopup":"menu",id:_,onMouseDown:ue=>{if(w.select("open"))return;U.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),_r(ue.currentTarget).addEventListener("mouseup",P,{once:!0})}},F?{role:"menuitem"}:{},ee,x,$],le=k.useRef(null),_e=De(ue=>{er.flushSync(()=>{w.setOpen(!1,Ue(Ca,ue.nativeEvent,ue.currentTarget))}),oD(le.current)?.focus()}),ve=De(ue=>{const Ie=w.select("positionerElement");if(Ie&&Tl(ue,Ie))w.context.beforeContentFocusGuardRef.current?.focus();else{er.flushSync(()=>{w.setOpen(!1,Ue(Ca,ue.nativeEvent,ue.currentTarget))});let Me=iD(E.current);for(;Me!==null&&ft(Ie,Me)||Me?.hasAttribute("aria-hidden");){const Ae=Me;if(Me=f0(Me),Me===Ae)break}Me?.focus()}}),he=ct("button",t,{enabled:!F,stateAttributesMapping:Iu,state:se,ref:re,props:oe});return F?S.jsx(WR,{tag:"button",render:s,className:o,state:se,refs:re,props:oe,stateAttributesMapping:Iu}):b?S.jsxs(k.Fragment,{children:[S.jsx(ql,{ref:le,onFocus:_e},`${_}-pre-focus-guard`),S.jsx(k.Fragment,{children:he},_),S.jsx(ql,{ref:w.context.triggerFocusTargetRef,onFocus:ve},`${_}-post-focus-guard`)]}):S.jsx(k.Fragment,{children:he},_)});function E9(e,t){const n=Qt(),[s,o]=k.useState(!1);return He(()=>{e&&t==="trigger-hover"?(o(!0),n.start(qO,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function R9(){const e=Rp(!0),t=Ia(!0),n=UR();return k.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function vi(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const GR=k.createContext(void 0);function kp(){const e=k.useContext(GR);if(e===void 0)throw new Error(Pt(53));return e}let Vh=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Qf=500,yC=16;function ns(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 k9=(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})({}),Sl=(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 I0={hasOverflowX:e=>e?{[Sl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[Sl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[Sl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[Sl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[Sl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[Sl.overflowYEnd]:""}:null,cornerHidden:()=>null},bC={width:0,height:0},T9={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},L9=k.forwardRef(function(t,n){const{render:s,className:o,overflowEdgeThreshold:u,...h}=t,[a,l]=k.useState(!1),[d,p]=k.useState(!1),[f,g]=k.useState(!1),[x,C]=k.useState(bC),[w,_]=k.useState(bC),[y,v]=k.useState(!1),[b,E]=k.useState(T9),T=vr(),A=k.useRef(null),M=k.useRef(null),L=k.useRef(null),D=k.useRef(null),H=k.useRef(null),z=k.useRef(null),q=k.useRef(null),j=k.useRef(!1),K=k.useRef(0),$=k.useRef(0),V=k.useRef(0),G=k.useRef(0),U=k.useRef("vertical"),P=Qt(),B=Qt(),I=k.useRef({x:0,y:0}),[W,Y]=k.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),J=A9(u),Z=De(_e=>{const ve=_e.x-I.current.x,he=_e.y-I.current.y;I.current=_e,he!==0&&(g(!0),P.start(Qf,()=>{g(!1)})),ve!==0&&(p(!0),B.start(Qf,()=>{p(!1)}))}),ee=De(_e=>{_e.button===0&&(j.current=!0,K.current=_e.clientY,$.current=_e.clientX,U.current=_e.currentTarget.getAttribute(k9.orientation),M.current&&(V.current=M.current.scrollTop,G.current=M.current.scrollLeft),H.current&&U.current==="vertical"&&H.current.setPointerCapture(_e.pointerId),z.current&&U.current==="horizontal"&&z.current.setPointerCapture(_e.pointerId))}),X=De(_e=>{if(!j.current)return;const ve=_e.clientY-K.current,he=_e.clientX-$.current;if(M.current){const ue=M.current.scrollHeight,Ie=M.current.clientHeight,Me=M.current.scrollWidth,Ae=M.current.clientWidth;if(H.current&&L.current&&U.current==="vertical"){const be=ns(L.current,"padding","y"),Oe=ns(H.current,"margin","y"),me=H.current.offsetHeight,de=L.current.offsetHeight-me-be-Oe,xe=ve/de;M.current.scrollTop=V.current+xe*(ue-Ie),_e.preventDefault(),g(!0),P.start(Qf,()=>{g(!1)})}if(z.current&&D.current&&U.current==="horizontal"){const be=ns(D.current,"padding","x"),Oe=ns(z.current,"margin","x"),me=z.current.offsetWidth,de=D.current.offsetWidth-me-be-Oe,xe=he/de;M.current.scrollLeft=G.current+xe*(Me-Ae),_e.preventDefault(),p(!0),B.start(Qf,()=>{p(!1)})}}}),F=De(_e=>{j.current=!1,H.current&&U.current==="vertical"&&H.current.releasePointerCapture(_e.pointerId),z.current&&U.current==="horizontal"&&z.current.releasePointerCapture(_e.pointerId)});function se(_e){const ve=_e.pointerType==="touch";if(v(ve),!ve){const he=ft(A.current,_e.target);l(he)}}const ne=k.useMemo(()=>({hasOverflowX:!W.scrollbarXHidden,hasOverflowY:!W.scrollbarYHidden,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:W.cornerHidden}),[W.scrollbarXHidden,W.scrollbarYHidden,W.cornerHidden,b]),re={role:"presentation",onPointerEnter:se,onPointerMove:se,onPointerDown({pointerType:_e}){v(_e==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[Vh.scrollAreaCornerHeight]:`${x.height}px`,[Vh.scrollAreaCornerWidth]:`${x.width}px`}},oe=ct("div",t,{state:ne,ref:[n,A],props:[re,h],stateAttributesMapping:I0}),le=k.useMemo(()=>({handlePointerDown:ee,handlePointerMove:X,handlePointerUp:F,handleScroll:Z,cornerSize:x,setCornerSize:C,thumbSize:w,setThumbSize:_,touchModality:y,cornerRef:q,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:l,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:D,thumbYRef:H,thumbXRef:z,rootId:T,hiddenState:W,setHiddenState:Y,overflowEdges:b,setOverflowEdges:E,viewportState:ne,overflowEdgeThreshold:J}),[ee,X,F,Z,x,w,y,q,d,p,f,g,a,l,M,A,L,D,H,z,T,W,b,ne,J]);return S.jsxs(GR.Provider,{value:le,children:[Hu.element,oe]})});function A9(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 O9=k.createContext(void 0);function M9(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 io=(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})({}),xC=!1;function D9(){xC||o0||(typeof CSS<"u"&&"registerProperty"in CSS&&[io.scrollAreaOverflowXStart,io.scrollAreaOverflowXEnd,io.scrollAreaOverflowYStart,io.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),xC=!0)}const P9=k.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:x,rootId:C,setHiddenState:w,hiddenState:_,handleScroll:y,setHovering:v,setOverflowEdges:b,overflowEdges:E,overflowEdgeThreshold:T}=kp(),A=Da(),M=k.useRef(!0),L=Qt(),D=Qt();function H(){const G=h.current,U=a.current,P=l.current,B=d.current,I=p.current,W=f.current;if(!G)return;const Y=G.scrollHeight,J=G.scrollWidth,Z=G.clientHeight,ee=G.clientWidth,X=G.scrollTop,F=G.scrollLeft;if(Y===0||J===0)return;const se=Z>=Y,ne=ee>=J,re=ee/J,oe=Z/Y,le=Math.max(0,J-ee),_e=Math.max(0,Y-Z);let ve=0,he=0;ne||(A==="rtl"?ve=vi(-F,0,le):ve=vi(F,0,le),he=le-ve);const ue=se?0:vi(X,0,_e),Ie=se?0:_e-ue,Me=ne?0:ee,Ae=se?0:Z,be=ns(P,"padding","x"),Oe=ns(U,"padding","y"),me=ns(I,"margin","x"),de=ns(B,"margin","y"),xe=Me-be-me,We=Ae-Oe-de,nt=P?Math.min(P.offsetWidth,xe):xe,Ve=U?Math.min(U.offsetHeight,We):We,rt=Math.max(yC,nt*re),Je=Math.max(yC,Ve*oe);if(x(Ye=>Ye.height===Je&&Ye.width===rt?Ye:{width:rt,height:Je}),U&&B){const Ye=U.offsetHeight-Je-Oe-de,st=Y-Z,Ct=st===0?0:X/st,lt=Math.min(Ye,Math.max(0,Ct*Ye));B.style.transform=`translate3d(0,${lt}px,0)`}if(P&&I){const Ye=P.offsetWidth-rt-be-me,st=J-ee,Ct=st===0?0:F/st,lt=A==="rtl"?vi(Ct*Ye,-Ye,0):vi(Ct*Ye,0,Ye);I.style.transform=`translate3d(${lt}px,0,0)`}const dt=vi(ve,0,le),Ce=vi(he,0,le),Be=vi(ue,0,_e),Re=vi(Ie,0,_e),et=[[io.scrollAreaOverflowXStart,dt],[io.scrollAreaOverflowXEnd,Ce],[io.scrollAreaOverflowYStart,Be],[io.scrollAreaOverflowYEnd,Re]];for(const[Ye,st]of et)G.style.setProperty(Ye,`${st}px`);if(W){if(ne||se)g({width:0,height:0});else if(!ne&&!se){const Ye=U?.offsetWidth||0,st=P?.offsetHeight||0;g({width:Ye,height:st})}}w(Ye=>{const st=se||ne;return Ye.scrollbarYHidden===se&&Ye.scrollbarXHidden===ne&&Ye.cornerHidden===st?Ye:{scrollbarYHidden:se,scrollbarXHidden:ne,cornerHidden:st}});const at={xStart:!ne&&dt>T.xStart,xEnd:!ne&&Ce>T.xEnd,yStart:!se&&Be>T.yStart,yEnd:!se&&Re>T.yEnd};b(Ye=>Ye.xStart===at.xStart&&Ye.xEnd===at.xEnd&&Ye.yStart===at.yStart&&Ye.yEnd===at.yEnd?Ye:at)}const z=De(()=>{er.flushSync(H)});He(()=>h.current?(D9(),M9(h.current,z)):void 0,[z,h]),He(()=>{queueMicrotask(z)},[z,_,A]),He(()=>{h.current?.matches(":hover")&&v(!0)},[h,v]),k.useEffect(()=>{const G=h.current;if(typeof ResizeObserver>"u"||!G)return;const U=new ResizeObserver(z);return U.observe(G),D.start(0,()=>{Promise.all(G.getAnimations({subtree:!0}).map(P=>P.finished)).then(z).catch(()=>{})}),()=>{U.disconnect(),D.clear()}},[z,h,D]);function q(){M.current=!1}const j={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!_.scrollbarXHidden||!_.scrollbarYHidden)&&{tabIndex:0},className:Hu.className,style:{overflow:"scroll"},onScroll(){h.current&&(z(),M.current||y({x:h.current.scrollLeft,y:h.current.scrollTop}),L.start(100,()=>{M.current=!0}))},onWheel:q,onTouchMove:q,onPointerMove:q,onPointerEnter:q,onKeyDown:q},K=k.useMemo(()=>({hasOverflowX:!_.scrollbarXHidden,hasOverflowY:!_.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:_.cornerHidden}),[_.scrollbarXHidden,_.scrollbarYHidden,_.cornerHidden,E]),$=ct("div",t,{ref:[n,h],state:K,props:[j,u],stateAttributesMapping:I0}),V=k.useMemo(()=>({computeThumbPosition:z}),[z]);return S.jsx(O9.Provider,{value:V,children:$})}),$R=k.createContext(void 0);function I9(){const e=k.useContext($R);if(e===void 0)throw new Error(Pt(54));return e}let Fh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const j9=k.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:x,scrollbarXRef:C,viewportRef:w,thumbYRef:_,thumbXRef:y,handlePointerDown:v,handlePointerUp:b,rootId:E,thumbSize:T}=kp(),A=k.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=Da();k.useEffect(()=>{const j=w.current,K=u==="vertical"?x.current:C.current;if(!K)return;function $(V){if(!(!j||!K||V.ctrlKey)){if(V.preventDefault(),u==="vertical"){if(j.scrollTop===0&&V.deltaY<0)return}else if(j.scrollLeft===0&&V.deltaX<0)return;if(u==="vertical"){if(j.scrollTop===j.scrollHeight-j.clientHeight&&V.deltaY>0)return}else if(j.scrollLeft===j.scrollWidth-j.clientWidth&&V.deltaX>0)return;u==="vertical"?j.scrollTop+=V.deltaY:j.scrollLeft+=V.deltaX}}return K.addEventListener("wheel",$,{passive:!1}),()=>{K.removeEventListener("wheel",$)}},[u,C,x,w]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(j){if(j.button===0&&j.currentTarget===j.target&&w.current){if(_.current&&x.current&&u==="vertical"){const K=ns(_.current,"margin","y"),$=ns(x.current,"padding","y"),V=_.current.offsetHeight,G=x.current.getBoundingClientRect(),U=j.clientY-G.top-V/2-$+K/2,P=w.current.scrollHeight,B=w.current.clientHeight,I=x.current.offsetHeight-V-$-K,Y=U/I*(P-B);w.current.scrollTop=Y}if(y.current&&C.current&&u==="horizontal"){const K=ns(y.current,"margin","x"),$=ns(C.current,"padding","x"),V=y.current.offsetWidth,G=C.current.getBoundingClientRect(),U=j.clientX-G.left-V/2-$+K/2,P=w.current.scrollWidth,B=w.current.clientWidth,I=C.current.offsetWidth-V-$-K,W=U/I;let Y;M==="rtl"?(Y=(1-W)*(P-B),w.current.scrollLeft<=0&&(Y=-Y)):Y=W*(P-B),w.current.scrollLeft=Y}v(j)}},onPointerUp:b,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...u==="vertical"&&{top:0,bottom:`var(${Vh.scrollAreaCornerHeight})`,insetInlineEnd:0,[Fh.scrollAreaThumbHeight]:`${T.height}px`},...u==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Vh.scrollAreaCornerWidth})`,bottom:0,[Fh.scrollAreaThumbWidth]:`${T.width}px`}}},D=ct("div",t,{ref:[n,u==="vertical"?x:C],state:A,props:[L,a],stateAttributesMapping:I0}),H=k.useMemo(()=>({orientation:u}),[u]),z=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!z?S.jsx($R.Provider,{value:H,children:D}):null}),N9=k.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}=kp(),{orientation:x}=I9(),C=k.useMemo(()=>({orientation:x}),[x]);return ct("div",t,{ref:[n,x==="vertical"?h:a],state:C,props:[{onPointerDown:l,onPointerMove:d,onPointerUp(_){x==="vertical"&&g(!1),x==="horizontal"&&f(!1),p(_)},style:{...x==="vertical"&&{height:`var(${Fh.scrollAreaThumbHeight})`},...x==="horizontal"&&{width:`var(${Fh.scrollAreaThumbWidth})`}}},u]})}),B9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:l}=kp(),d=ct("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}),KR=k.createContext(void 0);function z9(){const e=k.useContext(KR);if(e===void 0)throw new Error(Pt(63));return e}let SC=(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 YR={...Ma,checked(e){return e?{[SC.checked]:""}:{[SC.unchecked]:""}}},H9=k.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:x=!1,render:C,uncheckedValue:w,..._}=t,{clearErrors:y}=rd(),{state:v,setTouched:b,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:D,disabled:H,name:z,validation:q}=as(),{labelId:j}=Co(),K=H||x,$=z??l,V=De(p),G=k.useRef(null),U=os(G,a,q.inputRef),P=k.useRef(null),B=vr(),I=xp({id:h,implicit:!1,controlRef:P}),[W,Y]=ss({controlled:s,default:!!u,name:"Switch",state:"checked"});sd({id:B,commit:q.commit,value:W,controlRef:P,name:$,getValue:()=>W}),He(()=>{G.current&&A(G.current.checked)},[G,A]),aa(W,()=>{y($),E(W!==T.initialValue),A(W),L()?q.commit(W):q.commit(W,!0)});const{getButtonProps:J,buttonRef:Z}=yr({disabled:K,native:d}),ee={id:B,role:"switch","aria-checked":W,"aria-readonly":f||void 0,"aria-labelledby":j,onFocus(){K||M(!0)},onBlur(){const ne=G.current;!ne||K||(b(!0),M(!1),D==="onBlur"&&q.commit(ne.checked))},onClick(ne){f||K||(ne.preventDefault(),G?.current?.click())}},X=k.useMemo(()=>Fs({checked:W,disabled:K,id:I,name:$,required:g,style:nc,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:U,onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const re=ne.target.checked,oe=Ue(Mn,ne.nativeEvent);V?.(re,oe),!oe.isCanceled&&Y(re)},onFocus(){P.current?.focus()}},q.getInputValidationProps),[W,K,U,I,$,V,g,Y,q]),F=k.useMemo(()=>({...v,checked:W,disabled:K,readOnly:f,required:g}),[v,W,K,f,g]),se=ct("span",t,{state:F,ref:[n,P,Z],props:[ee,q.getValidationProps,_,J],stateAttributesMapping:YR});return S.jsxs(KR.Provider,{value:F,children:[se,!W&&$&&w!==void 0&&S.jsx("input",{type:"hidden",name:$,value:w}),S.jsx("input",{...X})]})}),V9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=as(),a=z9(),l={...h,...a};return ct("span",t,{state:l,ref:n,stateAttributesMapping:YR,props:u})}),XR=k.createContext(void 0);function F9(e=!0){const t=k.useContext(XR);if(t===void 0&&!e)throw new Error(Pt(7));return t}const U9=k.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,...x}=t,C=vr(f||void 0),w=F9(),_=w?.value??[],y=w?void 0:o,v=(u||w?.disabled)??!1,[b,E]=ss({controlled:w?_?.indexOf(C)>-1:l,default:y,name:"Toggle",state:"pressed"}),T=De((q,j)=>{C&&w?.setGroupValue?.(C,q,j),a?.(q,j)}),{getButtonProps:A,buttonRef:M}=yr({disabled:v,native:g}),L=k.useMemo(()=>({disabled:v,pressed:b}),[v,b]),D=[M,n],H=[{"aria-pressed":b,onClick(q){const j=!b,K=Ue(Mn,q.nativeEvent);T(j,K),!K.isCanceled&&E(j)}},x,A],z=ct("button",t,{enabled:!w,state:L,ref:D,props:H});return w?S.jsx(WR,{tag:"button",render:d,className:s,state:L,refs:D,props:H}):z});let W9=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const CC={multiple(e){return e?{[W9.multiple]:""}:null}},q9=k.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,x=R0(),C=k.useMemo(()=>{if(d===void 0)return s??[]},[d,s]),w=(x?.disabled??!1)||o,[_,y]=ss({controlled:d,default:C,name:"ToggleGroup",state:"value"}),v=De((M,L,D)=>{let H;if(l?(H=_.slice(),L?H.push(M):H.splice(_.indexOf(M),1)):H=L?[M]:[],Array.isArray(H)){if(h?.(H,D),D.isCanceled)return;y(H)}}),b=k.useMemo(()=>({disabled:w,multiple:l,orientation:a}),[w,a,l]),E=k.useMemo(()=>({disabled:w,orientation:a,setGroupValue:v,value:_}),[w,a,v,_]),T={role:"group"},A=ct("div",t,{enabled:!!x,state:b,ref:n,props:[T,g],stateAttributesMapping:CC});return S.jsx(XR.Provider,{value:E,children:x?A:S.jsx(CR,{render:f,className:p,state:b,refs:[n],props:[T,g],stateAttributesMapping:CC,loopFocus:u})})});function G9(e){return ct(e.defaultTagName??"div",e,e)}function $9({className:e,...t}){return S.jsx("div",{"data-slot":"input-group",role:"group",className:ze("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 K9=Ta("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 Y9({className:e,align:t="inline-start",...n}){return S.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:ze(K9({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const X9=Ta("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 QR({className:e,type:t="button",variant:n="ghost",size:s="xs",...o}){return S.jsx(je,{type:t,"data-size":s,variant:n,className:ze(X9({size:s}),e),...o})}function Q9({className:e,...t}){return S.jsx(Wt,{"data-slot":"input-group-control",className:ze("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 Z9=t9;function J9({className:e,children:t,...n}){return S.jsxs(OP,{"data-slot":"combobox-trigger",className:ze("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,S.jsx(Se,{icon:P2,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function eI({className:e,...t}){return S.jsx(NP,{"data-slot":"combobox-clear",render:S.jsx(QR,{variant:"ghost",size:"icon-xs"}),className:ze(e),...t,children:S.jsx(Se,{icon:vo,strokeWidth:2,className:"pointer-events-none"})})}function tI({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return S.jsxs($9,{className:ze("w-auto",e),children:[S.jsx(IP,{render:S.jsx(Q9,{disabled:n}),...u}),S.jsxs(Y9,{align:"inline-end",children:[s&&S.jsx(QR,{size:"icon-xs",variant:"ghost",render:S.jsx(J9,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&S.jsx(eI,{disabled:n})]}),t]})}function nI({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return S.jsx(UP,{children:S.jsx(WP,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:S.jsx(GP,{"data-slot":"combobox-content","data-chips":!!u,className:ze("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 rI({className:e,...t}){return S.jsx(VP,{"data-slot":"combobox-list",className:ze("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 sI({className:e,children:t,...n}){return S.jsxs(YP,{"data-slot":"combobox-item",className:ze("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,S.jsx(n9,{render:S.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:S.jsx(Se,{icon:La,strokeWidth:2,className:"pointer-events-none"})})]})}function iI({className:e,...t}){return S.jsx(XP,{"data-slot":"combobox-empty",className:ze("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const oI=Ta("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"}}),ZR=k.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function aI({className:e,variant:t,size:n,spacing:s=0,orientation:o="horizontal",children:u,...h}){return S.jsx(q9,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":s,"data-orientation":o,style:{"--gap":s},className:ze("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:S.jsx(ZR.Provider,{value:{variant:t,size:n,spacing:s,orientation:o},children:u})})}function bv({className:e,children:t,variant:n="default",size:s="default",...o}){const u=k.useContext(ZR);return S.jsx(U9,{"data-slot":"toggle-group-item","data-variant":u.variant||n,"data-size":u.size||s,"data-spacing":u.spacing,className:ze("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",oI({variant:u.variant||n,size:u.size||s}),e),...o,children:t})}function Zo({className:e,size:t="default",...n}){return S.jsx(H9,{"data-slot":"switch","data-size":t,className:ze("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:S.jsx(V9,{"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 ja="";function j0(){return Kn({queryKey:["tasks"],queryFn:()=>Zt(`${ja}/api/tasks`)})}function JR(e){return Kn({queryKey:["tasks",e],queryFn:()=>Zt(`${ja}/api/tasks/${e}`),enabled:!!e})}function lI(){const e=$n();return Bn({mutationFn:t=>Zt(`${ja}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function cI(){const e=$n();return Bn({mutationFn:({taskId:t,status:n,position:s})=>Zt(`${ja}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function N0(){const e=$n();return Bn({mutationFn:({taskId:t,updates:n})=>Zt(`${ja}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function uI(){const e=$n();return Bn({mutationFn:t=>Zt(`${ja}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function dI(){const e=$n();return Bn({mutationFn:t=>Zt(`${ja}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const sc="";function fI(e){return Kn({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Zt(`${sc}/api/fs/list${t}`)},enabled:e!==null})}function hI(e){return Kn({queryKey:["git","branches",e],queryFn:()=>Zt(`${sc}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function pI(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(`${sc}/api/git/diff?${u}`)},enabled:!!e,refetchInterval:5e3})}function mI(e){return Kn({queryKey:["fs","tree",e],queryFn:()=>Zt(`${sc}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function gI(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(`${sc}/api/fs/read?${s}`)},enabled:!!e&&!!t})}async function vI(e){return Zt(`${sc}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const ic="",ln={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"},_I=3333,yI="claude --dangerously-skip-permissions";function wo(e){return Kn({queryKey:["config",e],queryFn:()=>Zt(`${ic}/api/config/${e}`)})}function bI(){const e=wo(ln.PORT);return{...e,data:e.data?.value??_I,isDefault:e.data?.isDefault??!0}}function ek(){const e=wo(ln.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function B0(){const e=wo(ln.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function tk(){const e=wo(ln.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??yI,isDefault:e.data?.isDefault??!0}}function Tp(){const e=wo(ln.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function Lp(){const e=wo(ln.SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function xI(){const e=wo(ln.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function SI(){const e=wo(ln.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function CI(){const e=$n();return Bn({mutationFn:({key:t,value:n})=>Zt(`${ic}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]})}})}function wI(){const e=$n();return Bn({mutationFn:t=>Zt(`${ic}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function EI(){return Kn({queryKey:["config","notifications"],queryFn:()=>Zt(`${ic}/api/config/notifications`)})}function RI(){const e=$n();return Bn({mutationFn:t=>Zt(`${ic}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function kI(){return Bn({mutationFn:e=>Zt(`${ic}/api/config/notifications/test/${e}`,{method:"POST"})})}const ld="";function z0(){return Kn({queryKey:["repositories"],queryFn:()=>Zt(`${ld}/api/repositories`)})}function TI(e){return Kn({queryKey:["repositories",e],queryFn:()=>Zt(`${ld}/api/repositories/${e}`),enabled:!!e})}function nk(){const e=$n();return Bn({mutationFn:t=>Zt(`${ld}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function LI(){const e=$n();return Bn({mutationFn:({id:t,updates:n})=>Zt(`${ld}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function rk(){const e=$n();return Bn({mutationFn:t=>Zt(`${ld}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function cd({className:e,children:t,...n}){return S.jsxs(L9,{"data-slot":"scroll-area",className:ze("relative",e),...n,children:[S.jsx(P9,{"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}),S.jsx(AI,{}),S.jsx(B9,{})]})}function AI({className:e,orientation:t="vertical",...n}){return S.jsx(j9,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:ze("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:S.jsx(N9,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function H0({open:e,onOpenChange:t,onSelect:n,initialPath:s}){const[o,u]=k.useState(s||null),[h,a]=k.useState(""),[l,d]=k.useState("");k.useEffect(()=>{e&&(u(s||null),a(""),d(""))},[e,s]);const{data:p,isLoading:f,error:g}=fI(e?o??"":null),x=b=>{p&&(u(p.path+"/"+b),d(""))},C=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},w=()=>{u(null),d("")},_=()=>{h.trim()&&(u(h.trim()),d(""))},y=b=>{n(b),t(!1)},v=p?.entries.filter(b=>b.name.toLowerCase().includes(l.toLowerCase()));return S.jsx(_s,{open:e,onOpenChange:t,children:S.jsxs(ys,{className:"sm:max-w-lg",children:[S.jsxs(js,{children:[S.jsx(Ns,{children:"Select Git Repository"}),S.jsx(ia,{children:"Choose an existing git repository"})]}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),S.jsx(A8,{}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx(Wt,{value:h,onChange:b=>a(b.target.value),placeholder:"/path/to/your/project",onKeyDown:b=>b.key==="Enter"&&_(),className:"flex-1"}),S.jsx(je,{variant:"outline",size:"sm",onClick:_,children:"Go"})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),S.jsxs("div",{className:"relative",children:[S.jsx(Se,{icon:l4,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),S.jsx(Wt,{value:l,onChange:b=>d(b.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(je,{variant:"outline",size:"icon-sm",onClick:w,title:"Home",children:S.jsx(Se,{icon:e4,size:14,strokeWidth:2})}),S.jsx(je,{variant:"outline",size:"icon-sm",onClick:C,disabled:!p||p.parent===p.path,title:"Parent directory",children:S.jsx(Se,{icon:B2,size:14,strokeWidth:2})}),S.jsx("code",{className:"flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate",children:p?.path||"~"}),S.jsx(je,{variant:"outline",size:"sm",onClick:()=>p&&y(p.path),disabled:!p,children:"Select Current"})]}),S.jsx(cd,{className:"h-64 border rounded-md",children:S.jsxs("div",{className:"p-1",children:[f&&S.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),g&&S.jsx("div",{className:"text-destructive text-xs p-3",children:g.message}),p&&v&&S.jsxs(S.Fragment,{children:[v.length===0&&S.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),v.map(b=>S.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:b.type==="directory"?S.jsxs(S.Fragment,{children:[S.jsx(Se,{icon:b.isGitRepo?U2:Ss,size:16,strokeWidth:2,className:b.isGitRepo?"text-emerald-500":"text-blue-500"}),S.jsx("button",{onClick:()=>x(b.name),className:"flex-1 text-left text-xs truncate hover:underline",children:b.name}),b.isGitRepo&&S.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-emerald-500/50 text-emerald-500 font-medium",children:"git repo"})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"w-4"}),S.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate",children:b.name})]})},b.name))]})]})}),S.jsxs(po,{children:[S.jsx(S0,{render:S.jsx(je,{variant:"outline"}),children:"Cancel"}),S.jsx(je,{onClick:()=>p&&y(p.path),disabled:!p,children:"Select Path"})]})]})})}function OI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function MI(e){const t=OI(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function DI({open:e,onOpenChange:t}={}){const[n,s]=k.useState(!1),o=e??n,u=t??s,[h,a]=k.useState(!1),[l,d]=k.useState(""),[p,f]=k.useState(""),[g,x]=k.useState(""),[C,w]=k.useState(""),[_,y]=k.useState(""),[v,b]=k.useState(""),[E,T]=k.useState(!0),[A,M]=k.useState("none"),[L,D]=k.useState(null),[H,z]=k.useState("browse"),[q,j]=k.useState(""),[K,$]=k.useState(null),[V,G]=k.useState(!1),U=_o(),P=lI(),B=nk(),{data:I}=ek(),{data:W}=B0(),{data:Y}=z0(),{data:J,isLoading:Z}=hI(g||null),ee=L?Y?.find(le=>le.id===L):null,X=k.useMemo(()=>{if(!Y)return[];if(!q.trim())return Y;const le=q.toLowerCase();return Y.filter(_e=>_e.displayName.toLowerCase().includes(le)||_e.path.toLowerCase().includes(le))},[Y,q]);k.useEffect(()=>{Y&&Y.length>0?z("saved"):z("browse")},[Y]),k.useEffect(()=>{w(J?J.current||J.branches[0]||"main":"")},[J,g]),k.useEffect(()=>{p.trim()&&A==="none"&&M("plan")},[p,A]);const F=le=>{d(le),b(MI(le))},se=async le=>{$(null),G(!0);try{if(!(await vI(le)).isGitRepo){$("Selected folder is not a git repository"),G(!1);return}if(x(le),D(null),!Y?.find(he=>he.path===le)){const he=le.split("/").pop()||"Unknown";B.mutate({path:le,displayName:he})}}catch(_e){$(_e instanceof Error?_e.message:"Failed to validate repository")}finally{G(!1)}},ne=le=>{if(le.preventDefault(),!l.trim()||!g)return;const _e=g.split("/").pop()||"repo",ve=_.trim()||v,he=`${I}/${ve}`;P.mutate({title:l.trim(),description:p.trim(),repoPath:g,repoName:_e,baseBranch:C||"main",branch:ve,worktreePath:he,initializeVibora:E,copyFiles:ee?.copyFiles||void 0,startupScript:ee?.startupScript||void 0},{onSuccess:ue=>{const Ie=A!=="none"&&p.trim()?{aiMode:A,description:p.trim()}:void 0;u(!1),d(""),f(""),x(""),w(""),y(""),b(""),T(!0),M("none"),D(null),j(""),$(null),z(Y&&Y.length>0?"saved":"browse"),U({to:"/tasks/$taskId",params:{taskId:ue.id},state:Ie})}})},re=_.trim()||v,oe=re?`${I}/${re}`:"";return S.jsxs(S.Fragment,{children:[S.jsxs(_s,{open:o,onOpenChange:u,children:[S.jsxs(sR,{render:S.jsx(je,{size:"sm"}),children:[S.jsx(Se,{icon:ec,size:16,strokeWidth:2,"data-slot":"icon"}),"New Task"]}),S.jsx(ys,{className:"sm:max-w-md",children:S.jsxs("form",{onSubmit:ne,children:[S.jsxs(js,{children:[S.jsx(Ns,{children:"Create New Task"}),S.jsx(ia,{children:"Create a new task with a git worktree for isolated development."})]}),S.jsxs(id,{className:"mt-4",children:[S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"title",children:"Title"}),S.jsx(Wt,{id:"title",value:l,onChange:le=>F(le.target.value),placeholder:"Add user authentication",required:!0})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"description",children:"Description"}),S.jsx(Sp,{id:"description",value:p,onChange:le=>f(le.target.value),placeholder:"Implement OAuth2 login flow...",rows:2})]}),S.jsxs(Cn,{children:[S.jsx(wn,{children:"AI Mode"}),S.jsxs(aI,{value:[A],onValueChange:le=>{const _e=Array.isArray(le)?le[0]:le;_e&&M(_e)},className:"w-full",variant:"outline",children:[S.jsx(bv,{value:"none",className:"flex-1",children:"None"}),S.jsx(bv,{value:"plan",className:"flex-1",children:"Plan"}),S.jsx(bv,{value:"default",className:"flex-1",children:"Default"})]})]}),S.jsxs(Cn,{children:[S.jsx(wn,{children:"Repository"}),S.jsxs(Cp,{value:H,onValueChange:le=>{z(le),$(null)},children:[S.jsxs(wp,{children:[S.jsx(mo,{value:"saved",disabled:!Y?.length,children:"Saved"}),S.jsx(mo,{value:"browse",children:"Browse"})]}),S.jsx(ga,{value:"saved",className:"mt-2",children:S.jsxs(Z9,{value:L||"",onValueChange:le=>{const _e=Y?.find(ve=>ve.id===le);_e&&(D(le),x(_e.path),j(_e.displayName),$(null))},inputValue:q,onInputValueChange:le=>{j(le),ee&&le!==ee.displayName&&D(null)},itemToStringLabel:le=>Y?.find(_e=>_e.id===le)?.displayName||"",children:[S.jsx(tI,{placeholder:"Search repositories...",className:"w-full"}),S.jsx(nI,{children:S.jsxs(rI,{children:[S.jsx(iI,{children:"No repositories found"}),X.map(le=>S.jsx(sI,{value:le.id,children:le.displayName},le.id))]})})]})}),S.jsx(ga,{value:"browse",className:"mt-2",children:S.jsxs(je,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:V,children:[S.jsx(Se,{icon:Ss,size:14,strokeWidth:2,className:"mr-2"}),V?S.jsx("span",{className:"text-muted-foreground",children:"Validating..."}):g&&!L?S.jsx("span",{className:"truncate",children:g}):S.jsx("span",{className:"text-muted-foreground",children:"Select folder..."})]})})]}),K&&S.jsx("p",{className:"text-sm text-destructive",children:K}),g&&!K&&S.jsx(so,{className:"font-mono text-xs truncate",children:g})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"baseBranch",children:"Base Branch"}),S.jsxs(Dl,{value:C,onValueChange:le=>w(le??""),disabled:!g||Z,children:[S.jsx(Il,{className:"w-full",children:S.jsx(Pl,{children:C||S.jsx("span",{className:"text-muted-foreground",children:g?Z?"Loading branches...":"Select branch":"Select repository first"})})}),S.jsx(jl,{children:J?.branches.map(le=>S.jsxs(pr,{value:le,children:[le,le===J.current&&S.jsx("span",{className:"text-muted-foreground ml-2",children:"(current)"})]},le))})]})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"branch",children:"Branch Name"}),S.jsx(Wt,{id:"branch",value:_,onChange:le=>y(le.target.value),placeholder:v||"auto-generated-from-title"}),oe&&S.jsxs(so,{children:["Worktree: ",oe]}),!_.trim()&&v&&S.jsxs(so,{children:['Will use "',v,'" if left empty.']})]}),S.jsxs(Cn,{className:"flex flex-row items-center justify-between",children:[S.jsxs("div",{children:[S.jsx(wn,{htmlFor:"initializeVibora",className:"mb-0 cursor-pointer",children:"Initialize Vibora"}),S.jsx(so,{children:"Create or update CLAUDE.local.md with CLI instructions"})]}),S.jsx(Zo,{id:"initializeVibora",checked:E,onCheckedChange:le=>T(le)})]})]}),S.jsxs(po,{className:"mt-4",children:[S.jsx(S0,{render:S.jsx(je,{variant:"outline",type:"button"}),children:"Cancel"}),S.jsx(je,{type:"submit",disabled:P.isPending||!l.trim()||!g,children:P.isPending?"Creating...":"Create Task"})]})]})})]}),S.jsx(H0,{open:h,onOpenChange:a,onSelect:se,initialPath:W||void 0})]})}function PI({onNewTaskRef:e,onOpenCommandPalette:t}){const{location:n}=Jn(),s=n.pathname,[o,u]=k.useState(!1);return k.useEffect(()=>{e?.(()=>u(!0))},[e]),S.jsxs("header",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between border-b border-border bg-black px-4",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx(qn,{to:"/tasks",className:"flex items-center",children:S.jsx("img",{src:"/vibora-logo.jpeg",alt:"Vibora",className:"h-7"})}),S.jsxs("nav",{className:"flex items-center gap-1",children:[S.jsx(qn,{to:"/tasks",children:S.jsxs(je,{variant:s.startsWith("/tasks")?"secondary":"ghost",size:"sm",children:[S.jsx(Se,{icon:Th,size:16,strokeWidth:2,"data-slot":"icon"}),"Tasks"]})}),S.jsx(qn,{to:"/terminals",children:S.jsxs(je,{variant:s==="/terminals"?"secondary":"ghost",size:"sm",children:[S.jsx(Se,{icon:Z_,size:16,strokeWidth:2,"data-slot":"icon"}),"Terminals"]})}),S.jsx(qn,{to:"/worktrees",children:S.jsxs(je,{variant:s.startsWith("/worktrees")?"secondary":"ghost",size:"sm",children:[S.jsx(Se,{icon:W2,size:16,strokeWidth:2,"data-slot":"icon"}),"Worktrees"]})}),S.jsx(qn,{to:"/repositories",children:S.jsxs(je,{variant:s.startsWith("/repositories")?"secondary":"ghost",size:"sm",children:[S.jsx(Se,{icon:V2,size:16,strokeWidth:2,"data-slot":"icon"}),"Repositories"]})}),S.jsx(qn,{to:"/review",children:S.jsxs(je,{variant:s.startsWith("/review")?"secondary":"ghost",size:"sm",children:[S.jsx(Se,{icon:J_,size:16,strokeWidth:2,"data-slot":"icon"}),"Review"]})})]})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(DI,{open:o,onOpenChange:u}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:t,title:"Command Palette (⌘K)",children:S.jsx(Se,{icon:H2,size:16,strokeWidth:2})}),S.jsx(qn,{to:"/settings",children:S.jsx(je,{variant:s==="/settings"?"secondary":"ghost",size:"icon-sm",children:S.jsx(Se,{icon:G2,size:16,strokeWidth:2})})})]})]})}function II(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 jI=e=>{switch(e){case"success":return zI;case"info":return VI;case"warning":return HI;case"error":return FI;default:return null}},NI=Array(12).fill(0),BI=({visible:e,className:t})=>Ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ne.createElement("div",{className:"sonner-spinner"},NI.map((n,s)=>Ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),zI=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ne.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"})),HI=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ne.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"})),VI=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ne.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"})),FI=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ne.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"})),UI=Ne.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"},Ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WI=()=>{const[e,t]=Ne.useState(document.hidden);return Ne.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let f_=1;class qI{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:f_++,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],Ne.isValidElement(d))u=!1,this.create({id:s,type:"default",message:d});else if($I(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"&&!Ne.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"&&!Ne.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"&&!Ne.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,x=typeof p=="object"&&!Ne.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:f,...x})}}).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||f_++;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 mr=new qI,GI=(e,t)=>{const n=t?.id||f_++;return mr.addToast({title:e,...t,id:n}),n},$I=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",KI=GI,YI=()=>mr.toasts,XI=()=>mr.getActiveToasts(),Ir=Object.assign(KI,{success:mr.success,info:mr.info,warning:mr.warning,error:mr.error,custom:mr.custom,message:mr.message,promise:mr.promise,dismiss:mr.dismiss,loading:mr.loading},{getHistory:YI,getToasts:XI});II("[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 Zf(e){return e.label!==void 0}const QI=3,ZI="24px",JI="16px",wC=4e3,ej=356,tj=14,nj=45,rj=200;function As(...e){return e.filter(Boolean).join(" ")}function sj(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const ij=e=>{var t,n,s,o,u,h,a,l,d;const{invert:p,toast:f,unstyled:g,interacting:x,setHeights:C,visibleToasts:w,heights:_,index:y,toasts:v,expanded:b,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:D,className:H="",descriptionClassName:z="",duration:q,position:j,gap:K,expandByDefault:$,classNames:V,icons:G,closeButtonAriaLabel:U="Close toast"}=e,[P,B]=Ne.useState(null),[I,W]=Ne.useState(null),[Y,J]=Ne.useState(!1),[Z,ee]=Ne.useState(!1),[X,F]=Ne.useState(!1),[se,ne]=Ne.useState(!1),[re,oe]=Ne.useState(!1),[le,_e]=Ne.useState(0),[ve,he]=Ne.useState(0),ue=Ne.useRef(f.duration||q||wC),Ie=Ne.useRef(null),Me=Ne.useRef(null),Ae=y===0,be=y+1<=w,Oe=f.type,me=f.dismissible!==!1,de=f.className||"",xe=f.descriptionClassName||"",We=Ne.useMemo(()=>_.findIndex(Ze=>Ze.toastId===f.id)||0,[_,f.id]),nt=Ne.useMemo(()=>{var Ze;return(Ze=f.closeButton)!=null?Ze:A},[f.closeButton,A]),Ve=Ne.useMemo(()=>f.duration||q||wC,[f.duration,q]),rt=Ne.useRef(0),Je=Ne.useRef(0),dt=Ne.useRef(0),Ce=Ne.useRef(null),[Be,Re]=j.split("-"),et=Ne.useMemo(()=>_.reduce((Ze,Ot,jt)=>jt>=We?Ze:Ze+Ot.height,0),[_,We]),at=WI(),Ye=f.invert||p,st=Oe==="loading";Je.current=Ne.useMemo(()=>We*K+et,[We,et]),Ne.useEffect(()=>{ue.current=Ve},[Ve]),Ne.useEffect(()=>{J(!0)},[]),Ne.useEffect(()=>{const Ze=Me.current;if(Ze){const Ot=Ze.getBoundingClientRect().height;return he(Ot),C(jt=>[{toastId:f.id,height:Ot,position:f.position},...jt]),()=>C(jt=>jt.filter(ot=>ot.toastId!==f.id))}},[C,f.id]),Ne.useLayoutEffect(()=>{if(!Y)return;const Ze=Me.current,Ot=Ze.style.height;Ze.style.height="auto";const jt=Ze.getBoundingClientRect().height;Ze.style.height=Ot,he(jt),C(ot=>ot.find(bt=>bt.toastId===f.id)?ot.map(bt=>bt.toastId===f.id?{...bt,height:jt}:bt):[{toastId:f.id,height:jt,position:f.position},...ot])},[Y,f.title,f.description,C,f.id,f.jsx,f.action,f.cancel]);const Ct=Ne.useCallback(()=>{ee(!0),_e(Je.current),C(Ze=>Ze.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},rj)},[f,E,C,Je]);Ne.useEffect(()=>{if(f.promise&&Oe==="loading"||f.duration===1/0||f.type==="loading")return;let Ze;return b||x||at?(()=>{if(dt.current<rt.current){const ot=new Date().getTime()-rt.current;ue.current=ue.current-ot}dt.current=new Date().getTime()})():ue.current!==1/0&&(rt.current=new Date().getTime(),Ze=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},ue.current)),()=>clearTimeout(Ze)},[b,x,f,Oe,at,Ct]),Ne.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function lt(){var Ze;if(G?.loading){var Ot;return Ne.createElement("div",{className:As(V?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Oe==="loading"},G.loading)}return Ne.createElement(BI,{className:As(V?.loader,f==null||(Ze=f.classNames)==null?void 0:Ze.loader),visible:Oe==="loading"})}const nn=f.icon||G?.[Oe]||jI(Oe);var kt,vt;return Ne.createElement("li",{tabIndex:0,ref:Me,className:As(H,de,V?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,V?.default,V?.[Oe],f==null||(n=f.classNames)==null?void 0:n[Oe]),"data-sonner-toast":"","data-rich-colors":(kt=f.richColors)!=null?kt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":Y,"data-promise":!!f.promise,"data-swiped":re,"data-removed":Z,"data-visible":be,"data-y-position":Be,"data-x-position":Re,"data-index":y,"data-front":Ae,"data-swiping":X,"data-dismissible":me,"data-type":Oe,"data-invert":Ye,"data-swipe-out":se,"data-swipe-direction":I,"data-expanded":!!(b||$&&Y),"data-testid":f.testId,style:{"--index":y,"--toasts-before":y,"--z-index":v.length-y,"--offset":`${Z?le:Je.current}px`,"--initial-height":$?"auto":`${ve}px`,...M,...f.style},onDragEnd:()=>{F(!1),B(null),Ce.current=null},onPointerDown:Ze=>{Ze.button!==2&&(st||!me||(Ie.current=new Date,_e(Je.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(F(!0),Ce.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Ot,jt;if(se||!me)return;Ce.current=null;const ot=Number(((Ze=Me.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=Me.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((jt=Ie.current)==null?void 0:jt.getTime()),xt=P==="x"?ot:wt,Xe=Math.abs(xt)/bt;if(Math.abs(xt)>=nj||Xe>.11){_e(Je.current),f.onDismiss==null||f.onDismiss.call(f,f),W(P==="x"?ot>0?"right":"left":wt>0?"down":"up"),Ct(),ne(!0);return}else{var Ht,kn;(Ht=Me.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(kn=Me.current)==null||kn.style.setProperty("--swipe-amount-y","0px")}oe(!1),F(!1),B(null)},onPointerMove:Ze=>{var Ot,jt,ot;if(!Ce.current||!me||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Ze.clientY-Ce.current.y,xt=Ze.clientX-Ce.current.x;var Xe;const Ht=(Xe=e.swipeDirections)!=null?Xe:sj(j);!P&&(Math.abs(xt)>1||Math.abs(bt)>1)&&B(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(P==="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(P==="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),(jt=Me.current)==null||jt.style.setProperty("--swipe-amount-x",`${kn.x}px`),(ot=Me.current)==null||ot.style.setProperty("--swipe-amount-y",`${kn.y}px`)}},nt&&!f.jsx&&Oe!=="loading"?Ne.createElement("button",{"aria-label":U,"data-disabled":st,"data-close-button":!0,onClick:st||!me?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:As(V?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=G?.close)!=null?vt:UI):null,(Oe||f.icon||f.promise)&&f.icon!==null&&(G?.[Oe]!==null||f.icon)?Ne.createElement("div",{"data-icon":"",className:As(V?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||lt():null,f.type!=="loading"?nn:null):null,Ne.createElement("div",{"data-content":"",className:As(V?.content,f==null||(u=f.classNames)==null?void 0:u.content)},Ne.createElement("div",{"data-title":"",className:As(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?Ne.createElement("div",{"data-description":"",className:As(z,xe,V?.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),Ne.isValidElement(f.cancel)?f.cancel:f.cancel&&Zf(f.cancel)?Ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Ze=>{Zf(f.cancel)&&me&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ze),Ct())},className:As(V?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,Ne.isValidElement(f.action)?f.action:f.action&&Zf(f.action)?Ne.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:Ze=>{Zf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ze),!Ze.defaultPrevented&&Ct())},className:As(V?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function EC(){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 oj(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?JI:ZI;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 aj=Ne.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:x,duration:C,style:w,visibleToasts:_=QI,toastOptions:y,dir:v=EC(),gap:b=tj,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=Ne.useState([]),L=Ne.useMemo(()=>s?A.filter(Y=>Y.toasterId===s):A.filter(Y=>!Y.toasterId),[A,s]),D=Ne.useMemo(()=>Array.from(new Set([u].concat(L.filter(Y=>Y.position).map(Y=>Y.position)))),[L,u]),[H,z]=Ne.useState([]),[q,j]=Ne.useState(!1),[K,$]=Ne.useState(!1),[V,G]=Ne.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Ne.useRef(null),P=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=Ne.useRef(null),I=Ne.useRef(!1),W=Ne.useCallback(Y=>{M(J=>{var Z;return(Z=J.find(ee=>ee.id===Y.id))!=null&&Z.delete||mr.dismiss(Y.id),J.filter(({id:ee})=>ee!==Y.id)})},[]);return Ne.useEffect(()=>mr.subscribe(Y=>{if(Y.dismiss){requestAnimationFrame(()=>{M(J=>J.map(Z=>Z.id===Y.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{d3.flushSync(()=>{M(J=>{const Z=J.findIndex(ee=>ee.id===Y.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...Y},...J.slice(Z+1)]:[Y,...J]})})})}),[A]),Ne.useEffect(()=>{if(g!=="system"){G(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;const Y=window.matchMedia("(prefers-color-scheme: dark)");try{Y.addEventListener("change",({matches:J})=>{G(J?"dark":"light")})}catch{Y.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),Ne.useEffect(()=>{A.length<=1&&j(!1)},[A]),Ne.useEffect(()=>{const Y=J=>{var Z;if(h.every(F=>J[F]||J.code===F)){var X;j(!0),(X=U.current)==null||X.focus()}J.code==="Escape"&&(document.activeElement===U.current||(Z=U.current)!=null&&Z.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[h]),Ne.useEffect(()=>{if(U.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,I.current=!1)}},[U.current]),Ne.createElement("section",{ref:n,"aria-label":`${T} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((Y,J)=>{var Z;const[ee,X]=Y.split("-");return L.length?Ne.createElement("ol",{key:Y,dir:v==="auto"?EC():v,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":ee,"data-x-position":X,style:{"--front-toast-height":`${((Z=H[0])==null?void 0:Z.height)||0}px`,"--width":`${ej}px`,"--gap":`${b}px`,...w,...oj(p,f)},onBlur:F=>{I.current&&!F.currentTarget.contains(F.relatedTarget)&&(I.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||I.current||(I.current=!0,B.current=F.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{K||j(!1)},onDragEnd:()=>j(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},L.filter(F=>!F.position&&J===0||F.position===Y).map((F,se)=>{var ne,re;return Ne.createElement(ij,{key:F.id,icons:E,index:se,toast:F,defaultRichColors:x,duration:(ne=y?.duration)!=null?ne:C,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:o,visibleToasts:_,closeButton:(re=y?.closeButton)!=null?re:l,interacting:K,position:Y,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:W,toasts:L.filter(oe=>oe.position==F.position),heights:H.filter(oe=>oe.position==F.position),setHeights:z,expandByDefault:a,gap:b,expanded:q,swipeDirections:t.swipeDirections})})):null}))});function lj(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const cj=10,uj=2e3;function dj(){const e=$n(),t=k.useRef(null),n=k.useRef(void 0),s=k.useRef(0),o=k.useRef(void 0),u=k.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":Ir.success(d,{description:p});break;case"error":Ir.error(d,{description:p});break;case"warning":Ir.warning(d,{description:p});break;default:Ir.info(d,{description:p});break}}}catch{}},[e]),h=k.useCallback(()=>{const a=t.current;if(a&&(a.readyState===WebSocket.CONNECTING||a.readyState===WebSocket.OPEN))return;const l=lj(),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<cj&&(s.current++,n.current=setTimeout(()=>{o.current?.()},uj))},d.onerror=()=>{}},[u]);o.current=h,k.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const sk=k.createContext(null);function fj({children:e}){const[t,n]=k.useState(!1),[s,o]=k.useState(!1),u=k.useCallback(d=>{n(d)},[]),h=k.useCallback(d=>{o(d)},[]),a=k.useMemo(()=>!t,[t]),l=k.useMemo(()=>({terminalFocused:t,setTerminalFocused:u,modalOpen:s,setModalOpen:h,shortcutsEnabled:a}),[t,u,s,h,a]);return S.jsx(sk.Provider,{value:l,children:e})}function V0(){const e=k.useContext(sk);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function hj(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function ik(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 pj(e,t){const n=ik(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 ok(e){const t=ik(e),n=[],s=hj();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 mj(e){if(!e||!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return!!(t==="input"||t==="textarea"||e.isContentEditable)}function _i(e,t,n={}){const{shortcutsEnabled:s}=V0(),{ignoreContext:o=!1,allowInInput:u=!1,deps:h=[],enabled:a=!0}=n,l=k.useRef(t);l.current=t;const d=Array.isArray(e)?e:[e],p=k.useCallback(f=>{!o&&!s||!a||!u&&mj(f.target)&&!d.some(C=>C.toLowerCase()==="escape")||!d.some(x=>pj(f,x))||(f.preventDefault(),f.stopPropagation(),l.current(f))},[s,o,u,a,...d,...h]);k.useEffect(()=>(document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}),[p])}function RC(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 gj(e,t){return t.trim()?e.map(s=>{let o=RC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=RC(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 vj(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 _j={navigation:"Navigation",actions:"Actions"},yj={activeTabId:null,focusedTerminals:{}};function ak(){const e=$n(),t=k.useRef(void 0),n=k.useRef({}),{data:s=yj,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=Bn({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=k.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,x={activeTabId:g.activeTabId!==void 0?g.activeTabId:s.activeTabId,focusedTerminals:{...s.focusedTerminals,...g.focusedTerminals}};e.setQueryData(["terminal-view-state"],x),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{u.mutate(n.current),n.current={}},500)},[e,s,u]),a=k.useCallback(p=>{h({activeTabId:p})},[h]),l=k.useCallback((p,f)=>{if(f===null){const{[p]:g,...x}=s.focusedTerminals;h({focusedTerminals:x})}else h({focusedTerminals:{[p]:f}})},[h,s.focusedTerminals]),d=k.useCallback(p=>s.focusedTerminals[p]??null,[s.focusedTerminals]);return{viewState:s,isLoading:o,activeTabId:s.activeTabId,setActiveTab:a,getFocusedTerminal:d,setFocusedTerminal:l}}function bj({open:e,onOpenChange:t,onNewTask:n,onShowShortcuts:s}){const[o,u]=k.useState(!1),h=e??o,a=t??u,[l,d]=k.useState(""),[p,f]=k.useState(0),g=k.useRef(null),x=k.useRef(null),C=_o(),{setActiveTab:w}=ak(),_=k.useMemo(()=>[{id:"goto-tasks",label:"Go to Tasks",shortcut:"meta+1",keywords:["kanban","board","home"],category:"navigation",icon:S.jsx(Se,{icon:Th,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:S.jsx(Se,{icon:Z_,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:S.jsx(Se,{icon:Th,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:S.jsx(Se,{icon:W2,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:S.jsx(Se,{icon:V2,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:S.jsx(Se,{icon:G2,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:S.jsx(Se,{icon:ec,size:16,strokeWidth:2}),action:()=>{a(!1),n?.()}},{id:"show-shortcuts",label:"Keyboard Shortcuts",shortcut:"meta+/",keywords:["help","hotkeys","keys"],category:"actions",icon:S.jsx(Se,{icon:JM,size:16,strokeWidth:2}),action:()=>{a(!1),s?.()}}],[C,n,s,w]),y=k.useMemo(()=>gj(_,l),[_,l]),v=k.useMemo(()=>vj(y),[y]),b=k.useMemo(()=>{const A=[],M=["navigation","actions"];for(const L of M){const D=v.get(L);D&&A.push(...D)}return A},[v]);k.useEffect(()=>{f(0)},[l]),k.useEffect(()=>{if(!x.current)return;const A=x.current.querySelector('[data-selected="true"]');A&&A.scrollIntoView({block:"nearest"})},[p]),_i("meta+k",()=>a(!0),{allowInInput:!0}),_i("meta+1",()=>C({to:"/tasks"}),{allowInInput:!0}),_i("meta+2",()=>C({to:"/terminals"}),{allowInInput:!0}),_i("meta+i",()=>{w("all-tasks"),C({to:"/terminals"})},{allowInInput:!0}),_i("meta+3",()=>C({to:"/worktrees"}),{allowInInput:!0}),_i("meta+4",()=>C({to:"/repositories"}),{allowInInput:!0}),_i("meta+,",()=>C({to:"/settings"}),{allowInInput:!0}),_i("meta+j",()=>{n?.()},{allowInInput:!1,deps:[n]}),_i("meta+/",()=>{s?.()},{allowInInput:!0,deps:[s]});const E=k.useCallback(A=>{switch(A.key){case"ArrowDown":A.preventDefault(),f(M=>Math.min(M+1,b.length-1));break;case"ArrowUp":A.preventDefault(),f(M=>Math.max(M-1,0));break;case"Enter":A.preventDefault(),b[p]&&b[p].action();break;case"Escape":A.preventDefault(),a(!1);break}},[b,p]);k.useEffect(()=>{h&&(d(""),f(0),setTimeout(()=>g.current?.focus(),50))},[h]);let T=0;return S.jsx(_s,{open:h,onOpenChange:a,children:S.jsxs(ys,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",showCloseButton:!1,onKeyDown:E,children:[S.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[S.jsx("span",{className:"text-muted-foreground mr-2",children:">"}),S.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"}),S.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"})]}),S.jsx("div",{ref:x,className:"max-h-80 overflow-y-auto p-2",children:y.length===0?S.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No commands found."}):S.jsx(S.Fragment,{children:["navigation","actions"].map(A=>{const M=v.get(A);return!M||M.length===0?null:S.jsxs("div",{className:"mb-2 last:mb-0",children:[S.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:_j[A]}),M.map(L=>{const D=T++,H=D===p;return S.jsxs("button",{"data-selected":H,onClick:()=>L.action(),onMouseEnter:()=>f(D),className:ze("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",H?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[L.icon&&S.jsx("span",{className:"text-muted-foreground",children:L.icon}),S.jsx("span",{className:"flex-1 text-left",children:L.label}),L.shortcut&&S.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:ok(L.shortcut)})]},L.id)})]},A)})})})]})})}const xj=[{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 Sj({open:e,onOpenChange:t}){return S.jsx(_s,{open:e,onOpenChange:t,children:S.jsxs(ys,{className:"sm:max-w-md",children:[S.jsx(js,{children:S.jsx(Ns,{children:"Keyboard Shortcuts"})}),S.jsx("div",{className:"space-y-4 mt-2",children:xj.map(n=>S.jsxs("div",{children:[S.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:n.title}),S.jsx("div",{className:"space-y-1",children:n.items.map(s=>S.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[S.jsx("span",{className:"text-sm",children:s.label}),S.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:ok(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const Cj=({...e})=>S.jsx(aj,{theme:"dark",className:"toaster group",icons:{success:S.jsx(Se,{icon:GM,strokeWidth:2,className:"size-4"}),info:S.jsx(Se,{icon:n4,strokeWidth:2,className:"size-4"}),warning:S.jsx(Se,{icon:Jl,strokeWidth:2,className:"size-4"}),error:S.jsx(Se,{icon:o4,strokeWidth:2,className:"size-4"}),loading:S.jsx(Se,{icon:Nr,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}),Gs=S3({component:Ej});function wj(){return dj(),null}function Ej(){const[e,t]=k.useState(null),[n,s]=k.useState(!1),[o,u]=k.useState(!1),h=k.useCallback(p=>{t(()=>p)},[]),a=k.useCallback(()=>{e?.()},[e]),l=k.useCallback(()=>{s(!0)},[]),d=k.useCallback(()=>{u(!0)},[]);return S.jsx(fj,{children:S.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground",children:[S.jsx(wj,{}),S.jsx(PI,{onNewTaskRef:h,onOpenCommandPalette:d}),S.jsx("main",{className:"isolate flex-1 overflow-hidden",children:S.jsx(t2,{})}),S.jsx(bj,{open:o,onOpenChange:u,onNewTask:a,onShowShortcuts:l}),S.jsx(Sj,{open:n,onOpenChange:s}),S.jsx(Cj,{position:"bottom-right"})]})})}const Rj=xs("/")({beforeLoad:()=>{throw zw({to:"/tasks"})}}),lk="";function kj(){const[e,t]=k.useState(new Map),[n,s]=k.useState(null),[o,u]=k.useState(!0),[h,a]=k.useState(!1),[l,d]=k.useState(null),p=k.useRef(null),f=k.useRef(0),g=k.useCallback(()=>{p.current?.close(),u(!0),a(!1),d(null),t(new Map),s(null);const C=new EventSource(`${lk}/api/worktrees`);p.current=C,C.addEventListener("worktree:basic",w=>{const _=JSON.parse(w.data);f.current=_.length,t(new Map(_.map(y=>[y.path,{...y,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(_.length>0)}),C.addEventListener("worktree:details",w=>{const _=JSON.parse(w.data);t(y=>{const v=new Map(y),b=v.get(_.path);return b&&v.set(_.path,{...b,size:_.size,sizeFormatted:_.sizeFormatted,branch:_.branch}),v}),f.current--,f.current<=0&&a(!1)}),C.addEventListener("worktree:complete",w=>{const _=JSON.parse(w.data);s(_),a(!1),C.close()}),C.addEventListener("worktree:error",w=>{const{path:_}=JSON.parse(w.data);console.error(`Error loading worktree details for ${_}`),f.current--,f.current<=0&&a(!1)}),C.onerror=()=>{d(new Error("Connection lost")),u(!1),a(!1),C.close()}},[]);return k.useEffect(()=>(g(),()=>{p.current?.close()}),[g]),{worktrees:k.useMemo(()=>Array.from(e.values()).sort((w,_)=>w.isOrphaned!==_.isOrphaned?w.isOrphaned?-1:1:new Date(_.lastModified).getTime()-new Date(w.lastModified).getTime()),[e]),summary:n,isLoading:o,isLoadingDetails:h,error:l,refetch:g}}function Tj(){const e=$n();return Bn({mutationFn:({worktreePath:t,repoPath:n})=>Zt(`${lk}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const Lj=Ta("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 va({className:e,variant:t="default",render:n,...s}){return G9({defaultTagName:"span",props:Fs({className:ze(Lj({className:e,variant:t}))},s),render:n,state:{slot:"badge",variant:t}})}function ud({className:e,size:t="default",...n}){return S.jsx("div",{"data-slot":"card","data-size":t,className:ze("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 Aj({className:e,...t}){return S.jsx("div",{"data-slot":"card-header",className:ze("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 Oj({className:e,...t}){return S.jsx("div",{"data-slot":"card-title",className:ze("text-sm font-medium",e),...t})}function dd({className:e,...t}){return S.jsx("div",{"data-slot":"card-content",className:ze("px-4 group-data-[size=sm]/card:px-3",e),...t})}function oc({...e}){return S.jsx(wP,{"data-slot":"alert-dialog",...e})}function ac({...e}){return S.jsx(rR,{"data-slot":"alert-dialog-trigger",...e})}function Mj({...e}){return S.jsx(JE,{"data-slot":"alert-dialog-portal",...e})}function Dj({className:e,...t}){return S.jsx(K2,{"data-slot":"alert-dialog-overlay",className:ze("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 lc({className:e,size:t="default",...n}){return S.jsxs(Mj,{children:[S.jsx(Dj,{}),S.jsx(ZE,{"data-slot":"alert-dialog-content","data-size":t,className:ze("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 cc({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-header",className:ze("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 uc({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-footer",className:ze("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 dc({className:e,...t}){return S.jsx(nR,{"data-slot":"alert-dialog-title",className:ze("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 fc({className:e,...t}){return S.jsx(Q2,{"data-slot":"alert-dialog-description",className:ze("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function ck({className:e,...t}){return S.jsx(je,{"data-slot":"alert-dialog-action",className:ze(e),...t})}function hc({className:e,variant:t="outline",size:n="default",...s}){return S.jsx(up,{"data-slot":"alert-dialog-cancel",className:ze(e),render:S.jsx(je,{variant:t,size:n}),...s})}const uk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},h_={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"},Pj=xs("/worktrees/")({component:Bj});function Ij(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 kC({className:e}){return S.jsx("span",{className:`inline-block animate-pulse rounded bg-muted ${e}`})}function jj({worktree:e,onDelete:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(!1),h=e.sizeFormatted==="..."||e.branch==="...",a=async()=>{u(!0);try{await t(e),s(!1)}catch{}finally{u(!1)}};return S.jsx(ud,{className:"transition-colors hover:border-border/80",children:S.jsxs(dd,{className:"flex items-start justify-between gap-4 py-4",children:[S.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"truncate font-medium",children:e.name}),e.isOrphaned?S.jsx(va,{className:ze("shrink-0",h_.ORPHANED),children:"Orphaned"}):e.taskStatus?S.jsx(va,{className:ze("shrink-0",h_[e.taskStatus]),children:uk[e.taskStatus]}):null]}),S.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:Ss,size:12,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{className:"truncate font-mono",children:e.path})]}),S.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:t_,size:12,strokeWidth:2,className:"shrink-0"}),e.branch==="..."?S.jsx(kC,{className:"h-3 w-16"}):S.jsx("span",{className:"font-mono",children:e.branch})]}),S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:ZM,size:12,strokeWidth:2,className:"shrink-0"}),e.sizeFormatted==="..."?S.jsx(kC,{className:"h-3 w-12"}):S.jsx("span",{children:e.sizeFormatted})]}),S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:WM,size:12,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{children:Ij(e.lastModified)})]})]}),e.taskId&&e.taskTitle&&S.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:S.jsxs(qn,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[S.jsx("span",{className:"truncate",children:e.taskTitle}),S.jsx(Se,{icon:N2,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),S.jsxs(oc,{open:n,onOpenChange:s,children:[S.jsx(ac,{render:S.jsx(je,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:h}),children:S.jsx(Se,{icon:Xu,size:14,strokeWidth:2})}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsx(dc,{children:"Delete Worktree"}),S.jsxs(fc,{children:["This will permanently delete the worktree directory at"," ",S.jsx("span",{className:"font-mono",children:e.name}),".",!e.isOrphaned&&S.jsxs(S.Fragment,{children:[" ","The linked task ",S.jsxs("span",{className:"font-medium",children:['"',e.taskTitle,'"']})," will also be deleted."]})," ","This action cannot be undone."]})]}),S.jsxs(uc,{children:[S.jsx(hc,{disabled:o,children:"Cancel"}),S.jsxs(je,{variant:"destructive",onClick:a,disabled:o,className:"gap-2",children:[o&&S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})})}const Nj=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function Bj(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=kj(),h=Tj(),[a,l]=k.useState(new Set),[d,p]=k.useState(!1),[f,g]=k.useState(!1),x=b=>{l(E=>{const T=new Set(E);return T.has(b)?T.delete(b):T.add(b),T})},C=()=>{l(new Set)},w=k.useMemo(()=>a.size===0?e:e.filter(b=>!!(b.isOrphaned&&a.has("ORPHANED")||b.taskStatus&&a.has(b.taskStatus))),[e,a]),_=k.useMemo(()=>e.filter(b=>b.taskStatus==="DONE"||b.taskStatus==="CANCELED"),[e]),y=async()=>{if(_.length!==0){g(!0);try{for(const b of _)await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath});p(!1),u()}catch{}finally{g(!1)}}},v=async b=>{await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath}),u()};return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-2",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("h1",{className:"text-sm font-medium",children:"Worktrees"}),(t||e.length>0)&&S.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[S.jsxs("span",{children:[t?.total??e.length," total"]}),(t?.orphaned??e.filter(b=>b.isOrphaned).length)>0&&S.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(b=>b.isOrphaned).length," orphaned"]}),s?S.jsx("span",{className:"animate-pulse",children:"calculating..."}):t?S.jsx("span",{children:t.totalSizeFormatted}):null]})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[_.length>0&&S.jsxs(oc,{open:d,onOpenChange:p,children:[S.jsxs(ac,{render:S.jsx(je,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground hover:text-destructive",disabled:s}),children:[S.jsx(Se,{icon:$M,size:12,strokeWidth:2}),"Clean up (",_.length,")"]}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsx(dc,{children:"Delete Completed Worktrees"}),S.jsxs(fc,{className:"space-y-2",children:[S.jsxs("span",{className:"block",children:["This will permanently delete ",_.length," worktree",_.length!==1?"s":""," and their linked tasks:"]}),S.jsxs("span",{className:"block text-sm",children:[_.filter(b=>b.taskStatus==="DONE").length>0&&S.jsxs("span",{className:"mr-3",children:[S.jsx("span",{className:"font-medium text-emerald-600",children:_.filter(b=>b.taskStatus==="DONE").length})," ","Done"]}),_.filter(b=>b.taskStatus==="CANCELED").length>0&&S.jsxs("span",{children:[S.jsx("span",{className:"font-medium text-rose-600",children:_.filter(b=>b.taskStatus==="CANCELED").length})," ","Canceled"]})]}),S.jsx("span",{className:"block font-medium text-destructive",children:"This action cannot be undone."})]})]}),S.jsxs(uc,{children:[S.jsx(hc,{disabled:f,children:"Cancel"}),S.jsxs(je,{variant:"destructive",onClick:y,disabled:f,className:"gap-2",children:[f&&S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}),f?"Deleting...":`Delete ${_.length}`]})]})]})]}),a.size>0&&S.jsxs(je,{variant:"ghost",size:"sm",onClick:C,className:"gap-1.5 text-xs",children:[S.jsx(Se,{icon:vo,size:12,strokeWidth:2}),"Clear filters"]})]})]}),S.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:Nj.map(b=>{const E=a.has(b);return S.jsx("button",{onClick:()=>x(b),className:ze("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",E?h_[b]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:uk[b]},b)})})]}),S.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[n&&S.jsx("div",{className:"flex items-center justify-center py-12",children:S.jsx(Se,{icon:Nr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),o&&S.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[S.jsx(Se,{icon:Jl,size:20,strokeWidth:2}),S.jsxs("span",{className:"text-sm",children:["Failed to load worktrees: ",o.message]})]}),!n&&!o&&w.length===0&&S.jsx("div",{className:"py-12 text-muted-foreground",children:S.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&&S.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.map(b=>S.jsx(jj,{worktree:b,onDelete:v},b.path))})]})]})}function Gt(e,t="Assertion error"){if(!e)throw Error(t)}function $l({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 p_(e,t){return t.sort(e==="horizontal"?zj:Hj)}function zj(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Hj(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function dk(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 Vj({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}=dk(s,h),d=e==="horizontal"?a:l;d<u&&(u=d,o=h)}return Gt(o,"No rect found"),o}function fk(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=p_(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(),x=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),_=n==="horizontal"?new DOMRect(x.left,x.top,0,x.height):new DOMRect(x.left,x.top,x.width,0);switch(d.length){case 0:{C=[w,_];break}case 1:{const y=d[0],v=Vj({orientation:n,rects:[g,x],targetRect:y.element.getBoundingClientRect()});C=[y,v===g?_:w];break}default:{C=d;break}}}else d.length?C=d:C=[n==="horizontal"?new DOMRect(g.right,x.top,x.left-g.right,x.height):new DOMRect(x.left,g.bottom,x.width,x.top-g.bottom)];for(const w of C)h.push({group:e,groupSize:$l({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 Fj(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function Uj(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function Wj(e){return e/100*window.innerHeight}function qj(e){return e/100*window.innerWidth}function Gj(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 Jf({groupSize:e,panelElement:t,styleProp:n}){let s;const[o,u]=Gj(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=Uj(t,o);break}case"em":{s=Fj(t,o);break}case"vh":{s=Wj(o);break}case"vw":{s=qj(o);break}}return s}function bs(e){return parseFloat(e.toFixed(3))}function TC(e){const{panels:t}=e,n=$l({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=Jf({groupSize:n,panelElement:o,styleProp:u.collapsedSize});h=bs(p/n*100)}let a;if(u.defaultSize){const p=Jf({groupSize:n,panelElement:o,styleProp:u.defaultSize});a=bs(p/n*100)}let l=0;if(u.minSize){const p=Jf({groupSize:n,panelElement:o,styleProp:u.minSize});l=bs(p/n*100)}let d=100;if(u.maxSize){const p=Jf({groupSize:n,panelElement:o,styleProp:u.maxSize});d=bs(p/n*100)}return{collapsedSize:h,collapsible:u.collapsible===!0,defaultSize:a,minSize:l,maxSize:d,panelId:s.id}})}class $j{#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 ir(e,t,n=0){return Math.abs(bs(e)-bs(t))<=n}let Xr={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const _a=new $j;function $s(){return Xr}function is(e){const t=typeof e=="function"?e(Xr):e;if(Xr===t)return Xr;const n=Xr;return Xr={...Xr,...t},t.cursorFlags!==void 0&&_a.emit("cursorFlagsChange",Xr.cursorFlags),t.interactionState!==void 0&&_a.emit("interactionStateChange",Xr.interactionState),t.mountedGroups!==void 0&&(Xr.mountedGroups.forEach((s,o)=>{s.derivedPanelConstraints.forEach(u=>{if(u.collapsible){const{layout:h}=n.mountedGroups.get(o)??{};if(h){const a=ir(u.collapsedSize,s.layout[u.panelId]),l=ir(u.collapsedSize,h[u.panelId]);a&&!l&&(o.inMemoryLastExpandedPanelSizes[u.panelId]=h[u.panelId])}}})}),_a.emit("mountedGroupsChange",Xr.mountedGroups)),Xr}const Kj=e=>e,xv=()=>{},hk=1,pk=2,mk=4,gk=8,LC={coarse:10,precise:5};function Yj({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&hk)!==0,h=(e&pk)!==0,a=(e&mk)!==0,l=(e&gk)!==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 Sv,Os;function F0(){Os===void 0&&(Os=new CSSStyleSheet,document.adoptedStyleSheets=[Os]);const{cursorFlags:e,interactionState:t}=$s();switch(t.state){case"active":case"hover":{const n=Yj({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(Sv===s)return;Sv=s,n?Os.cssRules.length===0?Os.insertRule(s):Os.replaceSync(s):Os.cssRules.length===1&&Os.deleteRule(0);break}case"inactive":{Sv=void 0,Os.cssRules.length===1&&Os.deleteRule(0);break}}}function Xj(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 Vu(e,t){return ir(e,t)?0:e>t?1:-1}function El({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:s,maxSize:o=100,minSize:u=0}=e;if(Vu(t,u)<0)if(s){const h=(n+u)/2;Vu(t,h)<0?t=n:t=u}else t=u;return t=Math.min(o,t),t=bs(t),t}function Fu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:u}){if(ir(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:_=0,collapsible:y,minSize:v=0}=w;if(y){const b=h[C];if(Gt(b!=null,`Previous layout not found for panel index ${C}`),ir(b,_)){const E=v-b;Vu(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:_=0,collapsible:y,minSize:v=0}=w;if(y){const b=h[C];if(Gt(b!=null,`Previous layout not found for panel index ${C}`),ir(b,v)){const E=b-_;Vu(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}}{const C=e<0?1:-1;let w=e<0?p:d,_=0;for(;;){const v=h[w];Gt(v!=null,`Previous layout not found for panel index ${w}`);const b=El({panelConstraints:n[w],size:100})-v;if(_+=b,w+=C,w<0||w>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(_));e=e<0?0-y:y}{let C=e<0?d:p;for(;C>=0&&C<n.length;){const w=Math.abs(e)-Math.abs(f),_=h[C];Gt(_!=null,`Previous layout not found for panel index ${C}`);const y=_-w,v=El({panelConstraints:n[C],size:y});if(!ir(_,v)&&(f+=_-v,l[C]=v,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?C--:C++}}if(Xj(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 _=w+f,y=El({panelConstraints:n[C],size:_});if(l[C]=y,!ir(y,_)){let v=_-y,b=e<0?p:d;for(;b>=0&&b<n.length;){const E=l[b];Gt(E!=null,`Previous layout not found for panel index ${b}`);const T=E+v,A=El({panelConstraints:n[b],size:T});if(ir(E,A)||(v-=A-E,l[b]=A),ir(v,0))break;e>0?b--:b++}}}const g=Object.values(l).reduce((C,w)=>w+C,0);if(!ir(g,100,.1))return o;const x=Object.keys(o);return l.reduce((C,w,_)=>(C[x[_]]=w,C),{})}function pc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Vu(e[n],t[n])!==0)return!1;return!0}function vk({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 x=0;o?f==="horizontal"?x=(e.clientX-o.x)/d*100:x=(e.clientY-o.y)/d*100:f==="horizontal"?x=e.clientX<0?-100:100:x=e.clientY<0?-100:100;const C=n.get(l),{defaultLayoutDeferred:w,derivedPanelConstraints:_,layout:y,separatorToPanels:v}=s.get(l)??{defaultLayoutDeferred:!1};if(_&&C&&y&&v){const b=Fu({delta:x,initialLayout:C,panelConstraints:_,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:y,trigger:"mouse-or-touch"});if(pc(b,y)){if(x!==0&&!p)switch(f){case"horizontal":{u|=x<0?hk:pk;break}case"vertical":{u|=x<0?mk:gk;break}}}else{h.set(a.group,{defaultLayoutDeferred:w,derivedPanelConstraints:_,layout:b,separatorToPanels:v});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=b}}}),is({cursorFlags:u,mountedGroups:h}),F0()}function AC(e){if(e.defaultPrevented||e.relatedTarget!==null||e.clientX===0&&e.clientY===0)return;const{interactionState:t,mountedGroups:n}=$s();t.state==="active"&&t.hitRegions.forEach(s=>{e.currentTarget===s.group.element&&vk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})})}function hh(e){const t=e.parentElement;Gt(t,"Parent group element not found");const{mountedGroups:n}=$s();for(const[s]of n)if(s.element===t)return s;throw Error("Could not find parent Group for separator element")}function Ra({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(!ir(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=El({panelConstraints:t[h],size:a});a!=l&&(o+=a-l,n[h]=l)}if(!ir(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=El({panelConstraints:t[h],size:l});if(a!==d&&(o-=d-a,n[h]=d,ir(o,0)))break}const u=Object.keys(e);return n.reduce((h,a,l)=>(h[u[l]]=a,h),{})}function _k({groupId:e}){const t=()=>{const{mountedGroups:n}=$s();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=Ra({layout:n,panelConstraints:o});return s?h:(pc(h,l)||is(d=>({mountedGroups:new Map(d.mountedGroups).set(u,{defaultLayoutDeferred:s,derivedPanelConstraints:o,layout:l,separatorToPanels:a})})),l)}}}function yk(e){const{mountedGroups:t}=$s(),n=t.get(e);return Gt(n,`Mounted Group ${e.id} not found`),n}function $o(e,t){const n=hh(e),s=yk(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=_k({groupId:n.id}).getLayout(),l=Fu({delta:t,initialLayout:a,panelConstraints:s.derivedPanelConstraints,pivotIndices:h,prevLayout:a,trigger:"keyboard"}),d=Ra({layout:l,panelConstraints:s.derivedPanelConstraints});pc(a,d)||is(p=>({mountedGroups:new Map(p.mountedGroups).set(n,{defaultLayoutDeferred:s.defaultLayoutDeferred,derivedPanelConstraints:s.derivedPanelConstraints,layout:d,separatorToPanels:s.separatorToPanels})}))}function OC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=hh(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&$o(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&$o(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&$o(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&$o(t,-5);break}case"End":{e.preventDefault(),$o(t,100);break}case"Enter":{e.preventDefault();const s=hh(t),{derivedPanelConstraints:o,layout:u,separatorToPanels:h}=yk(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;$o(t,g-f)}break}case"F6":{e.preventDefault();const s=hh(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(),$o(t,-100);break}}}function Qj(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=dk(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 eh;function Zj(){return eh===void 0&&(typeof matchMedia=="function"?eh=!!matchMedia("(pointer:coarse)").matches:eh=!1),eh}function Jj(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:PC(e),b:PC(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:DC(MC(n.a)),b:DC(MC(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 eN=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tN(e){const t=getComputedStyle(bk(e)??e).display;return t==="flex"||t==="inline-flex"}function nN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||tN(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"||eN.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function MC(e){let t=e.length;for(;t--;){const n=e[t];if(Gt(n,"Missing node"),nN(n))return n}return null}function DC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function PC(e){const t=[];for(;e;)t.push(e),e=bk(e);return t}function bk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function rN(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 sN({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(Jj(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(rN(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function xk(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=Zj()?LC.coarse:LC.precise,h=fk(o),a=Qj(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&sN({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function IC(e){if(e.defaultPrevented)return;const{mountedGroups:t}=$s(),n=xk(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)}),is({interactionState:{hitRegions:n,initialLayoutMap:h,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function jC(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=$s();switch(t.state){case"active":{if(e.type!=="pointerleave"&&e.buttons===0){is(s=>s.interactionState.state==="inactive"?s:{cursorFlags:0,interactionState:{state:"inactive"}});return}vk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=xk(e,n);s.length===0?t.state!=="inactive"&&is({interactionState:{state:"inactive"}}):is({interactionState:{hitRegions:s,state:"hover"}}),F0();break}}}function NC(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=$s();t.state==="active"&&(is({cursorFlags:0,interactionState:{state:"inactive"}}),F0())}function BC(e){let t=0,n=0;const s={};for(const u of e)if(u.defaultSize!==void 0){t++;const h=bs(u.defaultSize);n+=h,s[u.panelId]=h}else s[u.panelId]=void 0;const o=e.length-t;if(o!==0){const u=bs((100-n)/o);for(const h of e)h.defaultSize===void 0&&(s[h.panelId]=u)}return s}function iN(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=$l({group:e});o.onResize({asPercentage:bs(s.inlineSize/u*100),inPixels:s.inlineSize},o.id)}function oN(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 aN(e){let t=!0;const n=new Set,s=new Set,o=new ResizeObserver(x=>{for(const C of x){const{borderBoxSize:w,target:_}=C;if(_===e.element){if(t){if($l({group:e})===0)return;is(y=>{const v=y.mountedGroups.get(e);if(v){const b=TC(e),E=v.defaultLayoutDeferred?BC(b):v.layout,T=Ra({layout:E,panelConstraints:b});return!v.defaultLayoutDeferred&&pc(E,T)&&oN(v.derivedPanelConstraints,b)?y:{mountedGroups:new Map(y.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,layout:T,separatorToPanels:v.separatorToPanels})}}return y})}}else iN(e,_,w)}});o.observe(e.element),e.panels.forEach(x=>{Gt(!n.has(x.id),`Panel ids must be unique; id "${x.id}" was used more than once`),n.add(x.id),x.onResize&&o.observe(x.element)});const u=$l({group:e}),h=TC(e),a=e.panels.map(({id:x})=>x).join(",");let l=e.defaultLayout;l&&e.panels.length!==Object.keys(l).length&&(l=void 0);const d=e.inMemoryLayouts[a]??l??BC(h),p=Ra({layout:d,panelConstraints:h}),f=fk(e),g=is(x=>{const C=new Map;return f.forEach(w=>{w.separator&&C.set(w.separator,w.panels)}),{mountedGroups:new Map(x.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:h,layout:p,separatorToPanels:C})}});return e.element.addEventListener("pointerleave",AC),e.separators.forEach(x=>{Gt(!s.has(x.id),`Separator ids must be unique; id "${x.id}" was used more than once`),s.add(x.id),x.element.addEventListener("keydown",OC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",IC),window.addEventListener("pointermove",jC),window.addEventListener("pointerup",NC)),function(){t=!1;const x=is(C=>{const w=new Map(C.mountedGroups);return w.delete(e),{mountedGroups:w}});e.element.removeEventListener("pointerleave",AC),e.separators.forEach(C=>{C.element.removeEventListener("keydown",OC)}),x.mountedGroups.size===0&&(window.removeEventListener("pointerdown",IC),window.removeEventListener("pointermove",jC),window.removeEventListener("pointerup",NC)),o.disconnect()}}function U0(e){const t=k.useId();return`${e??t}`}const Na=typeof window<"u"?k.useLayoutEffect:k.useEffect;function W0(e){const t=k.useRef(e);return Na(()=>{t.current=e},[e]),k.useCallback(n=>t.current?.(n),[t])}function q0(...e){return W0(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function lN(e){const t=k.useRef({...e});return Na(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Sk="--react-resizable-panels--panel--pointer-events";function Ck(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 wk=k.createContext(null);function cN(e,t){const n=k.useRef({getLayout:()=>({}),setLayout:Kj});k.useImperativeHandle(t,()=>n.current,[]),Na(()=>{Object.assign(n.current,_k({groupId:e}))})}function uN({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=k.useRef({}),x=W0($=>{pc(g.current,$)||(g.current=$,l?.($))}),C=U0(a),[w,_]=k.useState(!1),[y,v]=k.useState(null),[b,E]=k.useState(n??{}),[T,A]=k.useState([]),[M,L]=k.useState([]),D=k.useRef({lastExpandedPanelSizes:{},layouts:{}}),H=q0(v,u);cN(C,h);const z=k.useMemo(()=>({id:C,orientation:d,registerPanel:$=>(A(V=>p_(d,[...V,$])),()=>{A(V=>V.filter(G=>G!==$))}),registerSeparator:$=>(L(V=>p_(d,[...V,$])),()=>{L(V=>V.filter(G=>G!==$))})}),[C,d]),q=lN({defaultLayout:n,disableCursor:s}),j=k.useRef(null);Na(()=>{if(y===null)return;const $={defaultLayout:q.defaultLayout,disableCursor:!!q.disableCursor,disabled:!!o,element:y,id:C,inMemoryLastExpandedPanelSizes:D.current.lastExpandedPanelSizes,inMemoryLayouts:D.current.layouts,orientation:d,panels:T,separators:M};j.current=$;const V=aN($),G=$s().mountedGroups.get($);if(G){const{defaultLayoutDeferred:B,derivedPanelConstraints:I,layout:W}=G;!B&&I.length>0&&(E(W),x?.(W))}const U=_a.addListener("interactionStateChange",B=>{B.state==="active"?_(B.hitRegions.some(I=>I.group===$)):_(!1)}),P=_a.addListener("mountedGroupsChange",B=>{const I=B.get($);if(I){const{defaultLayoutDeferred:W,derivedPanelConstraints:Y,layout:J}=I;if(W||Y.length===0)return;E(J),x?.(J)}});return()=>{j.current=null,V(),U(),P()}},[o,y,C,x,d,T,M,q]),k.useEffect(()=>{const $=j.current;$&&($.defaultLayout=n,$.disableCursor=!!s)});const K={[Sk]:w?"none":void 0};for(const $ in b){const V=Ck(C,$),G=b[$];K[V]=G}return S.jsx(wk.Provider,{value:z,children:S.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":C,id:C,ref:H,style:{...p,...K,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function G0(){const e=k.useContext(wk);return Gt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function dN({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=$s();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:x}=n(),C=f.panels.findIndex(v=>v.id===t),w=C===f.panels.length-1,_=Fu({delta:w?l-a:a-l,initialLayout:g,panelConstraints:p,pivotIndices:w?[C-1,C]:[C,C+1],prevLayout:g,trigger:"imperative-api"}),y=Ra({layout:_,panelConstraints:p});pc(g,y)||is(v=>({mountedGroups:new Map(v.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:y,separatorToPanels:x})}))};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&&ir(l,d)},resize:a=>{if(u()!==a){let l;switch(typeof a){case"number":{const{group:d}=n(),p=$l({group:d});l=bs(a/p*100);break}case"string":{l=parseFloat(a);break}}h(l)}}}}function fN(e,t){const{id:n}=G0(),s=k.useRef({collapse:xv,expand:xv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:xv});k.useImperativeHandle(t,()=>s.current,[]),Na(()=>{Object.assign(s.current,dN({groupId:n,panelId:e}))})}function hN({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 x=!!h,C=U0(h),[w,_]=k.useState(null),y=q0(_,u),{id:v,registerPanel:b}=G0(),E=d!==null,T=W0(M=>{d?.(M,h)});Na(()=>{if(w!==null)return b({element:w,id:C,idIsStable:x,onResize:E?T:void 0,panelConstraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:a,minSize:l}})},[n,s,o,w,E,C,x,a,l,T,b]),fN(C,p);const A=Ck(v,C);return S.jsx("div",{...g,"data-panel":!0,"data-testid":C,id:C,ref:y,style:{...pN,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${Sk})`},children:S.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const pN={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 mN({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=Ra({layout:Fu({delta:d-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=Ra({layout:Fu({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 gN({children:e,className:t,elementRef:n,id:s,style:o,...u}){const h=U0(s),[a,l]=k.useState({}),[d,p]=k.useState("inactive"),[f,g]=k.useState(null),x=q0(g,n),{id:C,orientation:w,registerSeparator:_}=G0(),y=w==="horizontal"?"vertical":"horizontal";return Na(()=>{if(f!==null){const v={element:f,id:h},b=_(v),E=_a.addListener("interactionStateChange",A=>{p(A.state!=="inactive"&&A.hitRegions.some(M=>M.separator===v)?A.state:"inactive")}),T=_a.addListener("mountedGroupsChange",A=>{A.forEach(({derivedPanelConstraints:M,layout:L,separatorToPanels:D},H)=>{if(H.id===C){const z=D.get(v);if(z){const q=z[0],j=H.panels.indexOf(q);l(mN({layout:L,panelConstraints:M,panelId:q.id,panelIndex:j}))}}})});return()=>{E(),T(),b()}}},[f,C,h,_]),S.jsx("div",{...u,"aria-controls":a.valueControls,"aria-orientation":y,"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:x,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}function Jo({className:e,direction:t,...n}){return S.jsx(uN,{"data-slot":"resizable-panel-group",orientation:t,className:ze("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function Jr({...e}){return S.jsx(hN,{"data-slot":"resizable-panel",...e})}function ea({withHandle:e,className:t,...n}){return S.jsx(gN,{"data-slot":"resizable-handle",className:ze("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&&S.jsx("div",{className:"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"})})}var Cv={exports:{}},zC;function vN(){return zC||(zC=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=l(9042),g=l(9924),x=l(844),C=l(4725),w=l(2585),_=l(3656);let y=a.AccessibilityManager=class extends x.Disposable{constructor(v,b,E,T){super(),this._terminal=v,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(`
|
|
22
|
+
`)))),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,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let b=0;b<v;b++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
|
|
23
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,b){this._liveRegionDebouncer.refresh(v,b,this._terminal.rows)}_renderRows(v,b){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=v;A<=b;A++){const M=E.lines.get(E.ydisp+A),L=[],D=M?.translateToString(!0,void 0,void 0,L)||"",H=(E.ydisp+A+1).toString(),z=this._rowElements[A];z&&(D.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=D,this._rowColumns.set(z,L)),z.setAttribute("aria-posinset",H),z.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,b){const E=v.target,T=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==T)return;let A,M;if(b===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),b===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(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.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:H})=>{const z=D instanceof Text?D.parentNode:D;let q=parseInt(z?.getAttribute("aria-posinset"),10)-1;if(isNaN(q))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(z);if(!j)return console.warn("columns is null. Race condition?"),null;let K=H<j.length?j[H]:j.slice(-1)[0]+1;return K>=this._terminal.cols&&(++q,K=0),{row:q,column:K}},M=A(b),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(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_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 v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=y=d([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],y)},3614:(h,a)=>{function l(g){return g.replace(/\r?\n/g,"\r")}function d(g,x){return x?"\x1B[200~"+g+"\x1B[201~":g}function p(g,x,C,w){g=d(g=l(g),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),x.value=""}function f(g,x,C){const w=C.getBoundingClientRect(),_=g.clientX-w.left-10,y=g.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${_}px`,x.style.top=`${y}px`,x.style.zIndex="1000",x.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,x){g.clipboardData&&g.clipboardData.setData("text/plain",x.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,x,C,w){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),x,C,w)},a.paste=p,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(g,x,C,w,_){f(g,x,C),_&&w.rightClickSelect(g),x.value=w.selectionText,x.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(y,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,b,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(y,v){return function(b,E){v(b,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=l(3656),g=l(8460),x=l(844),C=l(2585),w=l(4725);let _=a.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(y,v,b,E,T){super(),this._element=y,this._mouseService=v,this._renderService=b,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,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.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(y){this._lastMouseEvent=y;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const b=y.composedPath();for(let E=0;E<b.length;E++){const T=b[E];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,v){this._activeProviderReplies&&v||(this._activeProviderReplies?.forEach((E=>{E?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let b=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(E)&&(b=this._checkLinkProviderResult(E,y,b)):T.provideLinks(y.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),b=this._checkLinkProviderResult(E,y,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,v){const b=new Set;for(let E=0;E<v.size;E++){const T=v.get(E);if(T)for(let A=0;A<T.length;A++){const M=T[A],L=M.link.range.start.y<y?0:M.link.range.start.x,D=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let H=L;H<=D;H++){if(b.has(H)){T.splice(A--,1);break}b.add(H)}}}}_checkLinkProviderResult(y,v,b){if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(y);let T=!1;for(let A=0;A<y;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(T=!0);if(!T&&E){const A=E.find((M=>this._linkAtPosition(M.link,v)));A&&(b=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,v)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,v){this._currentLink&&this._lastMouseEvent&&(!y||!v||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(y.link,v)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+b.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(y,v,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(b,v.text)}_fireUnderlineEvent(y,v){const b=y.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(y,v,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(b,v.text)}_linkAtPosition(y,v){const b=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,T=v.y*this._bufferService.cols+v.x;return b<=T&&T<=E}_positionFromMouseEvent(y,v,b){const E=b.getCoords(y,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,v,b,E,T){return{x1:y,y1:v,x2:b,y2:E,cols:this._bufferService.cols,fg:T}}};a.Linkifier=_=d([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],_)},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,_,y,v){var b,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,_,y,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(_,y,T):b(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=l(511),g=l(2585);let x=a.OscLinkProvider=class{constructor(w,_,y){this._bufferService=w,this._optionsService=_,this._oscLinkService=y}provideLinks(w,_){const y=this._bufferService.buffer.lines.get(w-1);if(!y)return void _(void 0);const v=[],b=this._optionsService.rawOptions.linkHandler,E=new f.CellData,T=y.getTrimmedLength();let A=-1,M=-1,L=!1;for(let D=0;D<T;D++)if(M!==-1||y.hasContent(D)){if(y.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 H=this._oscLinkService.getLinkData(A)?.uri;if(H){const z={start:{x:M+1,y:w},end:{x:D+(L||D!==T-1?0:1),y:w}};let q=!1;if(!b?.allowNonHttpProtocols)try{const j=new URL(H);["http:","https:"].includes(j.protocol)||(q=!0)}catch{q=!0}q||v.push({text:H,range:z,activate:(j,K)=>b?b.activate(j,K,z):C(0,K),hover:(j,K)=>b?.hover?.(j,K,z),leave:(j,K)=>b?.leave?.(j,K,z)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=D,A=E.extended.urlId):(M=-1,A=-1)}}_(v)}};function C(w,_){if(confirm(`Do you want to navigate to ${_}?
|
|
24
|
+
|
|
25
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=x=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],x)},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),x=l(3730),C=l(1680),w=l(3107),_=l(5744),y=l(2950),v=l(1296),b=l(428),E=l(4269),T=l(5114),A=l(8934),M=l(3230),L=l(9312),D=l(4725),H=l(6731),z=l(8055),q=l(8969),j=l(8460),K=l(844),$=l(6114),V=l(8437),G=l(2584),U=l(7399),P=l(5941),B=l(9074),I=l(2585),W=l(5435),Y=l(4567),J=l(779);class Z extends q.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(X={}){super(X),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,se)=>this.refresh(F,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((F=>this._afterResize(F.cols,F.rows)))),this.register((0,K.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const F of X){let se,ne="";switch(F.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;"+F.index}switch(F.type){case 0:const re=z.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${ne};${(0,P.toRgbString)(re)}${G.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((oe=>oe.ansi[F.index]=z.channels.toColor(...F.color)));else{const oe=se;this._themeService.modifyColors((le=>le[oe]=z.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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(G.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 X=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(X);if(!F)return;const se=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,re=F.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",(F=>{this.hasSelection()&&(0,d.copyHandler)(F,this._selectionService)})));const X=F=>(0,d.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,p.addDisposableDomListener)(this.element,"paste",X)),$.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,d.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,d.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){if(!X)throw new Error("Terminal requires a parent element.");if(X.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=X.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"),X.appendChild(this.element);const F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.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),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),$.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,X.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(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.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(y.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(F);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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,F=this.element;function se(oe){const le=X._mouseService.getMouseReportCoords(oe,X.screenElement);if(!le)return!1;let _e,ve;switch(oe.overrideType||oe.type){case"mousemove":ve=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":ve=0,_e=oe.button<3?oe.button:3;break;case"mousedown":ve=1,_e=oe.button<3?oe.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(oe)===!1||X.viewport.getLinesScrolled(oe)===0)return!1;ve=oe.deltaY<0?0:1,_e=4;break;default:return!1}return!(ve===void 0||_e===void 0||_e>4)&&X.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:ve,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||(F.addEventListener("mousemove",re.mousemove),ne.mousemove=re.mousemove):(F.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&oe?ne.wheel||(F.addEventListener("wheel",re.wheel,{passive:!1}),ne.wheel=re.wheel):(F.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)(F,"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)(F,"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=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ve="";for(let he=0;he<Math.abs(le);he++)ve+=_e;return this.coreService.triggerDataEvent(ve,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(F,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(F,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(X,F){this._renderService?.refreshRows(X,F)}updateCursorStyle(X){this._selectionService?.shouldColumnSelect(X)?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(X,F,se=0){se===1?(super.scrollLines(X,F,se),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(X)}paste(X){(0,d.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,F,se){this._selectionService.setSelection(X,F,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(X,F){this._selectionService?.selectLines(X,F)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!F&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,U.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const ne=this.rows-1;return this.scrollLines(se.type===2?-ne:ne),this.cancel(X,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(se.cancel&&this.cancel(X,!0),!se.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==G.C0.ETX&&se.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,F){const se=X.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||X.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||X.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?se:se&&(!F.keyCode||F.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)F=X.charCode;else if(X.which===null||X.which===void 0)F=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;F=X.which}return!(!F||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=X.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(X),!0}return!1}resize(X,F){X!==this.cols||F!==this.rows?super.resize(X,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,F){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 X=1;X<this.rows;X++)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 X=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case W.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${se};${F}t`);break;case W.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(`${G.C0.ESC}[6;${re};${ne}t`)}}cancel(X,F){if(this.options.cancelEvents||F)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=Z},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,x=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const 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(y,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,b,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(y,v){return function(b,E){v(b,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=l(3656),g=l(4725),x=l(8460),C=l(844),w=l(2585);let _=a.Viewport=class extends C.Disposable{constructor(y,v,b,E,T,A,M,L){super(),this._viewportElement=y,this._scrollArea=v,this._bufferService=b,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 x.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(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 v=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==v&&(this._lastRecordedBufferHeight=v,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 v=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,v){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&b<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const v=this._getPixelsScrolled(y);return v!==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+v:this._smoothScrollState.target+=v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=v,this._bubbleScroll(y,v))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(y,v){let b,E="";const T=[],A=v??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=y;L<A;L++){const D=M.get(L);if(!D)continue;const H=M.get(L+1)?.isWrapped;if(E+=D.translateToString(!H),!H||L===M.length-1){const z=document.createElement("div");z.textContent=E,T.push(z),E.length>0&&(b=z),E=""}}return{bufferElements:T,cursorElement:b}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(v/=this._currentRowHeight+0,this._wheelPartialScroll+=v,v=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(y,v){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&v.altKey||b==="ctrl"&&v.ctrlKey||b==="shift"&&v.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const v=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(y,v))}};a.Viewport=_=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)],_)},3107:function(h,a,l){var d=this&&this.__decorate||function(w,_,y,v){var b,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,_,y,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(_,y,T):b(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=l(4725),g=l(844),x=l(2585);let C=a.BufferDecorationRenderer=class extends g.Disposable{constructor(w,_,y,v,b){super(),this._screenElement=w,this._bufferService=_,this._coreBrowserService=y,this._decorationService=v,this._renderService=b,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 _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",w?.options?.layer==="top"),_.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=w.options.x??0;return y&&y>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(w,_),_}_refreshStyle(w){const _=w.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let y=this._decorationElements.get(w);y||(y=this._createElement(w),w.element=y,this._decorationElements.set(w,y),this._container.appendChild(y),w.onDispose((()=>{this._decorationElements.delete(w),y.remove()}))),y.style.top=_*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(y)}}_refreshXPosition(w,_=w.element){if(!_)return;const y=w.options.x??0;(w.options.anchor||"left")==="right"?_.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=y?y*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,x.IBufferService),p(2,f.ICoreBrowserService),p(3,x.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(b,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(b,E,T,A);else for(var H=b.length-1;H>=0;H--)(M=b[H])&&(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(b,E){return function(T,A){E(T,A,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=l(5871),g=l(4725),x=l(844),C=l(2585),w={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let v=a.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,T,A,M,L,D){super(),this._viewportElement=b,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 H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.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 b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=b,_.center=E,_.right=b,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=_.left,y.right=_.left+_.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,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 b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(y[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),_[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||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=v=d([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,g.IRenderService),p(5,C.IOptionsService),p(6,g.ICoreBrowserService)],v)},2950:function(h,a,l){var d=this&&this.__decorate||function(w,_,y,v){var b,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,_,y,v);else for(var A=w.length-1;A>=0;A--)(b=w[A])&&(T=(E<3?b(T):E>3?b(_,y,T):b(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=l(4725),g=l(2585),x=l(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,_,y,v,b,E){this._textarea=w,this._compositionView=_,this._bufferService=y,this._optionsService=v,this._coreService=b,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 _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,y=_.replace(w,"");this._dataAlreadySent=y,_.length>w.length?this._coreService.triggerDataEvent(y,!0):_.length<w.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):_.length===w.length&&_!==w&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"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=b+"px",this._textarea.style.top=v+"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(),x=d.getComputedStyle(f),C=parseInt(x.getPropertyValue("padding-left")),w=parseInt(x.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,x,C,w,_,y){if(!C)return;const v=l(d,p,f);return v?(v[0]=Math.ceil((v[0]+(y?w/2:0))/w),v[1]=Math.ceil(v[1]/_),v[0]=Math.min(Math.max(v[0],1),g+(y?1:0)),v[1]=Math.min(Math.max(v[1],1),x),v):void 0}},9504:(h,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=l(2584);function p(_,y,v,b){const E=_-f(_,v),T=y-f(y,v),A=Math.abs(E-T)-(function(M,L,D){let H=0;const z=M-f(M,D),q=L-f(L,D);for(let j=0;j<Math.abs(z-q);j++){const K=g(M,L)==="A"?-1:1;D.buffer.lines.get(z+K*j)?.isWrapped&&H++}return H})(_,y,v);return w(A,C(g(_,y),b))}function f(_,y){let v=0,b=y.buffer.lines.get(_),E=b?.isWrapped;for(;E&&_>=0&&_<y.rows;)v++,b=y.buffer.lines.get(--_),E=b?.isWrapped;return v}function g(_,y){return _>y?"A":"B"}function x(_,y,v,b,E,T){let A=_,M=y,L="";for(;A!==v||M!==b;)A+=E?1:-1,E&&A>T.cols-1?(L+=T.buffer.translateBufferLineToString(M,!1,_,A),A=0,_=0,M++):!E&&A<0&&(L+=T.buffer.translateBufferLineToString(M,!1,0,_+1),A=T.cols-1,_=A,M--);return L+T.buffer.translateBufferLineToString(M,!1,_,A)}function C(_,y){const v=y?"O":"[";return d.C0.ESC+v+_}function w(_,y){_=Math.floor(_);let v="";for(let b=0;b<_;b++)v+=y;return v}a.moveToCellSequence=function(_,y,v,b){const E=v.buffer.x,T=v.buffer.y;if(!v.buffer.hasScrollback)return(function(L,D,H,z,q,j){return p(D,z,q,j).length===0?"":w(x(L,D,L,D-f(D,q),!1,q).length,C("D",j))})(E,T,0,y,v,b)+p(T,y,v,b)+(function(L,D,H,z,q,j){let K;K=p(D,z,q,j).length>0?z-f(z,q):D;const $=z,V=(function(G,U,P,B,I,W){let Y;return Y=p(P,B,I,W).length>0?B-f(B,I):U,G<P&&Y<=B||G>=P&&Y<B?"C":"D"})(L,D,H,z,q,j);return w(x(L,K,H,$,V==="C",q).length,C(V,j))})(E,T,_,y,v,b);let A;if(T===y)return A=E>_?"D":"C",w(Math.abs(E-_),C(A,b));A=T>y?"D":"C";const M=Math.abs(T-y);return w((function(L,D){return D.cols-L})(T>y?_:E,v)+(M-1)*v.cols+1+((T>y?E:_)-1),C(A,b))}},1296:function(h,a,l){var d=this&&this.__decorate||function(j,K,$,V){var G,U=arguments.length,P=U<3?K:V===null?V=Object.getOwnPropertyDescriptor(K,$):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(j,K,$,V);else for(var B=j.length-1;B>=0;B--)(G=j[B])&&(P=(U<3?G(P):U>3?G(K,$,P):G(K,$))||P);return U>3&&P&&Object.defineProperty(K,$,P),P},p=this&&this.__param||function(j,K){return function($,V){K($,V,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=l(3787),g=l(2550),x=l(2223),C=l(6171),w=l(6052),_=l(4725),y=l(8055),v=l(8460),b=l(844),E=l(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",D="xterm-focus",H="xterm-selection";let z=1,q=a.DomRenderer=class extends b.Disposable{constructor(j,K,$,V,G,U,P,B,I,W,Y,J,Z){super(),this._terminal=j,this._document=K,this._element=$,this._screenElement=V,this._viewportElement=G,this._helperContainer=U,this._linkifier2=P,this._charSizeService=I,this._optionsService=W,this._bufferService=Y,this._coreBrowserService=J,this._themeService=Z,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.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(H),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=B.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,b.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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${A} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${A} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,K+=`${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 $=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;K+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${V} { 50% { box-shadow: none; }}`,K+=`@keyframes ${G} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,K+=`${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 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: ${G} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[U,P]of j.ansi.entries())K+=`${this._terminalSelector} .${M}${U} { color: ${P.css}; }${this._terminalSelector} .${M}${U}.xterm-dim { color: ${y.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${L}${U} { background-color: ${P.css}; }`;K+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${L}${x.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,K){for(let $=this._rowElements.length;$<=K;$++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,K){this._refreshRowElements(j,K),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(j,K,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,K,$),this.renderRows(0,this._bufferService.rows-1),!j||!K)return;this._selectionRenderModel.update(this._terminal,j,K,$);const V=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||P<0)return;const B=this._document.createDocumentFragment();if($){const I=j[0]>K[0];B.appendChild(this._createSelectionElement(U,I?K[0]:j[0],I?j[0]:K[0],P-U+1))}else{const I=V===U?j[0]:0,W=U===G?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(U,I,W));const Y=P-U-1;if(B.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,Y)),U!==P){const J=G===P?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(P,0,J))}}this._selectionContainer.appendChild(B)}_createSelectionElement(j,K,$,V=1){const G=this._document.createElement("div"),U=K*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*($-K);return U+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-U),G.style.height=V*this.dimensions.css.cell.height+"px",G.style.top=j*this.dimensions.css.cell.height+"px",G.style.left=`${U}px`,G.style.width=`${P}px`,G}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 j of this._rowElements)j.replaceChildren()}renderRows(j,K){const $=this._bufferService.buffer,V=$.ybase+$.y,G=Math.min($.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=j;I<=K;I++){const W=I+$.ydisp,Y=this._rowElements[I],J=$.lines.get(W);if(!Y||!J)break;Y.replaceChildren(...this._rowFactory.createRow(J,W,W===V,P,B,G,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,K,$,V,G,U){$<0&&(j=0),V<0&&(K=0);const P=this._bufferService.rows-1;$=Math.max(Math.min($,P),0),V=Math.max(Math.min(V,P),0),G=Math.min(G,this._bufferService.cols);const B=this._bufferService.buffer,I=B.ybase+B.y,W=Math.min(B.x,G-1),Y=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=$;ee<=V;++ee){const X=ee+B.ydisp,F=this._rowElements[ee],se=B.lines.get(X);if(!F||!se)break;F.replaceChildren(...this._rowFactory.createRow(se,X,X===I,J,Z,W,Y,this.dimensions.css.cell.width,this._widthCache,U?ee===$?j:0:-1,U?(ee===V?K:G)-1:-1))}}};a.DomRenderer=q=d([p(7,E.IInstantiationService),p(8,_.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,_.ICoreBrowserService),p(12,_.IThemeService)],q)},3787:function(h,a,l){var d=this&&this.__decorate||function(A,M,L,D){var H,z=arguments.length,q=z<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(A,M,L,D);else for(var j=A.length-1;j>=0;j--)(H=A[j])&&(q=(z<3?H(q):z>3?H(M,L,q):H(M,L))||q);return z>3&&q&&Object.defineProperty(M,L,q),q},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),x=l(511),C=l(2585),w=l(8055),_=l(4725),y=l(4269),v=l(6171),b=l(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,D,H,z,q){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=D,this._coreService=H,this._decorationService=z,this._themeService=q,this._workCell=new x.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,H,z,q,j,K,$,V){const G=[],U=this._characterJoinerService.getJoinedCharacters(M),P=this._themeService.colors;let B,I=A.getNoBgTrimmedLength();L&&I<z+1&&(I=z+1);let W=0,Y="",J=0,Z=0,ee=0,X=!1,F=0,se=!1,ne=0;const re=[],oe=$!==-1&&V!==-1;for(let le=0;le<I;le++){A.loadCell(le,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let ve=!1,he=le,ue=this._workCell;if(U.length>0&&le===U[0][0]){ve=!0;const Ce=U.shift();ue=new y.JoinedCellData(this._workCell,A.translateToString(!0,Ce[0],Ce[1]),Ce[1]-Ce[0]),he=Ce[1]-1,_e=ue.getWidth()}const Ie=this._isCellInSelection(le,M),Me=L&&le===z,Ae=oe&&le>=$&&le<=V;let be=!1;this._decorationService.forEachDecorationAtCell(le,M,void 0,(Ce=>{be=!0}));let Oe=ue.getChars()||g.WHITESPACE_CELL_CHAR;if(Oe===" "&&(ue.isUnderline()||ue.isOverline())&&(Oe=" "),ne=_e*j-K.get(Oe,ue.isBold(),ue.isItalic()),B){if(W&&(Ie&&se||!Ie&&!se&&ue.bg===J)&&(Ie&&se&&P.selectionForeground||ue.fg===Z)&&ue.extended.ext===ee&&Ae===X&&ne===F&&!Me&&!ve&&!be){ue.isInvisible()?Y+=g.WHITESPACE_CELL_CHAR:Y+=Oe,W++;continue}W&&(B.textContent=Y),B=this._document.createElement("span"),W=0,Y=""}else B=this._document.createElement("span");if(J=ue.bg,Z=ue.fg,ee=ue.extended.ext,X=Ae,F=ne,se=Ie,ve&&z>=le&&z<=he&&(z=le),!this._coreService.isCursorHidden&&Me&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&re.push("xterm-cursor-blink"),re.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){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(ue.isBold()&&re.push("xterm-bold"),ue.isItalic()&&re.push("xterm-italic"),ue.isDim()&&re.push("xterm-dim"),Y=ue.isInvisible()?g.WHITESPACE_CELL_CHAR:ue.getChars()||g.WHITESPACE_CELL_CHAR,ue.isUnderline()&&(re.push(`xterm-underline-${ue.extended.underlineStyle}`),Y===" "&&(Y=" "),!ue.isUnderlineColorDefault()))if(ue.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(ue.getUnderlineColor()).join(",")})`;else{let Ce=ue.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ue.isBold()&&Ce<8&&(Ce+=8),B.style.textDecorationColor=P.ansi[Ce].css}ue.isOverline()&&(re.push("xterm-overline"),Y===" "&&(Y=" ")),ue.isStrikethrough()&&re.push("xterm-strikethrough"),Ae&&(B.style.textDecoration="underline");let me=ue.getFgColor(),de=ue.getFgColorMode(),xe=ue.getBgColor(),We=ue.getBgColorMode();const nt=!!ue.isInverse();if(nt){const Ce=me;me=xe,xe=Ce;const Be=de;de=We,We=Be}let Ve,rt,Je,dt=!1;switch(this._decorationService.forEachDecorationAtCell(le,M,void 0,(Ce=>{Ce.options.layer!=="top"&&dt||(Ce.backgroundColorRGB&&(We=50331648,xe=Ce.backgroundColorRGB.rgba>>8&16777215,Ve=Ce.backgroundColorRGB),Ce.foregroundColorRGB&&(de=50331648,me=Ce.foregroundColorRGB.rgba>>8&16777215,rt=Ce.foregroundColorRGB),dt=Ce.options.layer==="top")})),!dt&&Ie&&(Ve=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,xe=Ve.rgba>>8&16777215,We=50331648,dt=!0,P.selectionForeground&&(de=50331648,me=P.selectionForeground.rgba>>8&16777215,rt=P.selectionForeground)),dt&&re.push("xterm-decoration-top"),We){case 16777216:case 33554432:Je=P.ansi[xe],re.push(`xterm-bg-${xe}`);break;case 50331648:Je=w.channels.toColor(xe>>16,xe>>8&255,255&xe),this._addStyle(B,`background-color:#${T((xe>>>0).toString(16),"0",6)}`);break;default:nt?(Je=P.foreground,re.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):Je=P.background}switch(Ve||ue.isDim()&&(Ve=w.color.multiplyOpacity(Je,.5)),de){case 16777216:case 33554432:ue.isBold()&&me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(me+=8),this._applyMinimumContrast(B,Je,P.ansi[me],ue,Ve,void 0)||re.push(`xterm-fg-${me}`);break;case 50331648:const Ce=w.channels.toColor(me>>16&255,me>>8&255,255&me);this._applyMinimumContrast(B,Je,Ce,ue,Ve,rt)||this._addStyle(B,`color:#${T(me.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Je,P.foreground,ue,Ve,rt)||nt&&re.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}re.length&&(B.className=re.join(" "),re.length=0),Me||ve||be?B.textContent=Y:W++,ne!==this.defaultSpacing&&(B.style.letterSpacing=`${ne}px`),G.push(B),le=he}return B&&W&&(B.textContent=Y),G}_applyMinimumContrast(A,M,L,D,H,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const q=this._getContrastCache(D);let j;if(H||z||(j=q.getColor(M.rgba,L.rgba)),j===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);j=w.color.ensureContrastRatio(H||M,z||L,K),q.setColor((H||M).rgba,(z||L).rgba,j??null)}return!!j&&(this._addStyle(A,`color:${j.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,_.ICharacterJoinerService),p(2,C.IOptionsService),p(3,_.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,_.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 x=l.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[p,f,g,x],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(x),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 x=this._holey.get(g);if(x===void 0){let C=0;d&&(C|=1),p&&(C|=2),x=this._measure(l,C),x>0&&this._holey.set(g,x)}return x}_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,x){return f===1&&g>Math.ceil(1.5*x)&&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,x=!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,_=g[1]-C,y=Math.max(w,0),v=Math.min(_,p.rows-1);y>=p.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=_,this.viewportCappedStartRow=y,this.viewportCappedEndRow=v,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(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=l(2585),g=l(8460),x=l(844);let C=a.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,b,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 y(this._optionsService))}catch{this._measureStrategy=this.register(new _(v,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([p(2,f.IOptionsService)],C);class w extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class _ extends w{constructor(b,E,T){super(),this._document=b,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 y extends w{constructor(b){super(),this._optionsService=b,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 b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(h,a,l){var d=this&&this.__decorate||function(y,v,b,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,b,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,b,M):T(v,b))||M);return A>3&&M&&Object.defineProperty(v,b,M),M},p=this&&this.__param||function(y,v){return function(b,E){v(b,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=l(3734),g=l(643),x=l(511),C=l(2585);class w extends f.AttributeData{constructor(v,b,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(v){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let _=a.CharacterJoinerService=class Ek{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(v){const b={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(b),b.id}deregister(v){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===v)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(v);if(!b||b.length===0)return[];const E=[],T=b.translateToString(!0);let A=0,M=0,L=0,D=b.getFg(0),H=b.getBg(0);for(let z=0;z<b.getTrimmedLength();z++)if(b.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==H){if(z-A>1){const q=this._getJoinedRanges(T,L,M,b,A);for(let j=0;j<q.length;j++)E.push(q[j])}A=z,L=M,D=this._workCell.fg,H=this._workCell.bg}M+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const z=this._getJoinedRanges(T,L,M,b,A);for(let q=0;q<z.length;q++)E.push(z[q])}return E}_getJoinedRanges(v,b,E,T,A){const M=v.substring(b,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 H=this._characterJoiners[D].handler(M);for(let z=0;z<H.length;z++)Ek._mergeRanges(L,H[z])}catch(H){console.error(H)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(v,b,E){let T=0,A=!1,M=0,L=v[T];if(L){for(let D=E;D<this._bufferService.cols;D++){const H=b.getWidth(D),z=b.getString(D).length||g.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!A&&L[0]<=M&&(L[0]=D,A=!0),L[1]<=M){if(L[1]=D,L=v[++T],!L)break;L[0]<=M?(L[0]=D,A=!0):A=!1}M+=z}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(v,b){let E=!1;for(let T=0;T<v.length;T++){const A=v[T];if(E){if(b[1]<=A[0])return v[T-1][1]=b[1],v;if(b[1]<=A[1])return v[T-1][1]=Math.max(b[1],A[1]),v.splice(T,1),v;v.splice(T,1),T--}else{if(b[1]<=A[0])return v.splice(T,0,b),v;if(b[1]<=A[1])return A[0]=Math.min(b[0],A[0]),v;b[0]<A[1]&&(A[0]=Math.min(b[0],A[0]),E=!0)}}return E?v[v.length-1][1]=b[1]:v.push(b),v}};a.CharacterJoinerService=_=d([p(0,C.IBufferService)],_)},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,_,y){super(),this._textarea=w,this._window=_,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),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 x 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 x=this.linkProviders.indexOf(g);x!==-1&&this.linkProviders.splice(x,1)}}}}a.LinkProviderService=p},8934:function(h,a,l){var d=this&&this.__decorate||function(C,w,_,y){var v,b=arguments.length,E=b<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,_,y);else for(var T=C.length-1;T>=0;T--)(v=C[T])&&(E=(b<3?v(E):b>3?v(w,_,E):v(w,_))||E);return b>3&&E&&Object.defineProperty(w,_,E),E},p=this&&this.__param||function(C,w){return function(_,y){w(_,y,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=l(4725),g=l(9806);let x=a.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,_,y,v){return(0,g.getCoords)(window,C,w,_,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(C,w){const _=(0,g.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};a.MouseService=x=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],x)},3230:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=l(6193),g=l(4725),x=l(8460),C=l(844),w=l(7226),_=l(2585);let y=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,b,E,T,A,M,L,D){super(),this._rowCount=v,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((H,z)=>this._renderRows(H,z)),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,b),this.register(L.onWindowChange((H=>this._registerIntersectionObserver(H,b))))}_registerIntersectionObserver(v,b){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.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(v,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,b,this._rowCount))}_renderRows(v,b){this._renderer.value&&(v=Math.min(v,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(v,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:b}),this._onRender.fire({start:v,end:b}),this._isNextRenderRedrawOnly=!0)}resize(v,b){this._rowCount=b,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(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_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(v,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(v,b))):this._renderer.value.handleResize(v,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(v,b,E){this._selectionState.start=v,this._selectionState.end=b,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(v,b,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};a.RenderService=y=d([p(2,_.IOptionsService),p(3,g.ICharSizeService),p(4,_.IDecorationService),p(5,_.IBufferService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],y)},9312:function(h,a,l){var d=this&&this.__decorate||function(L,D,H,z){var q,j=arguments.length,K=j<3?D:z===null?z=Object.getOwnPropertyDescriptor(D,H):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(L,D,H,z);else for(var $=L.length-1;$>=0;$--)(q=L[$])&&(K=(j<3?q(K):j>3?q(D,H,K):q(D,H))||K);return j>3&&K&&Object.defineProperty(D,H,K),K},p=this&&this.__param||function(L,D){return function(H,z){D(H,z,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=l(9806),g=l(9504),x=l(456),C=l(4725),w=l(8460),_=l(844),y=l(6114),v=l(4841),b=l(511),E=l(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends _.Disposable{constructor(L,D,H,z,q,j,K,$,V){super(),this._element=L,this._screenElement=D,this._linkifier=H,this._bufferService=z,this._coreService=q,this._mouseService=j,this._optionsService=K,this._renderService=$,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.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=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((G=>this._handleTrim(G))),this.register(this._bufferService.buffers.onBufferActivate((G=>this._handleBufferActivate(G)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.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 H=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(L[0]===D[0])return"";const q=L[0]<D[0]?L[0]:D[0],j=L[0]<D[0]?D[0]:L[0];for(let K=L[1];K<=D[1];K++){const $=H.translateBufferLineToString(K,!0,q,j);z.push($)}}else{const q=L[1]===D[1]?D[0]:void 0;z.push(H.translateBufferLineToString(L[1],!0,L[0],q));for(let j=L[1]+1;j<=D[1]-1;j++){const K=H.lines.get(j),$=H.translateBufferLineToString(j,!0);K?.isWrapped?z[z.length-1]+=$:z.push($)}if(L[1]!==D[1]){const j=H.lines.get(D[1]),K=H.translateBufferLineToString(D[1],!0,0,D[0]);j&&j.isWrapped?z[z.length-1]+=K:z.push(K)}}return z.map((q=>q.replace(A," "))).join(y.isWindows?`\r
|
|
26
|
+
`:`
|
|
27
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.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),H=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(H&&z&&D)&&this._areCoordsInSelection(D,H,z)}isCellInSelection(L,D){const H=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!H||!z)&&this._areCoordsInSelection([L,D],H,z)}_areCoordsInSelection(L,D,H){return L[1]>D[1]&&L[1]<H[1]||D[1]===H[1]&&L[1]===D[1]&&L[0]>=D[0]&&L[0]<H[0]||D[1]<H[1]&&L[1]===H[1]&&L[0]<H[0]||D[1]<H[1]&&L[1]===D[1]&&L[0]>=D[0]}_selectWordAtCursor(L,D){const H=this._linkifier.currentLink?.link?.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(L);return!!z&&(this._selectWordAt(z,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 H=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=H?0:(D>H&&(D-=H),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(L){return y.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&&!(y.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 H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const z=H.lines.get(this._model.selectionEnd[1]);z&&z.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 H=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const z=(0,g.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,H=!(!L||!D||L[0]===D[0]&&L[1]===D[1]);H?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,H)):this._oldHasSelection&&this._fireOnSelectionChange(L,D,H)}_fireOnSelectionChange(L,D,H){this._oldSelectionStart=L,this._oldSelectionEnd=D,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(L,D){let H=D;for(let z=0;D>=z;z++){const q=L.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:q>1&&D!==z&&(H+=q-1)}return H}setSelection(L,D,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,D],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,D,H=!0,z=!0){if(L[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,j=q.lines.get(L[1]);if(!j)return;const K=q.translateBufferLineToString(L[1],!1);let $=this._convertViewportColToCharacterIndex(j,L[0]),V=$;const G=L[0]-$;let U=0,P=0,B=0,I=0;if(K.charAt($)===" "){for(;$>0&&K.charAt($-1)===" ";)$--;for(;V<K.length&&K.charAt(V+1)===" ";)V++}else{let J=L[0],Z=L[0];j.getWidth(J)===0&&(U++,J--),j.getWidth(Z)===2&&(P++,Z++);const ee=j.getString(Z).length;for(ee>1&&(I+=ee-1,V+=ee-1);J>0&&$>0&&!this._isCharWordSeparator(j.loadCell(J-1,this._workCell));){j.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,J--):X>1&&(B+=X-1,$-=X-1),$--,J--}for(;Z<j.length&&V+1<K.length&&!this._isCharWordSeparator(j.loadCell(Z+1,this._workCell));){j.loadCell(Z+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,Z++):X>1&&(I+=X-1,V+=X-1),V++,Z++}}V++;let W=$+G-U+B,Y=Math.min(this._bufferService.cols,V-$+U+P-B-I);if(D||K.slice($,V).trim()!==""){if(H&&W===0&&j.getCodePoint(0)!==32){const J=q.lines.get(L[1]-1);if(J&&j.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(Z){const ee=this._bufferService.cols-Z.start;W-=ee,Y+=ee}}}if(z&&W+Y===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const J=q.lines.get(L[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const Z=this._getWordAt([0,L[1]+1],!1,!1,!0);Z&&(Y+=Z.length)}}return{start:W,length:Y}}}_selectWordAt(L,D){const H=this._getWordAt(L,D);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[H.start,L[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(L){const D=this._getWordAt(L,!0);if(D){let H=L[1];for(;D.start<0;)D.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,H]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const D=this._bufferService.buffer.getWrappedRangeForLine(L),H={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,v.getRangeLength)(H,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,H){var z,q=arguments.length,j=q<3?L:H===null?H=Object.getOwnPropertyDescriptor(L,D):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,L,D,H);else for(var K=M.length-1;K>=0;K--)(z=M[K])&&(j=(q<3?z(j):q>3?z(L,D,j):z(L,D))||j);return q>3&&j&&Object.defineProperty(L,D,j),j},p=this&&this.__param||function(M,L){return function(D,H){L(D,H,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=l(7239),g=l(8055),x=l(8460),C=l(844),w=l(2585),_=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),b=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 H=L[D/36%6|0],z=L[D/6%6|0],q=L[D%6];M.push({css:g.channels.toCss(H,z,q),rgba:g.channels.toRgba(H,z,q)})}for(let D=0;D<24;D++){const H=8+10*D;M.push({css:g.channels.toCss(H,H,H),rgba:g.channels.toRgba(H,H,H)})}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 x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:y,cursor:v,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:g.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:g.color.blend(y,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,_),L.background=A(M.background,y),L.cursor=A(M.cursor,v),L.cursorAccent=A(M.cursorAccent,b),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 H=0;H<D;H++)L.ansi[H+16]=A(M.extendedAnsi[H],a.DEFAULT_ANSI_COLORS[H+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(x){super(),this._maxLength=x,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(x){if(this._maxLength===x)return;const C=new Array(x);for(let w=0;w<Math.min(x,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...w){if(C){for(let _=x;_<this._length-C;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let _=this._length-1;_>=x;_--)this._array[this._getCyclicIndex(_+w.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<w.length;_++)this._array[this._getCyclicIndex(x+_)]=w[_];if(w.length&&this.onInsertEmitter.fire({index:x,amount:w.length}),this._length+w.length>this._maxLength){const _=this._length+w.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=w.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,w){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let y=C-1;y>=0;y--)this.set(x+y+w,this.get(x+y));const _=x+C+w-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<C;_++)this.set(x+_+w,this.get(x+_))}}_getCyclicIndex(x){return(this._startIndex+x)%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,x,C,w,_;function y(b){const E=b.toString(16);return E.length<2?"0"+E:E}function v(b,E){return b<E?(E+.05)/(b+.05):(b+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(E,T,A,M){return M!==void 0?`#${y(E)}${y(T)}${y(A)}${y(M)}`:`#${y(E)}${y(T)}${y(A)}`},b.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},b.toColor=function(E,T,A,M){return{css:b.toCss(E,T,A,M),rgba:b.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(b){function E(T,A){return f=Math.round(255*A),[l,d,p]=_.toChannels(T.rgba),{css:g.toCss(l,d,p,f),rgba:g.toRgba(l,d,p,f)}}b.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,H=T.rgba>>24&255,z=T.rgba>>16&255,q=T.rgba>>8&255;return l=H+Math.round((M-H)*f),d=z+Math.round((L-z)*f),p=q+Math.round((D-q)*f),{css:g.toCss(l,d,p),rgba:g.toRgba(l,d,p)}},b.isOpaque=function(T){return(255&T.rgba)==255},b.ensureContrastRatio=function(T,A,M){const L=_.ensureContrastRatio(T.rgba,A.rgba,M);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},b.opaque=function(T){const A=(255|T.rgba)>>>0;return[l,d,p]=_.toChannels(A),{css:g.toCss(l,d,p),rgba:A}},b.opacity=E,b.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},b.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(x||(a.color=x={})),(function(b){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{}b.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(b){function E(T,A,M){const L=T/255,D=A/255,H=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*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}b.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},b.relativeLuminance2=E})(w||(a.rgb=w={})),(function(b){function E(A,M,L){const D=A>>24&255,H=A>>16&255,z=A>>8&255;let q=M>>24&255,j=M>>16&255,K=M>>8&255,$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));for(;$<L&&(q>0||j>0||K>0);)q-=Math.max(0,Math.ceil(.1*q)),j-=Math.max(0,Math.ceil(.1*j)),K-=Math.max(0,Math.ceil(.1*K)),$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));return(q<<24|j<<16|K<<8|255)>>>0}function T(A,M,L){const D=A>>24&255,H=A>>16&255,z=A>>8&255;let q=M>>24&255,j=M>>16&255,K=M>>8&255,$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));for(;$<L&&(q<255||j<255||K<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),j=Math.min(255,j+Math.ceil(.1*(255-j))),K=Math.min(255,K+Math.ceil(.1*(255-K))),$=v(w.relativeLuminance2(q,j,K),w.relativeLuminance2(D,H,z));return(q<<24|j<<16|K<<8|255)>>>0}b.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,D=M>>16&255,H=M>>8&255,z=A>>24&255,q=A>>16&255,j=A>>8&255;return l=z+Math.round((L-z)*f),d=q+Math.round((D-q)*f),p=j+Math.round((H-j)*f),g.toRgba(l,d,p)},b.ensureContrastRatio=function(A,M,L){const D=w.relativeLuminance(A>>8),H=w.relativeLuminance(M>>8);if(v(D,H)<L){if(H<D){const j=E(A,M,L),K=v(D,w.relativeLuminance(j>>8));if(K<L){const $=T(A,M,L);return K>v(D,w.relativeLuminance($>>8))?j:$}return j}const z=T(A,M,L),q=v(D,w.relativeLuminance(z>>8));if(q<L){const j=E(A,M,L);return q>v(D,w.relativeLuminance(j>>8))?z:j}return z}},b.reduceLuminance=E,b.increaseLuminance=T,b.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(_||(a.rgba=_={})),a.toPaddedHex=y,a.contrastRatio=v},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),x=l(744),C=l(7302),w=l(6975),_=l(8460),y=l(1753),v=l(1480),b=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 _.EventEmitter),this._onScroll.event((z=>{this._onScrollApi?.fire(z.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(z){for(const q in z)this.optionsService.options[q]=z[q]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(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(y.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.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,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.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((q=>{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((q=>{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(((q,j)=>this._inputHandler.parse(q,j)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,q){this._writeBuffer.write(z,q)}writeSync(z,q){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(z,q)}input(z,q=!0){this.coreService.triggerDataEvent(z,q)}resize(z,q){isNaN(z)||isNaN(q)||(z=Math.max(z,x.MINIMUM_COLS),q=Math.max(q,x.MINIMUM_ROWS),this._bufferService.resize(z,q))}scroll(z,q=!1){this._bufferService.scroll(z,q)}scrollLines(z,q,j){this._bufferService.scrollLines(z,q,j)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const q=z-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(z,q){return this._inputHandler.registerEscHandler(z,q)}registerDcsHandler(z,q){return this._inputHandler.registerDcsHandler(z,q)}registerCsiHandler(z,q){return this._inputHandler.registerCsiHandler(z,q)}registerOscHandler(z,q){return this._inputHandler.registerOscHandler(z,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?z=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const q of z)q.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(U,P,B,I){var W,Y=arguments.length,J=Y<3?P:I===null?I=Object.getOwnPropertyDescriptor(P,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(U,P,B,I);else for(var Z=U.length-1;Z>=0;Z--)(W=U[Z])&&(J=(Y<3?W(J):Y>3?W(P,B,J):W(P,B))||J);return Y>3&&J&&Object.defineProperty(P,B,J),J},p=this&&this.__param||function(U,P){return function(B,I){P(B,I,U)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=l(2584),g=l(7116),x=l(2015),C=l(844),w=l(482),_=l(8437),y=l(8460),v=l(643),b=l(511),E=l(3734),T=l(2585),A=l(1480),M=l(6242),L=l(6351),D=l(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function q(U,P){if(U>24)return P.setWinLines||!1;switch(U){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var j;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(a.WindowsOptionsReportType=j={}));let K=0;class $ extends C.Disposable{getAttrData(){return this._curAttrData}constructor(P,B,I,W,Y,J,Z,ee,X=new x.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=B,this._coreService=I,this._logService=W,this._optionsService=Y,this._oscLinkService=J,this._coreMouseService=Z,this._unicodeService=ee,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:se.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,se,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:se,data:ne})})),this._parser.setDcsHandlerFallback(((F,se,ne)=>{se==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:se,payload:ne})})),this._parser.setPrintHandler(((F,se,ne)=>this.print(F,se,ne))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!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((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new M.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new M.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new M.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new M.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new M.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new M.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new M.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new M.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new M.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new M.OscHandler((F=>this.restoreCursorColor(F)))),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 F in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((F,se)=>this.requestStatusString(F,se))))}_preserveStack(P,B,I,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=I,this._parseStack.position=W}_logSlowResolvingAsync(P){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([P,new Promise(((B,I)=>setTimeout((()=>I("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(P,B){let I,W=this._activeBuffer.x,Y=this._activeBuffer.y,J=0;const Z=this._parseStack.paused;if(Z){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(I),I;W=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>z&&(J=this._parseStack.position+z)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,(F=>String.fromCharCode(F))).join("")}"`),typeof P=="string"?P.split("").map((F=>F.charCodeAt(0))):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(P.length,z))),Z||this._dirtyRowTracker.clearRange(),P.length>z)for(let F=J;F<P.length;F+=z){const se=F+z<P.length?F+z:P.length,ne=typeof P=="string"?this._stringDecoder.decode(P.substring(F,se),this._parseBuffer):this._utf8Decoder.decode(P.subarray(F,se),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(W,Y,ne,F),this._logSlowResolvingAsync(I),I}else if(!Z){const F=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,F))return this._preserveStack(W,Y,F,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===W&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(P,B,I){let W,Y;const J=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,F=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&&I-B>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=B;oe<I;++oe){if(W=P[oe],W<127&&J){const he=J[String.fromCharCode(W)];he&&(W=he.charCodeAt(0))}const le=this._unicodeService.charProperties(W,re);Y=A.UnicodeService.extractWidth(le);const _e=A.UnicodeService.extractShouldJoin(le),ve=_e?A.UnicodeService.extractWidth(re):0;if(re=le,Z&&this._onA11yChar.fire((0,w.stringFromCodePoint)(W)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-ve>ee){if(X){const he=ne;let ue=this._activeBuffer.x-ve;for(this._activeBuffer.x=ve,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),ve>0&&ne instanceof _.BufferLine&&ne.copyCellsFrom(he,ue,0,ve,!1);ue<ee;)he.setCellFromCodepoint(ue++,0,1,se)}else if(this._activeBuffer.x=ee-1,Y===2)continue}if(_e&&this._activeBuffer.x){const he=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-he,W,Y);for(let ue=Y-ve;--ue>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(F&&(ne.insertCells(this._activeBuffer.x,Y-ve,this._activeBuffer.getNullCell(se)),ne.getWidth(ee-1)===2&&ne.setCellFromCodepoint(ee-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,se)),ne.setCellFromCodepoint(this._activeBuffer.x++,W,Y,se),Y>0)for(;--Y;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=re,this._activeBuffer.x<ee&&I-B>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(P,B){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,B):this._parser.registerCsiHandler(P,(I=>!q(I.params[0],this._optionsService.rawOptions.windowOptions)||B(I)))}registerDcsHandler(P,B){return this._parser.registerDcsHandler(P,new L.DcsHandler(B))}registerEscHandler(P,B){return this._parser.registerEscHandler(P,B)}registerOscHandler(P,B){return this._parser.registerOscHandler(P,new M.OscHandler(B))}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 P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,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(P,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=P,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+B)}cursorUp(P){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const B=P.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const B=P.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,B,I,W=!1,Y=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);J.replaceCells(B,I,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),W&&(J.isWrapped=!1)}_resetBufferLine(P,B=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),I.isWrapped=!1)}eraseInDisplay(P,B=!1){let I;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);I<this._bufferService.rows;I++)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(P,B=!1){switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-W+1;for(;B--;)this._activeBuffer.lines.splice(Y-1,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}deleteLines(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let W;for(W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-W;B--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let B=P.params[0]||1;for(;B--;)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(P){let B=P.params[0]||1;for(;B--;)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(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);W.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const B=this._parser.precedingJoinState;if(!B)return!0;const I=P.params[0]||1,W=A.UnicodeService.extractWidth(B),Y=this._activeBuffer.x-W,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),Z=new Uint32Array(J.length*I);let ee=0;for(let F=0;F<J.length;){const se=J.codePointAt(F)||0;Z[ee++]=se,F+=se>65535?2:1}let X=ee;for(let F=1;F<I;++F)Z.copyWithin(X,0,ee),X+=ee;return this.print(Z,0,X),!0}sendDeviceAttributesPrimary(P){return P.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(P){return P.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(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let B=0;B<P.length;B++)switch(P.params[B]){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(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let B=0;B<P.length;B++)switch(P.params[B]){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(),P.params[B]===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(P,B){const I=this._coreService.decPrivateModes,{activeProtocol:W,activeEncoding:Y}=this._coreMouseService,J=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:X,alt:F}=Z,se=this._optionsService.rawOptions,ne=_e=>_e?1:2,re=P.params[0];return oe=re,le=B?re===2?4:re===4?ne(J.modes.insertMode):re===12?3:re===20?ne(se.convertEol):0:re===1?ne(I.applicationCursorKeys):re===3?se.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:re===6?ne(I.origin):re===7?ne(I.wraparound):re===8?3:re===9?ne(W==="X10"):re===12?ne(se.cursorBlink):re===25?ne(!J.isCursorHidden):re===45?ne(I.reverseWraparound):re===66?ne(I.applicationKeypad):re===67?4:re===1e3?ne(W==="VT200"):re===1002?ne(W==="DRAG"):re===1003?ne(W==="ANY"):re===1004?ne(I.sendFocus):re===1005?4:re===1006?ne(Y==="SGR"):re===1015?4:re===1016?ne(Y==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?ne(X===F):re===2004?ne(I.bracketedPasteMode):0,J.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${oe};${le}$y`),!0;var oe,le}_updateAttrColor(P,B,I,W,Y){return B===2?(P|=50331648,P&=-16777216,P|=E.AttributeData.fromColorRGB([I,W,Y])):B===5&&(P&=-50331904,P|=33554432|255&I),P}_extractColor(P,B,I){const W=[0,0,-1,0,0,0];let Y=0,J=0;do{if(W[J+Y]=P.params[B+J],P.hasSubParams(B+J)){const Z=P.getSubParams(B+J);let ee=0;do W[1]===5&&(Y=1),W[J+ee+1+Y]=Z[ee];while(++ee<Z.length&&ee+J+1+Y<W.length);break}if(W[1]===5&&J+Y>=2||W[1]===2&&J+Y>=5)break;W[1]&&(Y=1)}while(++J+B<P.length&&J+Y<W.length);for(let Z=2;Z<W.length;++Z)W[Z]===-1&&(W[Z]=0);switch(W[0]){case 38:I.fg=this._updateAttrColor(I.fg,W[1],W[3],W[4],W[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,W[1],W[3],W[4],W[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,W[1],W[3],W[4],W[5])}return J}_processUnderline(P,B){B.extended=B.extended.clone(),(!~P||P>5)&&(P=1),B.extended.underlineStyle=P,B.fg|=268435456,P===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(P){P.fg=_.DEFAULT_ATTR_DATA.fg,P.bg=_.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=P.length;let I;const W=this._curAttrData;for(let Y=0;Y<B;Y++)I=P.params[Y],I>=30&&I<=37?(W.fg&=-50331904,W.fg|=16777216|I-30):I>=40&&I<=47?(W.bg&=-50331904,W.bg|=16777216|I-40):I>=90&&I<=97?(W.fg&=-50331904,W.fg|=16777224|I-90):I>=100&&I<=107?(W.bg&=-50331904,W.bg|=16777224|I-100):I===0?this._processSGR0(W):I===1?W.fg|=134217728:I===3?W.bg|=67108864:I===4?(W.fg|=268435456,this._processUnderline(P.hasSubParams(Y)?P.getSubParams(Y)[0]:1,W)):I===5?W.fg|=536870912:I===7?W.fg|=67108864:I===8?W.fg|=1073741824:I===9?W.fg|=2147483648:I===2?W.bg|=134217728:I===21?this._processUnderline(2,W):I===22?(W.fg&=-134217729,W.bg&=-134217729):I===23?W.bg&=-67108865:I===24?(W.fg&=-268435457,this._processUnderline(0,W)):I===25?W.fg&=-536870913:I===27?W.fg&=-67108865:I===28?W.fg&=-1073741825:I===29?W.fg&=2147483647:I===39?(W.fg&=-67108864,W.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):I===49?(W.bg&=-67108864,W.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?Y+=this._extractColor(P,Y,W):I===53?W.bg|=1073741824:I===55?W.bg&=-1073741825:I===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):I===100?(W.fg&=-67108864,W.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${I}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${I}R`)}return!0}softReset(P){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.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(P){const B=P.params[0]||1;switch(B){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 I=B%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(P){const B=P.params[0]||1;let I;return(P.length<2||(I=P.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(P){if(!q(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.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:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(P){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(P){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(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const B=[],I=P.split(";");for(;I.length>1;){const W=I.shift(),Y=I.shift();if(/^\d+$/.exec(W)){const J=parseInt(W);if(G(J))if(Y==="?")B.push({type:0,index:J});else{const Z=(0,D.parseColor)(Y);Z&&B.push({type:1,index:J,color:Z})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(P){const B=P.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(P,B){this._getCurrentLinkId()&&this._finishHyperlink();const I=P.split(":");let W;const Y=I.findIndex((J=>J.startsWith("id=")));return Y!==-1&&(W=I[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(P,B){const I=P.split(";");for(let W=0;W<I.length&&!(B>=this._specialColors.length);++W,++B)if(I[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Y=(0,D.parseColor)(I[W]);Y&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Y}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const B=[],I=P.split(";");for(let W=0;W<I.length;++W)if(/^\d+$/.exec(I[W])){const Y=parseInt(I[W]);G(Y)&&B.push({type:2,index:Y})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){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(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(H[P[0]],g.CHARSETS[P[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 P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,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=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new b.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const I=this._activeBuffer.ybase+this._activeBuffer.y+B,W=this._activeBuffer.lines.get(I);W&&(W.fill(P),W.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,B){const I=this._bufferService.buffer,W=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Y}${f.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,B){this._dirtyRowTracker.markRangeDirty(P,B)}}a.InputHandler=$;let V=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,P){U>P&&(K=U,U=P,P=K),U<this.start&&(this.start=U),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(U){return 0<=U&&U<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,x){this._data.get(d,p)||this._data.set(d,p,new l),this._data.get(d,p).set(f,g,x)}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 x=this._getKey(this._array[g]);if(x>d)f=g-1;else{if(!(x<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(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,w=0,_=x.timeRemaining(),y=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),y=x.timeRemaining(),1.5*w>y)return _-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-C))}ms`),void this._start();_=y}this.clear()}}class f extends p{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}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),x=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);x&&g&&(x.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),x=l(4634),C=l(511),w=l(643),_=l(4863),y=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,b,E){this._hasScrollback=v,this._optionsService=b,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=y.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(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,b){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const b=v+this._optionsService.rawOptions.scrollback;return b>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:b}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(v))}}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(v,b){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(b);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<v)for(let L=0;L<this.lines.length;L++)T+=+this.lines.get(L).resize(v,E);let M=0;if(this._rows<b)for(let L=this._rows;L<b;L++)this.lines.length<b+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(v,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(v,E)));else for(let L=this._rows;L>b;L--)this.lines.length>b+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,v-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(v,b),this._cols>v))for(let M=0;M<this.lines.length;M++)T+=+this.lines.get(M).resize(v,E);this._cols=v,this._rows=b,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,b){this._cols!==v&&(v>this._cols?this._reflowLarger(v,b):this._reflowSmaller(v,b))}_reflowLarger(v,b){const E=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,x.reflowLargerCreateNewLayout)(this.lines,E);(0,x.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(v,b,T.countRemoved)}}_reflowLargerAdjustViewport(v,b,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<b&&this.lines.push(new g.BufferLine(v,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,b){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()<=v)continue;const D=[L];for(;L.isWrapped&&M>0;)L=this.lines.get(--M),D.unshift(L);const H=this.ybase+this.y;if(H>=M&&H<M+D.length)continue;const z=D[D.length-1].getTrimmedLength(),q=(0,x.reflowSmallerGetNewLineLengths)(D,this._cols,v),j=q.length-D.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const $=[];for(let I=0;I<j;I++){const W=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);$.push(W)}$.length>0&&(T.push({start:M+D.length+A,newLines:$}),A+=$.length),D.push(...$);let V=q.length-1,G=q[V];G===0&&(V--,G=q[V]);let U=D.length-j-1,P=z;for(;U>=0;){const I=Math.min(P,G);if(D[V]===void 0)break;if(D[V].copyCellsFrom(D[U],P-I,G-I,I,!0),G-=I,G===0&&(V--,G=q[V]),P-=I,P===0){U--;const W=Math.max(U,0);P=(0,x.getWrappedLineTrimmedLength)(D,W,this._cols)}}for(let I=0;I<D.length;I++)q[I]<v&&D[I].setCell(q[I],E);let B=j-K;for(;B-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+b-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 H=D-1,z=0,q=T[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let j=0;for(let V=Math.min(this.lines.maxLength-1,D+A-1);V>=0;V--)if(q&&q.start>H+j){for(let G=q.newLines.length-1;G>=0;G--)this.lines.set(V--,q.newLines[G]);V++,M.push({index:H+1,amount:q.newLines.length}),j+=q.newLines.length,q=T[++z]}else this.lines.set(V,L[H--]);let K=0;for(let V=M.length-1;V>=0;V--)M[V].index+=K,this.lines.onInsertEmitter.fire(M[V]),K+=M[V].amount;const $=Math.max(0,D+A-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(v,b,E=0,T){const A=this.lines.get(v);return A?A.translateToString(b,E,T):""}getWrappedRangeForLine(v){let b=v,E=v;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:b,last:E}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===v&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const b=new _.Marker(v);return this.markers.push(b),b.register(this.lines.onTrim((E=>{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.line<E.index+E.amount&&b.dispose(),b.line>E.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),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 x=0;class C{constructor(_,y,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const b=y||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<_;++E)this.setCell(E,b);this.length=_}get(_){const y=this._data[3*_+0],v=2097151&y;return[this._data[3*_+1],2097152&y?this._combined[_]:v?(0,g.stringFromCodePoint)(v):"",y>>22,2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):v]}set(_,y){this._data[3*_+1]=y[f.CHAR_DATA_ATTR_INDEX],y[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=y[1],this._data[3*_+0]=2097152|_|y[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&y}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_]:2097151&y?(0,g.stringFromCodePoint)(2097151&y):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,y){return x=3*_,y.content=this._data[x+0],y.fg=this._data[x+1],y.bg=this._data[x+2],2097152&y.content&&(y.combinedData=this._combined[_]),268435456&y.bg&&(y.extended=this._extendedAttrs[_]),y}setCell(_,y){2097152&y.content&&(this._combined[_]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[_]=y.extended),this._data[3*_+0]=y.content,this._data[3*_+1]=y.fg,this._data[3*_+2]=y.bg}setCellFromCodepoint(_,y,v,b){268435456&b.bg&&(this._extendedAttrs[_]=b.extended),this._data[3*_+0]=y|v<<22,this._data[3*_+1]=b.fg,this._data[3*_+2]=b.bg}addCodepointToCell(_,y,v){let b=this._data[3*_+0];2097152&b?this._combined[_]+=(0,g.stringFromCodePoint)(y):2097151&b?(this._combined[_]=(0,g.stringFromCodePoint)(2097151&b)+(0,g.stringFromCodePoint)(y),b&=-2097152,b|=2097152):b=y|4194304,v&&(b&=-12582913,b|=v<<22),this._data[3*_+0]=b}insertCells(_,y,v){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length-_){const b=new p.CellData;for(let E=this.length-_-y-1;E>=0;--E)this.setCell(_+y+E,this.loadCell(_+E,b));for(let E=0;E<y;++E)this.setCell(_+E,v)}else for(let b=_;b<this.length;++b)this.setCell(b,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(_,y,v){if(_%=this.length,y<this.length-_){const b=new p.CellData;for(let E=0;E<this.length-_-y;++E)this.setCell(_+E,this.loadCell(_+y+E,b));for(let E=this.length-y;E<this.length;++E)this.setCell(E,v)}else for(let b=_;b<this.length;++b)this.setCell(b,v);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,v)}replaceCells(_,y,v,b=!1){if(b)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.isProtected(_)||this.setCell(_,v),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.setCell(_++,v)}resize(_,y){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const b=new Uint32Array(v);b.set(this._data),this._data=b}for(let b=this.length;b<_;++b)this.setCell(b,y)}else{this._data=this._data.subarray(0,v);const b=Object.keys(this._combined);for(let T=0;T<b.length;T++){const A=parseInt(b[T],10);A>=_&&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>=_&&delete this._extendedAttrs[A]}}return this.length=_,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,y=!1){if(y)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,_);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const y in _._combined)this._combined[y]=_._combined[y];this._extendedAttrs={};for(const y in _._extendedAttrs)this._extendedAttrs[y]=_._extendedAttrs[y];this.isWrapped=_.isWrapped}clone(){const _=new C(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const y in this._combined)_._combined[y]=this._combined[y];for(const y in this._extendedAttrs)_._extendedAttrs[y]=this._extendedAttrs[y];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,y,v,b,E){const T=_._data;if(E)for(let M=b-1;M>=0;M--){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(y+M)+L];268435456&T[3*(y+M)+2]&&(this._extendedAttrs[v+M]=_._extendedAttrs[y+M])}else for(let M=0;M<b;M++){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(y+M)+L];268435456&T[3*(y+M)+2]&&(this._extendedAttrs[v+M]=_._extendedAttrs[y+M])}const A=Object.keys(_._combined);for(let M=0;M<A.length;M++){const L=parseInt(A[M],10);L>=y&&(this._combined[L-y+v]=_._combined[L])}}translateToString(_,y,v,b){y=y??0,v=v??this.length,_&&(v=Math.min(v,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;y<v;){const T=this._data[3*y+0],A=2097151&T,M=2097152&T?this._combined[y]:A?(0,g.stringFromCodePoint)(A):f.WHITESPACE_CELL_CHAR;if(E+=M,b)for(let L=0;L<M.length;++L)b.push(y);y+=T>>22||1}return b&&b.push(y),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,x=d[p+1].getWidth(0)===2;return g&&x?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,x){const C=[];for(let w=0;w<d.length-1;w++){let _=w,y=d.get(++_);if(!y.isWrapped)continue;const v=[d.get(w)];for(;_<d.length&&y.isWrapped;)v.push(y),y=d.get(++_);if(g>=w&&g<_){w+=v.length-1;continue}let b=0,E=l(v,b,p),T=1,A=0;for(;T<v.length;){const L=l(v,T,p),D=L-A,H=f-E,z=Math.min(D,H);v[b].copyCellsFrom(v[T],A,E,z,!1),E+=z,E===f&&(b++,E=0),A+=z,A===L&&(T++,A=0),E===0&&b!==0&&v[b-1].getWidth(f-1)===2&&(v[b].copyCellsFrom(v[b-1],f-1,E++,1,!1),v[b-1].setCell(f-1,x))}v[b].replaceCells(E,f,x);let M=0;for(let L=v.length-1;L>0&&(L>b||v[L].getTrimmedLength()===0);L--)M++;M>0&&(C.push(w+v.length-M),C.push(M)),w+=v.length-1}return C},a.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,x=p[g],C=0;for(let w=0;w<d.length;w++)if(x===w){const _=p[++g];d.onDeleteEmitter.fire({index:w-C,amount:_}),w+=_-1,C+=_,x=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=[],x=d.map(((y,v)=>l(d,v,p))).reduce(((y,v)=>y+v));let C=0,w=0,_=0;for(;_<x;){if(x-_<f){g.push(x-_);break}C+=f;const y=l(d,w,p);C>y&&(C-=y,w++);const v=d[w].getWidth(C-1)===2;v&&C--;const b=v?f-1:f;g.push(b),_+=b}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 _=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(_-55296)+y-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(x){this.line=x,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(x){return this._disposables.push(x),x}}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=`
|
|
28
|
+
`,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,x,C){const w={type:0,cancel:!1,key:void 0},_=(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;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(x?"b":"[1;5D"))):w.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(x?"f":"[1;5C"))):w.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"A",x||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;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"B",x||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=_?d.C0.ESC+"[3;"+(_+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=_?d.C0.ESC+"[1;"+(_+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=_?d.C0.ESC+"[1;"+(_+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;"+(_+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=d.C0.ESC+"[6;"+(_+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=_?d.C0.ESC+"[1;"+(_+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=_?d.C0.ESC+"[1;"+(_+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=_?d.C0.ESC+"[1;"+(_+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=_?d.C0.ESC+"[1;"+(_+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=_?d.C0.ESC+"[15;"+(_+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=_?d.C0.ESC+"[17;"+(_+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=_?d.C0.ESC+"[18;"+(_+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=_?d.C0.ESC+"[19;"+(_+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=_?d.C0.ESC+"[20;"+(_+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=_?d.C0.ESC+"[21;"+(_+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=_?d.C0.ESC+"[23;"+(_+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=_?d.C0.ESC+"[24;"+(_+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(x&&!C||!f.altKey||f.metaKey)!x||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 y=p[f.keyCode],v=y?.[f.shiftKey?1:0];if(v)w.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const b=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(b);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 b=f.code.slice(3,4);f.shiftKey||(b=b.toLowerCase()),w.key=d.C0.ESC+b,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 x=l[g];x>65535?(x-=65536,f+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):f+=String.fromCharCode(x)}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 x=l.charCodeAt(g++);56320<=x&&x<=57343?d[f++]=1024*(this._interim-55296)+x-56320+65536:(d[f++]=this._interim,d[f++]=x),this._interim=0}for(let x=g;x<p;++x){const C=l.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=p)return this._interim=C,f;const w=l.charCodeAt(x);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,x,C,w=0,_=0,y=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(;y<D;){if(y>=p)return 0;if(A=l[y++],(192&A)!=128){y--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?y--: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 v=p-4;let b=y;for(;b<p;){for(;!(!(b<v)||128&(f=l[b])||128&(g=l[b+1])||128&(x=l[b+2])||128&(C=l[b+3]));)d[w++]=f,d[w++]=g,d[w++]=x,d[w++]=C,b+=4;if(f=l[b++],f<128)d[w++]=f;else if((224&f)==192){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(_=(31&f)<<6|63&g,_<128){b--;continue}d[w++]=_}else if((240&f)==224){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,w;if(x=l[b++],(192&x)!=128){b--;continue}if(_=(15&f)<<12|(63&g)<<6|63&x,_<2048||_>=55296&&_<=57343||_===65279)continue;d[w++]=_}else if((248&f)==240){if(b>=p)return this.interim[0]=f,w;if(g=l[b++],(192&g)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,w;if(x=l[b++],(192&x)!=128){b--;continue}if(b>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=x,w;if(C=l[b++],(192&C)!=128){b--;continue}if(_=(7&f)<<18|(63&g)<<12|(63&x)<<6|63&C,_<65536||_>1114111)continue;d[w++]=_}}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 x=0;x<p.length;++x)g.fill(0,p[x][0],p[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?g[x]:(function(C,w){let _,y=0,v=w.length-1;if(C<w[0][0]||C>w[v][1])return!1;for(;v>=y;)if(_=y+v>>1,C>w[_][1])y=_+1;else{if(!(C<w[_][0]))return!0;v=_-1}return!1})(x,f)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let w=this.wcwidth(x),_=w===0&&C!==0;if(_){const y=d.UnicodeService.extractWidth(C);y===0?_=!1:y>w&&(w=y)}return d.UnicodeService.createPropertyValue(0,w,_)}}},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(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],y=this._action(_,C);if(y){const b=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=_.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 x=f.toString(16),C=x.length<2?"0"+x:x;switch(g){case 4:return x[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 x=l.exec(g);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const x=g.length/3,C=[0,0,0];for(let w=0;w<3;++w){const _=parseInt(g.slice(x*w,x*w+x),16);C[w]=x===1?_<<4:x===2?_:x===3?_>>4:_>>8}return C}},a.toRgbString=function(f,g=16){const[x,C,w]=f;return`rgb:${p(x,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 _=this._handlers[C];return _.push(w),{dispose:()=>{const y=_.indexOf(w);y!==-1&&_.splice(y,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 _=this._active.length-1;_>=0;_--)this._active[_].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(C,w,_);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,w,_))}unhook(C,w=!0){if(this._active.length){let _=!1,y=this._active.length-1,v=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;y>=0&&(_=this._active[y].unhook(C),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const x=new p.Params;x.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,w,_){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,w,_),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((_=>(this._params=x,this._data="",this._hitLimit=!1,_)));return this._params=x,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 x{constructor(y){this.table=new Uint8Array(y)}setDefault(y,v){this.table.fill(y<<4|v)}add(y,v,b,E){this.table[v<<8|y]=b<<4|E}addMany(y,v,b,E){for(let T=0;T<y.length;T++)this.table[v<<8|y[T]]=b<<4|E}}a.TransitionTable=x;const C=160;a.VT500_TRANSITION_TABLE=(function(){const _=new x(4095),y=Array.apply(null,Array(256)).map(((M,L)=>L)),v=(M,L)=>y.slice(M,L),b=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const T=v(0,14);let A;for(A in _.setDefault(1,0),_.addMany(b,0,2,0),T)_.addMany([24,26,153,154],A,3,0),_.addMany(v(128,144),A,3,0),_.addMany(v(144,152),A,3,0),_.add(156,A,0,0),_.add(27,A,11,1),_.add(157,A,4,8),_.addMany([152,158,159],A,0,7),_.add(155,A,11,3),_.add(144,A,11,9);return _.addMany(E,0,3,0),_.addMany(E,1,3,1),_.add(127,1,0,1),_.addMany(E,8,0,8),_.addMany(E,3,3,3),_.add(127,3,0,3),_.addMany(E,4,3,4),_.add(127,4,0,4),_.addMany(E,6,3,6),_.addMany(E,5,3,5),_.add(127,5,0,5),_.addMany(E,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(b,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(v(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(b,7,0,7),_.addMany(E,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(v(64,127),3,7,0),_.addMany(v(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(v(48,60),4,8,4),_.addMany(v(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(v(32,64),6,0,6),_.add(127,6,0,6),_.addMany(v(64,127),6,0,0),_.addMany(v(32,48),3,9,5),_.addMany(v(32,48),5,9,5),_.addMany(v(48,64),5,0,6),_.addMany(v(64,127),5,7,0),_.addMany(v(32,48),4,9,5),_.addMany(v(32,48),1,9,2),_.addMany(v(32,48),2,9,2),_.addMany(v(48,127),2,10,0),_.addMany(v(48,80),1,10,0),_.addMany(v(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(v(96,127),1,10,0),_.add(80,1,11,9),_.addMany(E,9,0,9),_.add(127,9,0,9),_.addMany(v(28,32),9,0,9),_.addMany(v(32,48),9,9,12),_.addMany(v(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(E,11,0,11),_.addMany(v(32,128),11,0,11),_.addMany(v(28,32),11,0,11),_.addMany(E,10,0,10),_.add(127,10,0,10),_.addMany(v(28,32),10,0,10),_.addMany(v(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(v(32,48),10,9,12),_.addMany(E,12,0,12),_.add(127,12,0,12),_.addMany(v(28,32),12,0,12),_.addMany(v(32,48),12,9,12),_.addMany(v(48,64),12,0,11),_.addMany(v(64,127),12,12,13),_.addMany(v(64,127),10,12,13),_.addMany(v(64,127),9,12,13),_.addMany(E,13,13,13),_.addMany(b,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(C,0,2,0),_.add(C,8,5,8),_.add(C,6,0,6),_.add(C,11,0,11),_.add(C,13,13,13),_})();class w extends d.Disposable{constructor(y=a.VT500_TRANSITION_TABLE){super(),this._transitions=y,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=(v,b,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,b)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,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(y,v=[64,126]){let b=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=y.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<y.intermediates.length;++T){const A=y.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=A}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return b<<=8,b|=E,b}identToString(y){const v=[];for(;y;)v.push(String.fromCharCode(255&y)),y>>=8;return v.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,v){const b=this._identifier(y,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,v){this._executeHandlers[y.charCodeAt(0)]=v}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,v){const b=this._identifier(y);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,v){return this._dcsParser.registerHandler(this._identifier(y),v)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,v){return this._oscParser.registerHandler(y,v)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,v,b,E,T){this._parseStack.state=y,this._parseStack.handlers=v,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(y,v,b){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(b===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(b===!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(b===!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=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,b),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=y[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,b),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<v;++L){switch(T=y[L],A=this._transitions.table[this.currentState<<8|(T<160?T:C)],A>>4){case 2:for(let j=L+1;;++j){if(j>=v||(T=y[j])<32||T>126&&T<C){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<C){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<C){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<C){this._printHandler(y,L,j),L=j-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 H=D?D.length-1:-1;for(;H>=0&&(E=D[H](this._params),E!==!0);H--)if(E instanceof Promise)return this._preserveStack(3,D,H,A,L),E;H<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<v&&(T=y[L])>47&&T<60);L--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const z=this._escHandlers[this._collect<<8|T];let q=z?z.length-1:-1;for(;q>=0&&(E=z[q](),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(4,z,q,A,L),E;q<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 j=L+1;;++j)if(j>=v||(T=y[j])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(y,L,j),L=j-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 j=L+1;;j++)if(j>=v||(T=y[j])<32||T>127&&T<C){this._oscParser.put(y,L,j),L=j-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,x){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(x),{dispose:()=>{const w=C.indexOf(x);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,x,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(g,x,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,x,C))}start(){this.reset(),this._state=1}put(g,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const w=g[x++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&C-x>0&&this._put(g,x,C)}}end(g,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,_=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=x,_=this._stack.fallThrough,this._stack.paused=!1),!_&&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,x,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,x,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let x=!1;if(this._hitLimit)x=!1;else if(g&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(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 x=Array.isArray(f[0])?1:0;x<f.length;++x){const C=f[x];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 x=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-x>0&&f.push(Array.prototype.slice.call(this._subParams,x,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,x=255&this._subParamsIdx[f];return x-g>0?this._subParams.subarray(g,x):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const x=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-x>0&&(f[g]=this._subParams.slice(x,C))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[g-1];x[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(_,y,v,b){var E,T=arguments.length,A=T<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,y,v,b);else for(var M=_.length-1;M>=0;M--)(E=_[M])&&(A=(T<3?E(A):T>3?E(y,v,A):E(y,v))||A);return T>3&&A&&Object.defineProperty(y,v,A),A},p=this&&this.__param||function(_,y){return function(v,b){y(v,b,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=l(8460),g=l(844),x=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(_){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(_.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(_,this))}resize(_,y){this.cols=_,this.rows=y,this.buffers.resize(_,y),this._onResize.fire({cols:_,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,y=!1){const v=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===_.fg&&b.getBg(0)===_.bg||(b=v.getBlankLine(_,y),this._cachedBlankLine=b),b.isWrapped=y;const E=v.ybase+v.scrollTop,T=v.ybase+v.scrollBottom;if(v.scrollTop===0){const A=v.lines.isFull;T===v.lines.length-1?A?v.lines.recycle().copyFrom(b):v.lines.push(b.clone()):v.lines.splice(T+1,0,b.clone()),A?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const A=T-E+1;v.lines.shiftElements(E+1,A-1,-1),v.lines.set(T,b.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(_,y,v){const b=this.buffer;if(_<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else _+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+_,b.ybase),0),E!==b.ydisp&&(y||this._onScroll.fire(b.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(b,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(b,E,T,A);else for(var H=b.length-1;H>=0;H--)(M=b[H])&&(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(b,E){return function(T,A){E(T,A,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=l(2585),g=l(8460),x=l(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,E){let T=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(T|=64,T|=b.action):(T|=3&b.button,4&b.button&&(T|=64),8&b.button&&(T|=128),b.action===32?T|=32:b.action!==0||E||(T|=3)),T}const _=String.fromCharCode,y={DEFAULT:b=>{const E=[w(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${_(E[0])}${_(E[1])}${_(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${E}`}};let v=a.CoreMouseService=class extends x.Disposable{constructor(b,E){super(),this._bufferService=b,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(y))this.addEncoding(T,y[T]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,T){if(T){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};a.CoreMouseService=v=d([p(0,f.IBufferService),p(1,f.ICoreService)],v)},6975:function(h,a,l){var d=this&&this.__decorate||function(v,b,E,T){var A,M=arguments.length,L=M<3?b:T===null?T=Object.getOwnPropertyDescriptor(b,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,b,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(b,E,L):A(b,E))||L);return M>3&&L&&Object.defineProperty(b,E,L),L},p=this&&this.__param||function(v,b){return function(E,T){b(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=l(1439),g=l(8460),x=l(844),C=l(2585),w=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=a.CoreService=class extends x.Disposable{constructor(v,b,E){super(),this._bufferService=v,this._logService=b,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)(_)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}triggerDataEvent(v,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=y=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],y)},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 x=0,C=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((v=>v?.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(v){if(v.marker.isDisposed)return;const b=new _(v);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,b,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(b))T=M.options.x??0,A=T+(M.options.width??1),v>=T&&v<A&&(!E||(M.options.layer??"bottom")===E)&&(yield M)}forEachDecorationAtCell(v,b,E,T){this._decorations.forEachByKey(b,(A=>{x=A.options.x??0,C=x+(A.options.width??1),v>=x&&v<C&&(!E||(A.options.layer??"bottom")===E)&&T(A)}))}}a.DecorationService=w;class _ 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(v){super(),this.options=v,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=v.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(...x){this._entries=new Map;for(const[C,w]of x)this.set(C,w)}set(x,C){const w=this._entries.get(x);return this._entries.set(x,C),w}forEach(x){for(const[C,w]of this._entries.entries())x(C,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,x){this._services.set(g,x)}getService(g){return this._services.get(g)}createInstance(g,...x){const C=(0,p.getServiceDependencies)(g).sort(((y,v)=>y.index-v.index)),w=[];for(const y of C){const v=this._services.get(y.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${y.id}.`);w.push(v)}const _=C.length>0?C[0].index:x.length;if(x.length!==_)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${_+1} conflicts with ${x.length} static arguments`);return new g(...x,...w)}}},7866:function(h,a,l){var d=this&&this.__decorate||function(_,y,v,b){var E,T=arguments.length,A=T<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,y,v,b);else for(var M=_.length-1;M>=0;M--)(E=_[M])&&(A=(T<3?E(A):T>3?E(y,v,A):E(y,v))||A);return T>3&&A&&Object.defineProperty(y,v,A),A},p=this&&this.__param||function(_,y){return function(v,b){y(v,b,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=l(844),g=l(2585),x={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(_){super(),this._optionsService=_,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let y=0;y<_.length;y++)typeof _[y]=="function"&&(_[y]=_[y]())}_log(_,y,v){this._evalLazyOptionalParams(v),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...v)}trace(_,...y){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,_,y)}debug(_,...y){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,_,y)}info(_,...y){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,_,y)}warn(_,...y){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,_,y)}error(_,...y){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,_,y)}};a.LogService=w=d([p(0,g.IOptionsService)],w),a.setTraceLogger=function(_){C=_},a.traceCall=function(_,y,v){if(typeof v.value!="function")throw new Error("not supported");const b=v.value;v.value=function(...E){if(C.logLevel!==g.LogLevelEnum.TRACE)return b.apply(this,E);C.trace(`GlyphRenderer#${b.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=b.apply(this,E);return C.trace(`GlyphRenderer#${b.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 x extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...a.DEFAULT_OPTIONS};for(const y in w)if(y in _)try{const v=w[y];_[y]=this._sanitizeAndValidateOption(y,v)}catch(v){console.error(v)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,_){return this.onOptionChange((y=>{y===w&&_(this.rawOptions[w])}))}onMultipleOptionChange(w,_){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&_()}))}_setupOptions(){const w=y=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},_=(y,v)=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);v=this._sanitizeAndValidateOption(y,v),this.rawOptions[y]!==v&&(this.rawOptions[y]=v,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const v={get:w.bind(this,y),set:_.bind(this,y)};Object.defineProperty(this.options,y,v)}}_sanitizeAndValidateOption(w,_){switch(w){case"cursorStyle":if(_||(_=a.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${w}`);break;case"wordSeparator":_||(_=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=g.includes(_)?_:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${w} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${w} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}a.OptionsService=x},2660:function(h,a,l){var d=this&&this.__decorate||function(x,C,w,_){var y,v=arguments.length,b=v<3?C:_===null?_=Object.getOwnPropertyDescriptor(C,w):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(x,C,w,_);else for(var E=x.length-1;E>=0;E--)(y=x[E])&&(b=(v<3?y(b):v>3?y(C,w,b):y(C,w))||b);return v>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(x,C){return function(w,_){C(w,_,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=l(2585);let g=a.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const E=C.addMarker(C.ybase+C.y),T={data:x,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const w=x,_=this._getEntryIdKey(w),y=this._entriesWithId.get(_);if(y)return this.addLineToLink(y.id,C.ybase+C.y),y.id;const v=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(b,v))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(x,C){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((_=>_.line!==C))){const _=this._bufferService.buffer.addMarker(C);w.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(w,_)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const w=x.lines.indexOf(C);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};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,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,_,y){_[l]===_?_[d].push({id:w,index:y}):(_[d]=[{id:w,index:y}],_[l]=_)})(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(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,w=!1){return(16777215&x)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const x=new p.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,w=0;const _=x.length;for(let y=0;y<_;++y){let v=x.charCodeAt(y);if(55296<=v&&v<=56319){if(++y>=_)return C+this.wcwidth(v);const T=x.charCodeAt(y);56320<=T&&T<=57343?v=1024*(v-55296)+T-56320+65536:C+=this.wcwidth(T)}const b=this.charProperties(v,w);let E=f.extractWidth(b);f.extractShouldJoin(b)&&(E-=f.extractWidth(w)),C+=E,w=b}return C}charProperties(x,C){return this._activeProvider.charProperties(x,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),x=o(7090),C=["cols","rows"];class w extends d.Disposable{constructor(y){super(),this._core=this.register(new l.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],b=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:v.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(y){if(C.includes(y))throw new Error(`Option "${y}" 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 x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const v in y)this._publicOptions[v]=y[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,v=!0){this._core.input(y,v)}resize(y,v){this._verifyIntegers(y,v),this._core.resize(y,v)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,v,b){this._verifyIntegers(y,v,b),this._core.select(y,v,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,v){this._verifyIntegers(y,v),this._core.selectLines(y,v)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,v){this._core.write(y,v)}writeln(y,v){this._core.write(y),this._core.write(`\r
|
|
29
|
+
`,v)}paste(y){this._core.paste(y)}refresh(y,v){this._verifyIntegers(y,v),this._core.refresh(y,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const v of y)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const v of y)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}h.Terminal=w})(),u})()))})(Cv)),Cv.exports}var Rk=vN(),wv={exports:{}},HC;function _N(){return HC||(HC=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})()))})(wv)),wv.exports}var kk=_N(),Ev={exports:{}},VC;function yN(){return VC||(VC=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,x={}){this._terminal=p,this._regex=f,this._handler=g,this._options=x}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,x)=>{if(this._options.hover){const{range:C}=f;this._options.hover(g,x,C)}},f)))}};class d{static computeLink(f,g,x,C){const w=new RegExp(g.source,(g.flags||"")+"g"),[_,y]=d._getWindowedLineStrings(f-1,x),v=_.join("");let b;const E=[];for(;b=w.exec(v);){const T=b[0];if(!l(T))continue;const[A,M]=d._mapStrIdx(x,y,0,b.index),[L,D]=d._mapStrIdx(x,A,M,T.length);if(A===-1||M===-1||L===-1||D===-1)continue;const H={start:{x:M+1,y:A+1},end:{x:D,y:L+1}};E.push({range:H,text:T,activate:C})}return E}static _getWindowedLineStrings(f,g){let x,C=f,w=f,_=0,y="";const v=[];if(x=g.buffer.active.getLine(f)){const b=x.translateToString(!0);if(x.isWrapped&&b[0]!==" "){for(_=0;(x=g.buffer.active.getLine(--C))&&_<2048&&(y=x.translateToString(!0),_+=y.length,v.push(y),x.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(b),_=0;(x=g.buffer.active.getLine(++w))&&x.isWrapped&&_<2048&&(y=x.translateToString(!0),_+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,C]}static _mapStrIdx(f,g,x,C){const w=f.buffer.active,_=w.getNullCell();let y=x;for(;C;){const v=w.getLine(g);if(!v)return[-1,-1];for(let b=y;b<v.length;++b){v.getCell(b,_);const E=_.getChars();if(_.getWidth()&&(C-=E.length||1,b===v.length-1&&E==="")){const T=w.getLine(g+1);T&&T.isWrapped&&(T.getCell(0,_),_.getWidth()===2&&(C+=1))}if(C<0)return[g,b]}g++,y=0}return[g,y]}}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})()))})(Ev)),Ev.exports}var Tk=yN();function bN({className:e,onReady:t,onResize:n,onContainerReady:s}){const o=k.useRef(null),u=k.useRef(null),h=k.useRef(null),a=k.useRef(n),{setTerminalFocused:l}=V0();k.useEffect(()=>{a.current=n},[n]);const d=k.useCallback(()=>{if(!h.current||!u.current)return;h.current.fit();const{cols:f,rows:g}=u.current;a.current?.(f,g)},[]);k.useEffect(()=>{if(!o.current||u.current)return;const f=new Rk.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"}}),g=new kk.FitAddon,x=new Tk.WebLinksAddon;f.loadAddon(g),f.loadAddon(x),f.open(o.current),u.current=f,h.current=g,requestAnimationFrame(()=>{d(),t?.(f),o.current&&s?.(o.current)});const C=()=>l(!0),w=()=>l(!1);f.textarea&&(f.textarea.addEventListener("focus",C),f.textarea.addEventListener("blur",w));const _=setTimeout(()=>{d(),f.refresh(0,f.rows-1)},100),y=()=>{requestAnimationFrame(d)};window.addEventListener("resize",y);const v=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})};document.addEventListener("visibilitychange",v);const b=new ResizeObserver(y);b.observe(o.current);const E=new IntersectionObserver(T=>{T[0]?.isIntersecting&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})},{threshold:.1});return E.observe(o.current),()=>{clearTimeout(_),window.removeEventListener("resize",y),document.removeEventListener("visibilitychange",v),b.disconnect(),E.disconnect(),f.textarea&&(f.textarea.removeEventListener("focus",C),f.textarea.removeEventListener("blur",w)),l(!1),f.dispose(),u.current=null,h.current=null}},[d,t,s,l]);const p=k.useCallback(()=>{u.current?.scrollToBottom()},[]);return S.jsxs("div",{className:"relative h-full w-full",children:[S.jsx("div",{ref:o,className:ze("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),S.jsx("button",{onClick:p,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:S.jsx(Se,{icon:j2,size:20,strokeWidth:2})})]})}function xN({name:e,status:t,exitCode:n,className:s,onRename:o}){const[u,h]=k.useState(!1),[a,l]=k.useState(e),d=k.useRef(null);k.useEffect(()=>{u&&d.current&&(d.current.focus(),d.current.select())},[u]);const p=()=>{o&&(l(e),h(!0))},f=()=>{const x=a.trim();x&&x!==e&&o&&o(x),h(!1)},g=x=>{x.key==="Enter"?f():x.key==="Escape"&&h(!1)};return S.jsxs("div",{className:ze("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[S.jsx("span",{className:ze("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?S.jsx("input",{ref:d,type:"text",value:a,onChange:x=>l(x.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"}):S.jsx("span",{className:ze("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&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),S.jsxs("span",{className:ze({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}const SN="";function Lk(){return Bn({mutationFn:async e=>{const t=await fetch(`${SN}/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 CN="";function Ak(){return Bn({mutationFn:async e=>{const t=await fetch(`${CN}/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 wN="";function Ok(){return Bn({mutationFn:async e=>{const t=await fetch(`${wN}/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()}})}function EN({repoPath:e,worktreePath:t,baseBranch:n,taskId:s}){const o=Lk(),u=Ak(),h=Ok(),a=N0(),l=async()=>{try{await o.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Ir.success("Synced from main")}catch(f){const g=f instanceof Error?f.message:"Sync failed";Ir.error(g)}},d=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Ir.success("Merged to main"),a.mutate({taskId:s,updates:{status:"DONE"}})}catch(f){const g=f instanceof Error?f.message:"Merge failed";Ir.error(g)}},p=async()=>{try{await h.mutateAsync({repoPath:e,baseBranch:n}),Ir.success("Parent synced with origin")}catch(f){const g=f instanceof Error?f.message:"Sync parent failed";Ir.error(g)}};return S.jsxs(S.Fragment,{children:[S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:l,disabled:o.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:S.jsx(Se,{icon:I2,size:12,strokeWidth:2,className:o.isPending?"animate-spin":""})}),S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:d,disabled:u.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:S.jsx(Se,{icon:z2,size:12,strokeWidth:2,className:u.isPending?"animate-pulse":""})}),S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:p,disabled:h.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:S.jsx(Se,{icon:q2,size:12,strokeWidth:2,className:h.isPending?"animate-spin":""})})]})}function RN({terminal:e,taskInfo:t,onClose:n,onReady:s,onResize:o,onRename:u,onContainerReady:h}){return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:[t?S.jsxs("div",{className:"flex flex-1 items-center gap-2 px-2 py-1",children:[S.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:[S.jsx(Se,{icon:e0,size:14,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{className:"truncate",children:t.title})]}),S.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&&S.jsx("span",{className:"text-xs text-muted-foreground truncate",children:e.cwd.split("/").pop()}),S.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:S.jsx(EN,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId})})]}):S.jsx(xN,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:u}),n&&S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:n,className:"mr-1 h-5 w-5 text-muted-foreground hover:text-foreground",children:S.jsx(Se,{icon:vo,size:12,strokeWidth:2})})]}),S.jsx("div",{className:"flex-1",children:S.jsx(bN,{onReady:s,onResize:o,onContainerReady:h})})]})}function kN({onAdd:e}){return S.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?S.jsxs(je,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[S.jsx(Se,{icon:ec,size:14,strokeWidth:2}),"New Terminal"]}):S.jsx("p",{className:"text-xs text-muted-foreground",children:"No terminals"})})}function TN(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 LN({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,taskInfoByCwd:a}){if(e.length===0)return S.jsx(kN,{onAdd:n});const{rows:l,cols:d}=TN(e.length),p=[];for(let g=0;g<l;g++){const x=g*d,C=Math.min(x+d,e.length);x<e.length&&p.push(e.slice(x,C))}const f=g=>S.jsx(RN,{terminal:g,taskInfo:g.cwd?a?.get(g.cwd):void 0,onClose:t?()=>t(g.id):void 0,onReady:s?x=>s(g.id,x):void 0,onResize:o?(x,C)=>o(g.id,x,C):void 0,onRename:u?x=>u(g.id,x):void 0,onContainerReady:h?x=>h(g.id,x):void 0});return e.length===1?S.jsx("div",{className:"h-full",children:f(e[0])}):e.length===2?S.jsxs(Jo,{direction:"horizontal",className:"h-full",children:[S.jsx(Jr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),S.jsx(ea,{}),S.jsx(Jr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id)]}):e.length===3?S.jsxs(Jo,{direction:"horizontal",className:"h-full",children:[S.jsx(Jr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),S.jsx(ea,{}),S.jsx(Jr,{defaultSize:50,minSize:15,children:S.jsxs(Jo,{direction:"vertical",className:"h-full",children:[S.jsx(Jr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id),S.jsx(ea,{}),S.jsx(Jr,{defaultSize:50,minSize:15,children:f(e[2])},e[2].id)]})})]}):S.jsx(Jo,{direction:"vertical",className:"h-full",children:p.map((g,x)=>S.jsxs(k.Fragment,{children:[x>0&&S.jsx(ea,{}),S.jsx(Jr,{defaultSize:100/p.length,minSize:15,children:g.length===1?f(g[0]):S.jsx(Jo,{direction:"horizontal",className:"h-full",children:g.map((C,w)=>S.jsxs(k.Fragment,{children:[w>0&&S.jsx(ea,{}),S.jsx(Jr,{defaultSize:100/d,minSize:15,children:f(C)})]},C.id))})})]},`row-${x}`))})}function AN({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:s,onTabCreate:o,onTabRename:u}){const[h,a]=k.useState(null),[l,d]=k.useState(""),p=k.useRef(null);k.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)},x=C=>{C.key==="Enter"?g():C.key==="Escape"&&a(null)};return S.jsxs("div",{className:"flex items-center gap-1",children:[e.map(C=>S.jsx("button",{onClick:()=>n(C.id),onDoubleClick:()=>f(C),className:ze("group relative flex items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs transition-colors",C.id===t?"border-border bg-background text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:h===C.id?S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx(Wt,{ref:p,value:l,onChange:w=>d(w.target.value),onBlur:g,onKeyDown:x,className:"h-5 w-20 px-1 text-xs"}),S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:S.jsx(Se,{icon:c4,size:12,strokeWidth:2})})]}):S.jsxs(S.Fragment,{children:[C.name,e.length>1&&S.jsx("button",{onClick:w=>{w.stopPropagation(),s(C.id)},className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:S.jsx(Se,{icon:vo,size:12,strokeWidth:2})})]})},C.id)),S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:S.jsx(Se,{icon:ec,size:14,strokeWidth:2})})]})}async function ON(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 MN(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function $0(e={}){const{url:t=MN(),reconnectInterval:n=2e3,maxReconnectAttempts:s=10}=e,[o,u]=k.useState([]),[h,a]=k.useState(!1),[l,d]=k.useState([]),[p,f]=k.useState(!1),g=k.useRef(null),x=k.useRef(0),C=k.useRef(void 0),w=k.useRef(new Map),_=k.useRef(new Set),y=k.useRef(new Map),v=k.useRef(()=>{}),b=k.useCallback(U=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(U))},[]),E=k.useCallback(U=>{try{const P=JSON.parse(U.data);switch(P.type){case"terminals:list":u(P.payload.terminals),a(!0);break;case"terminal:created":u(B=>[...B,P.payload.terminal]),P.payload.isNew&&_.current.add(P.payload.terminal.id);break;case"terminal:output":{const B=w.current.get(P.payload.terminalId);B&&B.write(P.payload.data);break}case"terminal:attached":{const B=w.current.get(P.payload.terminalId);B&&P.payload.buffer&&B.write(P.payload.buffer);const I=y.current.get(P.payload.terminalId);I&&(y.current.delete(P.payload.terminalId),I());break}case"terminal:exit":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,status:"exited",exitCode:P.payload.exitCode}:I));break;case"terminal:error":console.error("Terminal error:",P.payload.error);break;case"terminal:renamed":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,name:P.payload.name}:I));break;case"terminal:destroyed":w.current.delete(P.payload.terminalId),u(B=>B.filter(I=>I.id!==P.payload.terminalId));break;case"terminal:tabAssigned":u(B=>B.map(I=>I.id===P.payload.terminalId?{...I,tabId:P.payload.tabId??void 0,positionInTab:P.payload.positionInTab}:I));break;case"tabs:list":d(P.payload.tabs);break;case"tab:created":d(B=>[...B,P.payload.tab].sort((I,W)=>I.position-W.position));break;case"tab:renamed":d(B=>B.map(I=>I.id===P.payload.tabId?{...I,name:P.payload.name}:I));break;case"tab:deleted":d(B=>B.filter(I=>I.id!==P.payload.tabId));break;case"tab:reordered":d(B=>B.map(I=>I.id===P.payload.tabId?{...I,position:P.payload.position}:I).sort((I,W)=>I.position-W.position));break}}catch(P){console.error("Failed to parse WebSocket message:",P)}},[]),T=k.useCallback(()=>{const U=g.current;if(U&&(U.readyState===WebSocket.CONNECTING||U.readyState===WebSocket.OPEN))return;const P=new WebSocket(t);g.current=P,P.onopen=()=>{f(!0),x.current=0},P.onmessage=E,P.onclose=()=>{f(!1),a(!1),g.current===P&&(g.current=null),x.current<s&&(x.current++,C.current=setTimeout(()=>v.current(),n))},P.onerror=()=>{}},[t,n,s,E]);v.current=T,k.useEffect(()=>(T(),()=>{C.current&&clearTimeout(C.current),g.current&&(g.current.close(),g.current=null)}),[T]);const A=k.useCallback(U=>{b({type:"terminal:create",payload:U})},[b]),M=k.useCallback(U=>{b({type:"terminal:destroy",payload:{terminalId:U}}),w.current.delete(U),u(P=>P.filter(B=>B.id!==U))},[b]),L=k.useCallback((U,P)=>{b({type:"terminal:input",payload:{terminalId:U,data:P}})},[b]),D=k.useCallback((U,P,B)=>{b({type:"terminal:resize",payload:{terminalId:U,cols:P,rows:B}})},[b]),H=k.useCallback((U,P)=>{b({type:"terminal:rename",payload:{terminalId:U,name:P}})},[b]),z=k.useCallback((U,P,B)=>{b({type:"terminal:assignTab",payload:{terminalId:U,tabId:P,positionInTab:B}})},[b]),q=k.useCallback((U,P)=>{b({type:"tab:create",payload:{name:U,position:P}})},[b]),j=k.useCallback((U,P)=>{b({type:"tab:rename",payload:{tabId:U,name:P}})},[b]),K=k.useCallback(U=>{b({type:"tab:delete",payload:{tabId:U}})},[b]),$=k.useCallback((U,P)=>{b({type:"tab:reorder",payload:{tabId:U,position:P}})},[b]),V=k.useCallback((U,P,B)=>{w.current.set(U,P);const I=P.onData(W=>{L(U,W)});return B?.onAttached&&y.current.set(U,B.onAttached),b({type:"terminal:attach",payload:{terminalId:U}}),()=>{I.dispose(),w.current.delete(U),y.current.delete(U)}},[b,L]),G=k.useCallback((U,P)=>{const B=async I=>{const W=I.clipboardData?.items;if(W){for(const Y of W)if(Y.type.startsWith("image/")){I.preventDefault(),I.stopPropagation();const J=Y.getAsFile();if(!J)return;try{const Z=await ON(J);L(P,Z)}catch(Z){console.error("Failed to upload image:",Z)}return}}};return U.addEventListener("paste",B,!0),()=>{U.removeEventListener("paste",B,!0)}},[L]);return{terminals:o,terminalsLoaded:h,tabs:l,connected:p,newTerminalIds:_.current,createTerminal:A,destroyTerminal:M,writeToTerminal:L,resizeTerminal:D,renameTerminal:H,assignTerminalToTab:z,createTab:q,renameTab:j,deleteTab:K,reorderTab:$,attachXterm:V,setupImagePaste:G}}const Ms="all-tasks",FC=["IN_PROGRESS","IN_REVIEW"],DN=xs("/terminals/")({component:PN});function PN(){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}=$0(),{activeTabId:x,setActiveTab:C,isLoading:w}=ak();k.useEffect(()=>{if(t.length>0&&!w){const Z=t.map(ee=>ee.id);(!x||!Z.includes(x)&&x!==Ms)&&C(t[0].id)}},[t,x,w,C]);const{data:_=[]}=j0(),{data:y=[]}=z0(),{data:v}=ek(),[b,E]=k.useState(null),T=k.useMemo(()=>{const Z=new Map;for(const ee of y)Z.set(ee.path,ee.id);return Z},[y]),A=k.useMemo(()=>new Set(_.filter(Z=>FC.includes(Z.status)&&Z.worktreePath).map(Z=>Z.worktreePath)),[_]),M=k.useMemo(()=>new Set(_.filter(Z=>Z.worktreePath).map(Z=>Z.worktreePath)),[_]),L=k.useMemo(()=>{const Z=new Map;for(const ee of _)ee.worktreePath&&Z.set(ee.worktreePath,{taskId:ee.id,repoId:T.get(ee.repoPath),repoName:ee.repoName,title:ee.title,repoPath:ee.repoPath,worktreePath:ee.worktreePath,baseBranch:ee.baseBranch,branch:ee.branch});return Z},[_,T]),D=k.useMemo(()=>{const Z=new Set(_.filter(ee=>FC.includes(ee.status)).map(ee=>ee.repoName));return Array.from(Z).sort()},[_]),H=k.useRef(new Map),z=k.useRef(new Map),q=k.useRef(new Map),j=k.useRef(0);k.useEffect(()=>{if(v)for(const Z of e){const ee=Z.cwd?.startsWith(v),X=Z.cwd&&M.has(Z.cwd);ee&&!X&&o(Z.id)}},[e,M,v,o]);const K=k.useMemo(()=>x===Ms?e.filter(Z=>Z.cwd&&A.has(Z.cwd)).filter(Z=>b?_.find(X=>X.worktreePath===Z.cwd)?.repoName===b:!0).sort((Z,ee)=>{const X=_.find(se=>se.worktreePath===Z.cwd),F=_.find(se=>se.worktreePath===ee.cwd);return!X||!F?0:new Date(F.createdAt).getTime()-new Date(X.createdAt).getTime()}):e.filter(Z=>Z.tabId===x).sort((Z,ee)=>(Z.positionInTab??0)-(ee.positionInTab??0)),[x,e,A,b,_]),$=k.useCallback(()=>{j.current++;const ee=e.filter(X=>X.tabId===x).length;s({name:`Terminal ${j.current}`,cols:80,rows:24,tabId:x??void 0,positionInTab:ee})},[s,x,e]);k.useEffect(()=>{for(const Z of e)Z.cwd&&M.has(Z.cwd)&&Z.tabId&&h(Z.id,null)},[e,M,h]);const V=k.useCallback(Z=>{const ee=q.current.get(Z);if(!ee||z.current.has(Z))return;const X=g(ee,Z);z.current.set(Z,X)},[g]),G=k.useCallback(Z=>{const ee=H.current.get(Z);ee&&(ee(),H.current.delete(Z));const X=z.current.get(Z);X&&(X(),z.current.delete(Z)),q.current.delete(Z),o(Z)},[o]),U=k.useCallback((Z,ee)=>{const X=p(Z,ee);H.current.set(Z,X)},[p]),P=k.useCallback((Z,ee)=>{q.current.set(Z,ee),V(Z)},[V]),B=k.useCallback((Z,ee,X)=>{f(Z,ee,X)},[f]),I=k.useCallback((Z,ee)=>{u(Z,ee)},[u]),W=k.useCallback(()=>{const Z=t.length;a(`Tab ${Z+1}`)},[a,t.length]),Y=k.useCallback(Z=>{const ee=e.filter(X=>X.tabId===Z);for(const X of ee)G(X.id);d(Z)},[e,d,G]),J=t.map((Z,ee)=>({id:Z.id,name:Z.name,layout:"single",position:ee}));return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-2 py-1",children:[S.jsx(AN,{tabs:J,activeTabId:x??"",onTabSelect:C,onTabClose:Y,onTabCreate:W,onTabRename:l}),S.jsxs("div",{className:"flex items-center gap-3",children:[x===Ms&&D.length>1&&S.jsxs(Dl,{value:b??"",onValueChange:Z=>E(Z||null),children:[S.jsxs(Il,{size:"sm",className:"min-w-[120px]",children:[S.jsx(Se,{icon:F2,size:12,strokeWidth:2,className:"text-muted-foreground"}),S.jsx(Pl,{children:b||"All Repos"})]}),S.jsxs(jl,{className:"min-w-[200px]",children:[S.jsx(pr,{value:"",children:"All Repos"}),D.map(Z=>S.jsx(pr,{value:Z,children:Z},Z))]})]}),S.jsxs("button",{onClick:()=>C(Ms),className:ze("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",x===Ms?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[S.jsx(Se,{icon:Th,size:12,strokeWidth:2}),"Task Terminals"]}),S.jsxs(je,{variant:"outline",size:"sm",onClick:$,disabled:!n||e.length>=12||x===Ms,children:[S.jsx(Se,{icon:ec,size:14,strokeWidth:2,"data-slot":"icon"}),"New Terminal"]})]})]}),S.jsx("div",{className:"pixel-grid flex-1 overflow-hidden",children:S.jsx(LN,{terminals:K,onTerminalClose:x===Ms?void 0:G,onTerminalAdd:n&&x!==Ms?$:void 0,onTerminalReady:U,onTerminalResize:B,onTerminalRename:x===Ms?void 0:I,onTerminalContainerReady:P,taskInfoByCwd:x===Ms?L:void 0})})]})}function IN(e){if(Array.isArray(e))return e}function jN(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 m_(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 Mk(e,t){if(e){if(typeof e=="string")return m_(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)?m_(e,t):void 0}}function NN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dk(e,t){return IN(e)||jN(e,t)||Mk(e,t)||NN()}var Rv={},vu={},UC;function Pk(){if(UC)return vu;UC=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.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 vu.bind=e,vu}var Ko={},WC;function BN(){if(WC)return Ko;WC=1;var e=Ko&&Ko.__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(Ko,"__esModule",{value:!0}),Ko.bindAll=void 0;var t=Pk();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 Ko.bindAll=o,Ko}var qC;function zN(){return qC||(qC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=Pk();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=BN();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(Rv)),Rv}var Kl=zN(),Ik="data-pdnd-honey-pot";function jk(e){return e instanceof Element&&e.hasAttribute(Ik)}function Nk(e){var t=document.elementsFromPoint(e.x,e.y),n=Dk(t,2),s=n[0],o=n[1];return s?jk(s)?o??null:s:null}function Uu(e){"@babel/helpers - typeof";return Uu=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},Uu(e)}function HN(e,t){if(Uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Uu(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VN(e){var t=HN(e,"string");return Uu(t)=="symbol"?t:t+""}function fd(e,t,n){return(t=VN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bk=2147483647;function GC(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 $C(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GC(Object(n),!0).forEach(function(s){fd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var Wu=2,KC=Wu/2;function FN(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function UN(e){return{x:e.x-KC,y:e.y-KC}}function WN(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function qN(e){return{x:Math.min(e.x,window.innerWidth-Wu),y:Math.min(e.y,window.innerHeight-Wu)}}function YC(e){var t=e.client,n=qN(WN(UN(FN(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Wu,height:Wu})}function XC(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 GN(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 $N(e){var t=e.initial,n=document.createElement("div");n.setAttribute(Ik,"true");var s=YC({client:t});Object.assign(n.style,$C($C({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},XC({clientRect:s})),{},{pointerEvents:"auto",zIndex:Bk})),document.body.appendChild(n);var o=Kl.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=YC({client:a}),Object.assign(n.style,XC({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),GN({client:a,clientRect:s})){n.remove();return}function l(){d(),n.remove()}var d=Kl.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 KN(){var e=null;function t(){return e=null,Kl.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=$N({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 YN(e){if(Array.isArray(e))return m_(e)}function XN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
31
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zk(e){return YN(e)||XN(e)||Mk(e)||QN()}function Ba(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 ZN=Ba(function(){return navigator.userAgent.includes("Firefox")}),hd=Ba(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),g_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function JN(e){var t=e.dragLeave;return hd()?t.hasOwnProperty(g_.isLeavingWindow):!1}(function(){if(typeof window>"u"||!hd())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function s(){n=t()}Kl.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[g_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[g_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function e7(e){return"nodeName"in e}function t7(e){return e7(e)&&e.ownerDocument!==document}function n7(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:hd()?JN({dragLeave:t}):s==null?!0:ZN()?t7(s):s instanceof HTMLIFrameElement}function r7(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 Au(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 s7=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},kv=s7(function(e){return e()}),th=(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 i7(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}}),th.schedule(function(){u({eventName:"onDragStart",payload:{source:t,location:p}})})},dragUpdate:function(l){var d=l.current;th.flush(),kv.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(l){var d=l.current;kv(function(){th.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;th.flush(),kv.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var v_={isActive:!1};function Hk(){return!v_.isActive}function o7(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function a7(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 l7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!Hk())return;var u=c7({event:t,dragType:n,getDropTargetsOver:s});v_.isActive=!0;var h={current:u};Tv({event:t,current:u.dropTargets});var a=i7({source:n.payload,dispatchEvent:o,initial:u});function l(x){var C=a7({current:h.current.dropTargets,next:x.dropTargets});h.current=x,C&&a.dragUpdate({current:h.current})}function d(x){var C=Au(x),w=jk(x.target)?Nk({x:C.clientX,y:C.clientY}):x.target,_=s({target:w,input:C,source:n.payload,current:h.current.dropTargets});_.length&&(x.preventDefault(),Tv({event:x,current:_})),l({dropTargets:_,input:C})}function p(){h.current.dropTargets.length&&l({dropTargets:[],input:h.current.input}),a.drop({current:h.current,updatedSourcePayload:null}),f()}function f(){v_.isActive=!1,g()}var g=Kl.bindAll(window,[{type:"dragover",listener:function(C){d(C),a.drag({current:h.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(C){n7({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:Au(C)},!h.current.dropTargets.length){p();return}C.preventDefault(),Tv({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:Au(C)},p()}}].concat(zk(r7({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:o7(t)})}function Tv(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 c7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=Au(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 QC={canStart:Hk,start:l7},__=new Map;function u7(e){var t=e.typeKey,n=e.mount,s=__.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return __.set(t,o),o}function d7(e){var t=u7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),__.delete(e.typeKey))}}function Ap(){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 Vk(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function ZC(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 Ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZC(Object(n),!0).forEach(function(s){fd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Lv(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f7(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.
|
|
32
|
+
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 f7(e,t){if(e){if(typeof e=="string")return JC(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)?JC(e,t):void 0}}function JC(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 Av(e){return e.slice(0).reverse()}function h7(e){var t=e.typeKey,n=e.defaultDropEffect,s=new WeakMap,o="data-drop-target-for-".concat(t),u="[".concat(o,"]");function h(x){return s.set(x.element,x),function(){return s.delete(x.element)}}function a(x){var C=Ap(Vk(x.element,{attribute:o,value:"true"}),h(x));return Ba(C)}function l(x){var C,w,_,y,v=x.source,b=x.target,E=x.input,T=x.result,A=T===void 0?[]:T;if(b==null)return A;if(!(b instanceof Element))return b instanceof Node?l({source:v,target:b.parentElement,input:E,result:A}):A;var M=b.closest(u);if(M==null)return A;var L=s.get(M);if(L==null)return A;var D={input:E,source:v,element:L.element};if(L.canDrop&&!L.canDrop(D))return l({source:v,target:L.element.parentElement,input:E,result:A});var H=(C=(w=L.getData)===null||w===void 0?void 0:w.call(L,D))!==null&&C!==void 0?C:{},z=(_=(y=L.getDropEffect)===null||y===void 0?void 0:y.call(L,D))!==null&&_!==void 0?_:n,q={data:H,element:L.element,dropEffect:z,isActiveDueToStickiness:!1};return l({source:v,target:L.element.parentElement,input:E,result:[].concat(zk(A),[q])})}function d(x){var C=x.eventName,w=x.payload,_=Lv(w.location.current.dropTargets),y;try{for(_.s();!(y=_.n()).done;){var v,b=y.value,E=s.get(b.element),T=Ji(Ji({},w),{},{self:b});E==null||(v=E[C])===null||v===void 0||v.call(E,T)}}catch(A){_.e(A)}finally{_.f()}}var p={onGenerateDragPreview:d,onDrag:d,onDragStart:d,onDrop:d,onDropTargetChange:function(C){var w=C.payload,_=new Set(w.location.current.dropTargets.map(function(G){return G.element})),y=new Set,v=Lv(w.location.previous.dropTargets),b;try{for(v.s();!(b=v.n()).done;){var E,T=b.value;y.add(T.element);var A=s.get(T.element),M=_.has(T.element),L=Ji(Ji({},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(G){v.e(G)}finally{v.f()}var H=Lv(w.location.current.dropTargets),z;try{for(H.s();!(z=H.n()).done;){var q,j,K=z.value;if(!y.has(K.element)){var $=Ji(Ji({},w),{},{self:K}),V=s.get(K.element);V==null||(q=V.onDropTargetChange)===null||q===void 0||q.call(V,$),V==null||(j=V.onDragEnter)===null||j===void 0||j.call(V,$)}}}catch(G){H.e(G)}finally{H.f()}}};function f(x){p[x.eventName](x)}function g(x){var C=x.source,w=x.target,_=x.input,y=x.current,v=l({source:C,target:w,input:_});if(v.length>=y.length)return v;for(var b=Av(y),E=Av(v),T=[],A=0;A<b.length;A++){var M,L=b[A],D=E[A];if(D!=null){T.push(D);continue}var H=T[A-1],z=b[A-1];if(H?.element!==z?.element)break;var q=s.get(L.element);if(!q)break;var j={input:_,source:C,element:q.element};if(q.canDrop&&!q.canDrop(j)||!((M=q.getIsSticky)!==null&&M!==void 0&&M.call(q,j)))break;T.push(Ji(Ji({},L),{},{isActiveDueToStickiness:!0}))}return Av(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function p7(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=m7(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.
|
|
33
|
+
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 m7(e,t){if(e){if(typeof e=="string")return ew(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)?ew(e,t):void 0}}function ew(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 tw(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 g7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tw(Object(n),!0).forEach(function(s){fd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function v7(){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=g7({},u);e.add(h),n(h);function a(){e.delete(h),t&&t.active.delete(h)}return Ba(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=p7(e),d;try{for(l.s();!(d=l.n()).done;){var p=d.value;n(p)}}catch(_){l.e(_)}finally{l.f()}}if(t){for(var f=Array.from(t.active),g=0,x=f;g<x.length;g++){var C=x[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 _7(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=v7(),a=h7({typeKey:t,defaultDropEffect:u});function l(f){s?.(f),a.dispatchEvent(f),h.dispatchEvent(f),o?.(f)}function d(f){var g=f.event,x=f.dragType;QC.start({event:g,dragType:x,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}function p(){function f(){var g={canStart:QC.canStart,start:d};return n(g)}return d7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var Fk=Ba(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),y7="pdnd:android-fallback",nw="text/plain",b7="text/uri-list",x7="application/vnd.pdnd",Uh=new WeakMap;function S7(e){return Uh.set(e.element,e),function(){Uh.delete(e.element)}}var rw=KN(),K0=_7({typeKey:"element",defaultDropEffect:"move",mount:function(t){return Ap(rw.bindEvents(),Kl.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=Uh.get(p);if(f){var g=Au(s),x={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:g};if(f.canDrag&&!f.canDrag(x)){s.preventDefault();return}if(f.dragHandle){var C=Nk({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,x))!==null&&u!==void 0?u:null;if(w)for(var _=0,y=Object.entries(w);_<y.length;_++){var v=Dk(y[_],2),b=v[0],E=v[1];s.dataTransfer.setData(b,E??"")}Fk()&&!s.dataTransfer.types.includes(nw)&&!s.dataTransfer.types.includes(b7)&&s.dataTransfer.setData(nw,y7),s.dataTransfer.setData(x7,"");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,x))!==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=Uh.get(u.source.element))===null||n===void 0||(s=n[o])===null||s===void 0||s.call(n,u)},onPostDispatch:rw.getOnPostDispatch()}),Y0=K0.dropTarget,Uk=K0.monitor;function C7(e){var t=Ap(K0.registerUsage(),S7(e),Vk(e.element,{attribute:"draggable",value:"true"}));return Ba(t)}function sw(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 iw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sw(Object(n),!0).forEach(function(s){fd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sw(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var w7={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)}},Wk=Symbol("closestEdge");function E7(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:w7[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 iw(iw({},e),{},fd({},Wk,p))}function y_(e){var t;return(t=e[Wk])!==null&&t!==void 0?t:null}function R7(){return{x:0,y:0}}function k7(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?R7:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:Bk,pointerEvents:"none"}),document.body.append(u);var h=t({container:u});queueMicrotask(function(){var d=o({container:u});if(hd()){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=Uk({onDragStart:a,onDrop:a})}var T7=Ba(function(){return hd()&&"ontouchend"in document}),L7=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function A7(e){return function(n){var s=n.container;if(T7()||Fk())return L7({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 qk=k.forwardRef(({className:e,...t},n)=>S.jsx(JP,{ref:n,className:ze("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:S.jsx(e9,{className:"flex items-center justify-center",children:S.jsx(Se,{icon:La,size:12,strokeWidth:3})})}));qk.displayName="Checkbox";const Gk=k.createContext(null);function O7({children:e}){const[t,n]=k.useState(!1),[s,o]=k.useState(new Set),u=k.useCallback(p=>{o(f=>{const g=new Set(f);return g.has(p)?g.delete(p):g.add(p),g})},[]),h=k.useCallback(p=>{o(new Set(p))},[]),a=k.useCallback(()=>{o(new Set)},[]),l=k.useCallback(()=>{n(!1),o(new Set)},[]),d=k.useCallback(p=>s.has(p),[s]);return S.jsx(Gk.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:l,selectedCount:s.size},children:e})}function $k(){const e=k.useContext(Gk);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const Kk=k.createContext(null);function M7({children:e}){const[t,n]=k.useState(null);return S.jsx(Kk.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function Yk(){const e=k.useContext(Kk);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function D7(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function Xk({task:e,open:t,onOpenChange:n}){const s=N0(),[o,u]=k.useState(e.title),[h,a]=k.useState(e.description||""),[l,d]=k.useState(e.prUrl||""),[p,f]=k.useState(e.linearTicketUrl||"");k.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 _=h.trim();_!==(e.description||"")&&(C.description=_);const y=l.trim();y!==(e.prUrl||"")&&(C.prUrl=y||null);const v=p.trim();v!==(e.linearTicketUrl||"")&&(C.linearTicketUrl=v||null,C.linearTicketId=v?D7(v):null),Object.keys(C).length>0&&s.mutate({taskId:e.id,updates:C}),n(!1)},x=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return S.jsx(_s,{open:t,onOpenChange:n,children:S.jsxs(ys,{className:"sm:max-w-md",onKeyDown:x,children:[S.jsx(js,{children:S.jsx(Ns,{children:"Task Settings"})}),S.jsxs(id,{className:"mt-4",children:[S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"config-title",children:"Title"}),S.jsx(Wt,{id:"config-title",value:o,onChange:C=>u(C.target.value),autoFocus:!0})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"config-description",children:"Description"}),S.jsx(Sp,{id:"config-description",value:h,onChange:C=>a(C.target.value),rows:3})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),S.jsx(Wt,{id:"config-pr-url",value:l,onChange:C=>d(C.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),S.jsx(Wt,{id:"config-linear-url",value:p,onChange:C=>f(C.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]})]}),S.jsxs(po,{className:"mt-4",children:[S.jsx(je,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),S.jsx(je,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function Qk({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=$k(),{setActiveTask:u}=Yk(),h=s(e.id),a=_o(),l=k.useRef(null),[d,p]=k.useState(!1),[f,g]=k.useState(null),[x,C]=k.useState(null),[w,_]=k.useState(!1),y=k.useRef(!1);k.useEffect(()=>{const T=l.current;if(!(!T||n||t))return Ap(C7({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{k7({nativeSetDragImage:A,getOffset:A7({x:"16px",y:"8px"}),render:({container:M})=>{C(M)}})},onDragStart:()=>{p(!0),u(e),y.current=!0},onDrop:()=>{p(!1),u(null),C(null)}}),Y0({element:T,getData:({input:A,element:M})=>{const L={type:"task",taskId:e.id,status:e.status};return E7(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(y_(A.data))},onDrag:({self:A})=>{g(y_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const v=()=>{y.current=!1},b=T=>{if(n){T.preventDefault(),o(e.id);return}y.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),y.current=!1},E=S.jsxs(ud,{ref:t?void 0:l,onPointerDown:v,onClick:b,className:ze("transition-shadow hover:shadow-md relative",n?"cursor-pointer":"cursor-grab active:cursor-grabbing",d&&"opacity-50",h&&"ring-2 ring-primary"),children:[f&&S.jsx("div",{className:ze("absolute left-0 right-0 h-0.5 bg-primary z-10",f==="top"&&"-top-1",f==="bottom"&&"-bottom-1")}),n&&S.jsx("div",{className:"absolute right-2 top-2 z-10 cursor-pointer",onClick:T=>{T.stopPropagation(),o(e.id)},children:S.jsx(qk,{checked:h,className:"cursor-pointer pointer-events-none"})}),S.jsxs(Aj,{className:ze("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[S.jsx(Oj,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!n&&!t&&S.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(),_(!0)},onPointerDown:T=>T.stopPropagation(),children:S.jsx(Se,{icon:$2,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),S.jsxs(dd,{className:"p-3 pt-1",children:[e.description&&S.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),S.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[S.jsx(Se,{icon:Ss,size:12,strokeWidth:2}),S.jsx("span",{children:e.repoName}),e.prUrl&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-muted-foreground/30",children:"•"}),S.jsx(Se,{icon:J_,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-muted-foreground/30",children:"•"}),S.jsx(Se,{icon:e0,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]});return S.jsxs(S.Fragment,{children:[E,x&&er.createPortal(S.jsx("div",{className:"w-72",children:S.jsx(Qk,{task:e,isDragPreview:!0})}),x),S.jsx(Xk,{task:e,open:w,onOpenChange:_})]})}const P7={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},I7={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function ow({status:e,tasks:t,isMobile:n}){const s=k.useRef(null),[o,u]=k.useState(!1),h=[...t].sort((a,l)=>a.position-l.position);return k.useEffect(()=>{const a=s.current;if(a)return Y0({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:l})=>l.data.type==="task",onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:()=>u(!1)})},[e]),S.jsxs("div",{ref:s,className:ze("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 flex-shrink-0",I7[e],o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[S.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[S.jsx("h3",{className:"text-sm font-medium",children:P7[e]}),S.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})]}),S.jsx(cd,{className:"min-h-0 flex-1",children:S.jsx("div",{className:"flex flex-col gap-2 p-2",children:h.map(a=>S.jsx(Qk,{task:a},a.id))})})]})}const Ov=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],Zk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function j7({status:e}){const t=k.useRef(null),[n,s]=k.useState(!1);return k.useEffect(()=>{const o=t.current;if(o)return Y0({element:o,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),S.jsx("div",{ref:t,className:ze("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:Zk[e]})}function N7({repoFilter:e}){const{data:t=[],isLoading:n}=j0(),s=cI(),{activeTask:o}=Yk(),[u,h]=k.useState("IN_PROGRESS"),a=k.useMemo(()=>e?t.filter(d=>d.repoName===e):t,[t,e]),l=k.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 k.useEffect(()=>Uk({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,x=a.find(_=>_.id===g);if(!x)return;const C=f[0],w=C.data;if(w.type==="column"){const _=w.status;if(_!==x.status){const y=a.filter(v=>v.status===_);s.mutate({taskId:g,status:_,position:y.length})}}else if(w.type==="task"){const _=y_(C.data),y=w.status,v=a.filter(T=>T.status===y).sort((T,A)=>T.position-A.position),b=v.findIndex(T=>T.id===w.taskId);let E=b;_==="bottom"&&(E=b+1),x.status===y&&v.findIndex(A=>A.id===g)<b&&(E=Math.max(0,E-1)),(x.status!==y||E!==x.position)&&s.mutate({taskId:g,status:y,position:E})}}}),[a,s]),n?S.jsx("div",{className:"flex h-full items-center justify-center",children:S.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsx("div",{className:"border-b lg:hidden",children:S.jsx(Cp,{value:u,onValueChange:d=>h(d),children:S.jsx(wp,{variant:"line",className:"w-full justify-start px-4",children:Ov.map(d=>S.jsxs(mo,{value:d,className:"gap-1.5",children:[S.jsx("span",{className:"truncate",children:Zk[d]}),S.jsx("span",{className:"text-muted-foreground",children:l[d]})]},d))})})}),S.jsx("div",{className:"pixel-grid hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:Ov.map(d=>S.jsx(ow,{status:d,tasks:a.filter(p=>p.status===d)},d))}),S.jsx("div",{className:"pixel-grid flex-1 overflow-y-auto p-4 lg:hidden",children:S.jsx(ow,{status:u,tasks:a.filter(d=>d.status===u),isMobile:!0})}),o&&S.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:Ov.filter(d=>d!==u).map(d=>S.jsx(j7,{status:d},d))})]})}function B7(e){return S.jsx(M7,{children:S.jsx(N7,{...e})})}const z7=xs("/tasks/")({component:H7});function H7(){return S.jsx(O7,{children:S.jsx(V7,{})})}function V7(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=$k(),u=dI(),{data:h=[]}=j0(),[a,l]=k.useState(null),d=k.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 S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:e?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-medium",children:s>0?`${s} selected`:"Select tasks"}),S.jsxs(je,{variant:"ghost",size:"sm",onClick:o,children:[S.jsx(Se,{icon:vo,size:14,strokeWidth:2,"data-slot":"icon"}),"Cancel"]})]}),S.jsxs(oc,{children:[S.jsxs(ac,{render:S.jsx(je,{variant:"destructive",size:"sm",disabled:u.isPending||s===0}),children:[S.jsx(Se,{icon:Xu,size:14,strokeWidth:2,"data-slot":"icon"}),u.isPending?"Deleting...":`Delete${s>0?` (${s})`:""}`]}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsxs(dc,{children:["Delete ",s," Tasks"]}),S.jsx(fc,{children:"This will permanently delete the selected tasks and remove their worktrees. This action cannot be undone."})]}),S.jsxs(uc,{children:[S.jsx(hc,{children:"Cancel"}),S.jsx(ck,{onClick:p,variant:"destructive",disabled:u.isPending,children:u.isPending?"Deleting...":"Delete All"})]})]})]})]}):S.jsxs(S.Fragment,{children:[S.jsx("h1",{className:"text-sm font-medium",children:"Tasks"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs(Dl,{value:a??"",onValueChange:f=>l(f||null),children:[S.jsxs(Il,{size:"sm",className:"min-w-[120px]",children:[S.jsx(Se,{icon:F2,size:12,strokeWidth:2,className:"text-muted-foreground"}),S.jsx(Pl,{children:a||"All Repos"})]}),S.jsxs(jl,{className:"min-w-[200px]",children:[S.jsx(pr,{value:"",children:"All Repos"}),d.map(f=>S.jsx(pr,{value:f,children:f},f))]})]}),S.jsxs(je,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:[S.jsx(Se,{icon:qM,size:14,strokeWidth:2,"data-slot":"icon"}),"Select"]})]})]})}),S.jsx("div",{className:"flex-1 overflow-hidden",children:S.jsx(B7,{repoFilter:a})})]})}const F7=xs("/settings/")({component:U7});function _u({title:e,children:t}){return S.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-4 pt-6",children:[S.jsx("span",{className:"absolute -top-2.5 left-3 bg-card px-2 text-xs font-medium text-muted-foreground",children:e}),t]})}function U7(){const{data:e,isLoading:t}=bI(),{data:n,isLoading:s}=B0(),{data:o,isLoading:u}=tk(),{data:h,isLoading:a}=Tp(),{data:l,isLoading:d}=Lp(),{data:p,isLoading:f}=xI(),{data:g,isLoading:x}=SI(),{data:C,isLoading:w}=EI(),_=CI(),y=wI(),v=RI(),b=kI(),[E,T]=k.useState(""),[A,M]=k.useState(""),[L,D]=k.useState(""),[H,z]=k.useState(""),[q,j]=k.useState(""),[K,$]=k.useState(""),[V,G]=k.useState(""),[U,P]=k.useState(!1),[B,I]=k.useState(!1),[W,Y]=k.useState(!1),[J,Z]=k.useState(!1),[ee,X]=k.useState(!1),[F,se]=k.useState(""),[ne,re]=k.useState(!1),[oe,le]=k.useState(""),[_e,ve]=k.useState(!1),[he,ue]=k.useState(""),[Ie,Me]=k.useState("");k.useEffect(()=>{e!==void 0&&T(String(e)),n!==void 0&&M(n),o!==void 0&&D(o),h!==void 0&&z(h),l!==void 0&&j(String(l)),p!==void 0&&$(p),g!==void 0&&G(g)},[e,n,o,h,l,p,g]),k.useEffect(()=>{C&&(Y(C.enabled),Z(C.sound?.enabled??!1),X(C.slack?.enabled??!1),se(C.slack?.webhookUrl??""),re(C.discord?.enabled??!1),le(C.discord?.webhookUrl??""),ve(C.pushover?.enabled??!1),ue(C.pushover?.appToken??""),Me(C.pushover?.userKey??""))},[C]);const Ae=t||s||u||a||d||f||x||w,be=C&&(W!==C.enabled||J!==(C.sound?.enabled??!1)||ee!==(C.slack?.enabled??!1)||F!==(C.slack?.webhookUrl??"")||ne!==(C.discord?.enabled??!1)||oe!==(C.discord?.webhookUrl??"")||_e!==(C.pushover?.enabled??!1)||he!==(C.pushover?.appToken??"")||Ie!==(C.pushover?.userKey??"")),Oe=E!==String(e)||A!==n||L!==o||H!==h||q!==String(l)||K!==p||V!==g||be,me=async()=>{const Ce=[];if(E!==String(e)){const Be=parseInt(E,10);!isNaN(Be)&&Be>=1&&Be<=65535&&Ce.push(new Promise(Re=>{_.mutate({key:ln.PORT,value:Be},{onSettled:Re})}))}if(A!==n&&Ce.push(new Promise(Be=>{_.mutate({key:ln.DEFAULT_GIT_REPOS_DIR,value:A},{onSettled:Be})})),L!==o&&Ce.push(new Promise(Be=>{_.mutate({key:ln.TASK_CREATION_COMMAND,value:L},{onSettled:Be})})),H!==h&&Ce.push(new Promise(Be=>{_.mutate({key:ln.HOSTNAME,value:H},{onSettled:Be})})),q!==String(l)){const Be=parseInt(q,10);!isNaN(Be)&&Be>=1&&Be<=65535&&Ce.push(new Promise(Re=>{_.mutate({key:ln.SSH_PORT,value:Be},{onSettled:Re})}))}K!==p&&Ce.push(new Promise(Be=>{_.mutate({key:ln.LINEAR_API_KEY,value:K},{onSettled:Be})})),V!==g&&Ce.push(new Promise(Be=>{_.mutate({key:ln.GITHUB_PAT,value:V},{onSettled:Be})})),be&&Ce.push(new Promise(Be=>{v.mutate({enabled:W,sound:{enabled:J},slack:{enabled:ee,webhookUrl:F},discord:{enabled:ne,webhookUrl:oe},pushover:{enabled:_e,appToken:he,userKey:Ie}},{onSettled:Be})})),await Promise.all(Ce),I(!0),setTimeout(()=>I(!1),2e3)},de=()=>{y.mutate(ln.PORT,{onSuccess:Ce=>{Ce.value!==null&&T(String(Ce.value))}})},xe=()=>{y.mutate(ln.DEFAULT_GIT_REPOS_DIR,{onSuccess:Ce=>{Ce.value&&M(String(Ce.value))}})},We=()=>{y.mutate(ln.TASK_CREATION_COMMAND,{onSuccess:Ce=>{Ce.value!==null&&Ce.value!==void 0&&D(String(Ce.value))}})},nt=()=>{y.mutate(ln.HOSTNAME,{onSuccess:Ce=>{Ce.value!==null&&Ce.value!==void 0&&z(String(Ce.value))}})},Ve=()=>{y.mutate(ln.SSH_PORT,{onSuccess:Ce=>{Ce.value!==null&&Ce.value!==void 0&&j(String(Ce.value))}})},rt=()=>{y.mutate(ln.LINEAR_API_KEY,{onSuccess:Ce=>{$(Ce.value!==null&&Ce.value!==void 0?String(Ce.value):"")}})},Je=()=>{y.mutate(ln.GITHUB_PAT,{onSuccess:Ce=>{G(Ce.value!==null&&Ce.value!==void 0?String(Ce.value):"")}})},dt=async Ce=>{b.mutate(Ce,{onSuccess:Be=>{Be.success?Ir.success(`${Ce} test successful`):Ir.error(`${Ce} test failed: ${Be.error}`)},onError:Be=>{Ir.error(`Test failed: ${Be.message}`)}})};return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:S.jsx("h1",{className:"text-sm font-medium",children:"Settings"})}),S.jsx("div",{className:"pixel-grid flex-1 overflow-auto p-6",children:S.jsxs("div",{className:"mx-auto max-w-5xl space-y-4",children:[S.jsx(_u,{title:"Server & Defaults",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-32 shrink-0 text-sm text-muted-foreground",children:"Port"}),S.jsx(Wt,{type:"number",min:1,max:65535,value:E,onChange:Ce=>T(Ce.target.value),placeholder:"3333",disabled:Ae,className:"w-24 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:de,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-32 pl-2 text-xs text-muted-foreground",children:"Requires restart"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-32 shrink-0 text-sm text-muted-foreground",children:"Startup Command"}),S.jsx(Wt,{value:L,onChange:Ce=>D(Ce.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:Ae,className:"flex-1 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:We,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-32 pl-2 text-xs text-muted-foreground",children:"Command for new task terminals"})]})]})}),S.jsx(_u,{title:"Paths",children:S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-32 shrink-0 text-sm text-muted-foreground",children:"Git Repos Directory"}),S.jsx(Wt,{value:A,onChange:Ce=>M(Ce.target.value),placeholder:"~/projects",disabled:Ae,className:"flex-1 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>P(!0),disabled:Ae,title:"Browse",children:S.jsx(Se,{icon:Ss,size:14,strokeWidth:2})}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:xe,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-32 pl-2 text-xs text-muted-foreground",children:"Starting directory for repo picker"})]})}),S.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[S.jsx(_u,{title:"Remote Access",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-20 shrink-0 text-sm text-muted-foreground",children:"Hostname"}),S.jsx(Wt,{value:H,onChange:Ce=>z(Ce.target.value),placeholder:"e.g., citadel",disabled:Ae,className:"flex-1 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:nt,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-20 pl-2 text-xs text-muted-foreground",children:"For VS Code SSH URLs"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-20 shrink-0 text-sm text-muted-foreground",children:"SSH Port"}),S.jsx(Wt,{type:"number",min:1,max:65535,value:q,onChange:Ce=>j(Ce.target.value),placeholder:"22",disabled:Ae,className:"w-20 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ve,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-20 pl-2 text-xs text-muted-foreground",children:"Remote connection port"})]})]})}),S.jsx(_u,{title:"Integrations",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-20 shrink-0 text-sm text-muted-foreground",children:"Linear"}),S.jsx(Wt,{type:"password",value:K,onChange:Ce=>$(Ce.target.value),placeholder:"lin_api_...",disabled:Ae,className:"flex-1 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:rt,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-20 pl-2 text-xs text-muted-foreground",children:"API key for ticket sync"})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-20 shrink-0 text-sm text-muted-foreground",children:"GitHub"}),S.jsx(Wt,{type:"password",value:V,onChange:Ce=>G(Ce.target.value),placeholder:"ghp_...",disabled:Ae,className:"flex-1 font-mono text-sm"}),S.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Je,disabled:Ae||y.isPending,title:"Reset to default",children:S.jsx(Se,{icon:qo,size:14,strokeWidth:2})})]}),S.jsx("p",{className:"ml-20 pl-2 text-xs text-muted-foreground",children:"PAT for Issues & PRs"})]})]})})]}),S.jsx(_u,{title:"Notifications",children:S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Enable Notifications"}),S.jsx(Zo,{checked:W,onCheckedChange:Y,disabled:Ae})]}),S.jsx("div",{className:"space-y-2 pl-4",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Zo,{checked:J,onCheckedChange:Z,disabled:Ae||!W}),S.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),S.jsx(je,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("sound"),disabled:Ae||!W||!J||b.isPending,title:"Test sound",children:b.isPending?S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}):S.jsx(Se,{icon:Nf,size:14,strokeWidth:2})})]})}),S.jsxs("div",{className:"space-y-2 pl-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Zo,{checked:ee,onCheckedChange:X,disabled:Ae||!W}),S.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),S.jsx(je,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("slack"),disabled:Ae||!W||!ee||!F||b.isPending,title:"Test Slack",children:b.isPending?S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}):S.jsx(Se,{icon:Nf,size:14,strokeWidth:2})})]}),ee&&S.jsx(Wt,{type:"password",value:F,onChange:Ce=>se(Ce.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Ae||!W,className:"ml-6 flex-1 font-mono text-sm"})]}),S.jsxs("div",{className:"space-y-2 pl-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Zo,{checked:ne,onCheckedChange:re,disabled:Ae||!W}),S.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),S.jsx(je,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("discord"),disabled:Ae||!W||!ne||!oe||b.isPending,title:"Test Discord",children:b.isPending?S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}):S.jsx(Se,{icon:Nf,size:14,strokeWidth:2})})]}),ne&&S.jsx(Wt,{type:"password",value:oe,onChange:Ce=>le(Ce.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Ae||!W,className:"ml-6 flex-1 font-mono text-sm"})]}),S.jsxs("div",{className:"space-y-2 pl-4",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Zo,{checked:_e,onCheckedChange:ve,disabled:Ae||!W}),S.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),S.jsx(je,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>dt("pushover"),disabled:Ae||!W||!_e||!he||!Ie||b.isPending,title:"Test Pushover",children:b.isPending?S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}):S.jsx(Se,{icon:Nf,size:14,strokeWidth:2})})]}),_e&&S.jsxs("div",{className:"ml-6 space-y-2",children:[S.jsx(Wt,{type:"password",value:he,onChange:Ce=>ue(Ce.target.value),placeholder:"App Token",disabled:Ae||!W,className:"flex-1 font-mono text-sm"}),S.jsx(Wt,{type:"password",value:Ie,onChange:Ce=>Me(Ce.target.value),placeholder:"User Key",disabled:Ae||!W,className:"flex-1 font-mono text-sm"})]})]})]})}),S.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[B&&S.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[S.jsx(Se,{icon:La,size:12,strokeWidth:2}),"Saved"]}),S.jsx(je,{size:"sm",onClick:me,disabled:!Oe||Ae||_.isPending,children:"Save Changes"})]})]})}),S.jsx(H0,{open:U,onOpenChange:P,onSelect:Ce=>M(Ce),initialPath:A||void 0})]})}const Op="";function W7(){return Kn({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${Op}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function q7(){return Kn({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${Op}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function G7(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(`${Op}/api/github/issues?${s}`);if(!o.ok)throw new Error("Failed to fetch issues");return o.json()},staleTime:300*1e3})}function $7(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(`${Op}/api/github/prs?${s}`);if(!o.ok)throw new Error("Failed to fetch PRs");return o.json()},staleTime:300*1e3})}function K7({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=G7(e,t,n);if(o)return S.jsx("div",{className:"flex h-48 items-center justify-center",children:S.jsx(Se,{icon:Nr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return S.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[S.jsx(Se,{icon:Jl,size:24}),S.jsx("p",{className:"text-sm",children:"Failed to load issues"}),S.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?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),S.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=>S.jsx(Y7,{issue:a},a.id))})]}):S.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[S.jsx(Se,{icon:La,size:24}),S.jsx("p",{className:"text-sm",children:h[e]})]})}function Y7({issue:e}){return S.jsx(ud,{className:"transition-colors hover:border-border/80",children:S.jsx(dd,{className:"py-4",children:S.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[S.jsx("div",{className:"flex items-start gap-2",children:S.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),S.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:S.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&S.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>S.jsx(va,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&S.jsxs(va,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function X7({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=$7(e,t,n);if(o)return S.jsx("div",{className:"flex h-48 items-center justify-center",children:S.jsx(Se,{icon:Nr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return S.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[S.jsx(Se,{icon:Jl,size:24}),S.jsx("p",{className:"text-sm",children:"Failed to load pull requests"}),S.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?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),S.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=>S.jsx(Q7,{pr:a},a.id))})]}):S.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[S.jsx(Se,{icon:La,size:24}),S.jsx("p",{className:"text-sm",children:h[e]})]})}function Q7({pr:e}){return S.jsx(ud,{className:"transition-colors hover:border-border/80",children:S.jsx(dd,{className:"py-4",children:S.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[S.jsx("div",{className:"flex items-start gap-2",children:S.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[S.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&S.jsx(va,{variant:"secondary",className:ze("text-xs","bg-amber-400/20 text-amber-600 dark:text-amber-400"),children:"Draft"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&S.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),S.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&S.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>S.jsx(va,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&S.jsxs(va,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const Z7=xs("/review/")({component:J7});function J7(){const[e,t]=k.useState("prs"),[n,s]=k.useState("review_requested"),[o,u]=k.useState("assigned"),[h,a]=k.useState(!1),[l,d]=k.useState(""),{data:p,isLoading:f}=W7(),{data:g=[]}=q7();return!f&&!p?S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsx("div",{className:"flex shrink-0 items-center border-b border-border px-4 py-2",children:S.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),S.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:S.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[S.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:S.jsx(Se,{icon:r4,size:24,className:"text-muted-foreground"})}),S.jsx("h2",{className:"text-lg font-medium",children:"GitHub Token Required"}),S.jsx("p",{className:"text-sm text-muted-foreground",children:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings."}),S.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[S.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Required scopes:"}),S.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[S.jsxs("li",{children:["• ",S.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," (for private repositories)"]}),S.jsxs("li",{children:["• ",S.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," (for user info)"]}),S.jsxs("li",{children:["• ",S.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," (for organization list)"]})]})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:S.jsxs(je,{variant:"outline",size:"sm",className:"w-full",children:[S.jsx(Se,{icon:s4,size:14,"data-slot":"icon"}),"Generate Token"]})}),S.jsx(qn,{to:"/settings",children:S.jsx(je,{size:"sm",className:"w-full",children:"Go to Settings"})})]})]})})]}):S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[S.jsx("div",{className:"flex items-center gap-4",children:S.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),S.jsxs("div",{className:"flex items-center gap-4",children:[e==="prs"?S.jsxs(Dl,{value:n,onValueChange:x=>s(x),children:[S.jsx(Il,{size:"sm",className:"min-w-[160px]",children:S.jsx(Pl,{})}),S.jsxs(jl,{children:[S.jsx(pr,{value:"created",children:"Created by me"}),S.jsx(pr,{value:"assigned",children:"Assigned to me"}),S.jsx(pr,{value:"review_requested",children:"Review requests"}),S.jsx(pr,{value:"mentioned",children:"Mentioned"})]})]}):S.jsxs(Dl,{value:o,onValueChange:x=>u(x),children:[S.jsx(Il,{size:"sm",className:"min-w-[160px]",children:S.jsx(Pl,{})}),S.jsxs(jl,{children:[S.jsx(pr,{value:"assigned",children:"Assigned to me"}),S.jsx(pr,{value:"created",children:"Created by me"}),S.jsx(pr,{value:"mentioned",children:"Mentioned"})]})]}),S.jsxs(Dl,{value:l,onValueChange:x=>d(x||""),children:[S.jsx(Il,{size:"sm",className:"min-w-[140px]",children:S.jsx(Pl,{children:l||"All Orgs"})}),S.jsxs(jl,{children:[S.jsx(pr,{value:"",children:"All Organizations"}),g.map(x=>S.jsx(pr,{value:x.login,children:x.login},x.login))]})]}),S.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[S.jsx(Zo,{checked:h,onCheckedChange:a,disabled:!!l}),S.jsx("span",{className:"text-muted-foreground",children:"Vibora repos only"})]})]})]}),S.jsxs(Cp,{value:e,onValueChange:x=>t(x),className:"flex flex-1 flex-col overflow-hidden",children:[S.jsx("div",{className:"shrink-0 border-b border-border px-4",children:S.jsxs(wp,{variant:"line",children:[S.jsx(mo,{value:"prs",children:"Pull Requests"}),S.jsx(mo,{value:"issues",children:"Issues"})]})}),S.jsx(ga,{value:"prs",className:"flex-1 overflow-auto p-4",children:S.jsx(X7,{filter:n,viboraReposOnly:h,org:l||void 0})}),S.jsx(ga,{value:"issues",className:"flex-1 overflow-auto p-4",children:S.jsx(K7,{filter:o,viboraReposOnly:h,org:l||void 0})})]})]})}function Wh(e,t,n){return t?`vscode://vscode-remote/ssh-remote+${n!==22?`${t}:${n}`:t}${e}`:`vscode://file${e}`}const eB=xs("/repositories/")({component:rB});function tB({repository:e,onDelete:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(!1),{data:h}=Tp(),{data:a}=Lp(),l=p=>{p.preventDefault(),p.stopPropagation();const f=Wh(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 S.jsx(qn,{to:"/repositories/$repoId",params:{repoId:e.id},children:S.jsx(ud,{className:"transition-colors hover:border-border/80 cursor-pointer",children:S.jsxs(dd,{className:"flex flex-col gap-2 py-4",children:[S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[S.jsx("span",{className:"truncate font-medium",children:e.displayName}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:l,className:"shrink-0 text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:S.jsx(Se,{icon:t0,size:14,strokeWidth:2})})]}),S.jsx("div",{onClick:p=>p.preventDefault(),children:S.jsxs(oc,{open:n,onOpenChange:s,children:[S.jsx(ac,{render:S.jsx(je,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:p=>p.stopPropagation()}),children:S.jsx(Se,{icon:Xu,size:14,strokeWidth:2})}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsx(dc,{children:"Delete Repository"}),S.jsxs(fc,{children:['This will remove "',e.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),S.jsxs(uc,{children:[S.jsx(hc,{disabled:o,children:"Cancel"}),S.jsxs(je,{variant:"destructive",onClick:d,disabled:o,className:"gap-2",children:[o&&S.jsx(Se,{icon:Nr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})})]}),S.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:Ss,size:12,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{className:"truncate font-mono",children:e.path})]}),e.startupScript&&S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:Z_,size:12,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{className:"truncate font-mono",children:e.startupScript})]}),e.copyFiles&&S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Se,{icon:YM,size:12,strokeWidth:2,className:"shrink-0"}),S.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]})})})}function nB(){const[e,t]=k.useState(!1),[n,s]=k.useState(!1),[o,u]=k.useState(""),[h,a]=k.useState(""),[l,d]=k.useState(""),[p,f]=k.useState(""),g=nk(),{data:x}=B0(),C=y=>{u(y),h||a(y.split("/").pop()||"")},w=y=>{y.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("")}})},_=o?o.split("/").pop():"";return S.jsxs(S.Fragment,{children:[S.jsxs(_s,{open:e,onOpenChange:t,children:[S.jsxs(sR,{render:S.jsx(je,{size:"sm"}),children:[S.jsx(Se,{icon:ec,size:16,strokeWidth:2,"data-slot":"icon"}),"Add Repository"]}),S.jsx(ys,{className:"sm:max-w-md",children:S.jsxs("form",{onSubmit:w,children:[S.jsxs(js,{children:[S.jsx(Ns,{children:"Add Repository"}),S.jsx(ia,{children:"Add a git repository for quick access when creating tasks."})]}),S.jsxs(id,{className:"mt-4",children:[S.jsxs(Cn,{children:[S.jsx(wn,{children:"Repository Path"}),S.jsxs(je,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>s(!0),children:[S.jsx(Se,{icon:Ss,size:14,strokeWidth:2,className:"mr-2"}),_?S.jsx("span",{className:"truncate",children:o}):S.jsx("span",{className:"text-muted-foreground",children:"Select repository..."})]})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),S.jsx(Wt,{id:"displayName",value:h,onChange:y=>a(y.target.value),placeholder:_||"My Project"})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),S.jsx(Sp,{id:"startupScript",value:l,onChange:y=>d(y.target.value),placeholder:"npm install && npm run dev",rows:2}),S.jsx(so,{children:"Command to run in the terminal when creating a worktree."})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),S.jsx(Wt,{id:"copyFiles",value:p,onChange:y=>f(y.target.value),placeholder:".env, config.local.json"}),S.jsx(so,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]}),S.jsxs(po,{className:"mt-4",children:[S.jsx(S0,{render:S.jsx(je,{variant:"outline",type:"button"}),children:"Cancel"}),S.jsx(je,{type:"submit",disabled:g.isPending||!o.trim(),children:g.isPending?"Adding...":"Add Repository"})]})]})})]}),S.jsx(H0,{open:n,onOpenChange:s,onSelect:C,initialPath:x||void 0})]})}function rB(){const{data:e,isLoading:t,error:n}=z0(),s=rk(),o=async u=>{await s.mutateAsync(u)};return S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("h1",{className:"text-sm font-medium",children:"Repositories"}),e&&S.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.length," total"]})]}),S.jsx(nB,{})]}),S.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[t&&S.jsx("div",{className:"flex items-center justify-center py-12",children:S.jsx(Se,{icon:Nr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),n&&S.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[S.jsx(Se,{icon:Jl,size:20,strokeWidth:2}),S.jsxs("span",{className:"text-sm",children:["Failed to load repositories: ",n.message]})]}),!t&&!n&&e?.length===0&&S.jsx("div",{className:"py-12 text-muted-foreground",children:S.jsx("p",{className:"text-sm",children:"No repositories added yet. Add a repository for quick access when creating tasks."})}),S.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e?.map(u=>S.jsx(tB,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const sB=()=>`http://${window.location.hostname}:3000`,yu={activeTab:"diff",browserUrl:sB(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1},filesViewState:{selectedFile:null,expandedDirs:[]}};function Mp(e){const t=$n(),n=k.useRef(void 0),s=k.useRef({}),{data:o}=JR(e),u=k.useMemo(()=>{const g=o?.viewState;return g?{activeTab:g.activeTab??yu.activeTab,browserUrl:g.browserUrl??yu.browserUrl,diffOptions:{...yu.diffOptions,...g.diffOptions},filesViewState:{...yu.filesViewState,...g.filesViewState}}:yu},[o?.viewState]),h=Bn({mutationFn:async g=>{const x=await fetch(`/api/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({viewState:g})});if(!x.ok)throw new Error("Failed to update view state");return x.json()},onSuccess:g=>{t.setQueryData(["tasks",e],g),t.setQueryData(["tasks"],x=>x&&x.map(C=>C.id===e?g:C))}}),a=k.useCallback(g=>{const x=s.current;s.current={...x,...g,diffOptions:g.diffOptions||x.diffOptions?{...x.diffOptions,...g.diffOptions}:void 0,filesViewState:g.filesViewState||x.filesViewState?{...x.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],_=>_&&{..._,viewState:w}),t.setQueryData(["tasks"],_=>_&&_.map(y=>y.id===e?{...y,viewState:w}:y)),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{h.mutate(w),s.current={}},500)},[t,e,u,h]),l=k.useCallback(g=>{a({activeTab:g})},[a]),d=k.useCallback(g=>{a({browserUrl:g})},[a]),p=k.useCallback(g=>{a({diffOptions:g})},[a]),f=k.useCallback(g=>{a({filesViewState:g})},[a]);return{viewState:u,setActiveTab:l,setBrowserUrl:d,setDiffOptions:p,setFilesViewState:f}}function iB(e){const{viewState:t,setActiveTab:n}=Mp(e);return{tab:t.activeTab,setTab:n}}function oB(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 aB({taskName:e,cwd:t,className:n,aiMode:s,description:o,startupScript:u}){const h=k.useRef(null),a=k.useRef(null),l=k.useRef(null),d=k.useRef(!1),p=k.useRef(!1),[f,g]=k.useState(null),[x,C]=k.useState(!1),{data:w}=tk(),{setTerminalFocused:_}=V0(),{terminals:y,terminalsLoaded:v,connected:b,newTerminalIds:E,createTerminal:T,attachXterm:A,resizeTerminal:M,setupImagePaste:L,writeToTerminal:D}=$0(),H=f?y.find(j=>j.id===f):null,z=H?.status;k.useEffect(()=>{if(!h.current||a.current)return;const j=new Rk.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 kk.FitAddon,$=new Tk.WebLinksAddon;j.loadAddon(K),j.loadAddon($),j.open(h.current),a.current=j,l.current=K,requestAnimationFrame(()=>{K.fit(),C(!0)});const V=setTimeout(()=>{K.fit(),j.refresh(0,j.rows-1)},100),G=()=>_(!0),U=()=>_(!1);return j.textarea&&(j.textarea.addEventListener("focus",G),j.textarea.addEventListener("blur",U)),()=>{clearTimeout(V),j.textarea&&(j.textarea.removeEventListener("focus",G),j.textarea.removeEventListener("blur",U)),_(!1),j.dispose(),a.current=null,l.current=null,C(!1)}},[_]);const q=k.useCallback(()=>{if(!l.current||!a.current)return;l.current.fit();const{cols:j,rows:K}=a.current;f&&M(f,j,K)},[f,M]);return k.useEffect(()=>{if(!h.current)return;const j=()=>{requestAnimationFrame(q)};window.addEventListener("resize",j);const K=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})};document.addEventListener("visibilitychange",K);const $=new ResizeObserver(j);$.observe(h.current);const V=new IntersectionObserver(G=>{G[0]?.isIntersecting&&requestAnimationFrame(()=>{q(),a.current&&a.current.refresh(0,a.current.rows-1)})},{threshold:.1});return V.observe(h.current),()=>{window.removeEventListener("resize",j),document.removeEventListener("visibilitychange",K),$.disconnect(),V.disconnect()}},[q]),k.useEffect(()=>{if(!b||!t||!x||!v)return;const j=y.find(K=>K.cwd===t);if(j){g(j.id);return}if(!d.current&&a.current){d.current=!0;const{cols:K,rows:$}=a.current;T({name:e,cols:K,rows:$,cwd:t})}},[b,t,x,v,y,e,T]),k.useEffect(()=>{if(!t||f)return;const j=y.find(K=>K.cwd===t);j&&g(j.id)},[y,t,f]),k.useEffect(()=>{if(!f||!a.current||!h.current||p.current)return;const j=E.has(f);j&&E.delete(f);const K=()=>{if(requestAnimationFrame(q),j){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)}},$=A(f,a.current,{onAttached:K}),V=L(h.current,f);return p.current=!0,()=>{$(),V(),p.current=!1}},[f,A,L,t,q,w,D,s,o,e,u,E]),t?S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!b&&S.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),z==="error"&&S.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."}),z==="exited"&&S.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",H?.exitCode,")"]}),S.jsxs("div",{className:"relative flex-1",children:[S.jsx("div",{ref:h,className:ze("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",n)}),S.jsx("button",{onClick:()=>a.current?.scrollToBottom(),className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:S.jsx(Se,{icon:j2,size:20,strokeWidth:2})})]})]}):S.jsx("div",{className:ze("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function lB(e){const{viewState:t,setDiffOptions:n}=Mp(e);return{options:t.diffOptions,setOption:(s,o)=>{n({[s]:o})},setOptions:n}}function cB(e){const t=[];let n=0,s=0;for(const o of e.split(`
|
|
34
|
+
`))if(o.startsWith("diff --git"))t.push({type:"header",content:o});else if(o.startsWith("index ")||o.startsWith("---")||o.startsWith("+++"))t.push({type:"header",content:o});else if(o.startsWith("@@")){const u=o.match(/@@ -(\d+),?\d* \+(\d+),?\d* @@/);u&&(n=parseInt(u[1],10),s=parseInt(u[2],10)),t.push({type:"hunk",content:o})}else o.startsWith("+")?t.push({type:"added",content:o.slice(1),newLineNumber:s++}):o.startsWith("-")?t.push({type:"removed",content:o.slice(1),oldLineNumber:n++}):o.startsWith(" ")&&t.push({type:"context",content:o.slice(1),oldLineNumber:n++,newLineNumber:s++});return t}function uB({taskId:e,worktreePath:t}){const{options:n,setOption:s}=lB(e),{wrap:o,ignoreWhitespace:u,includeUntracked:h}=n,{data:a,isLoading:l,error:d}=pI(t,{ignoreWhitespace:u,includeUntracked:h}),p=k.useMemo(()=>a?.diff?cB(a.diff):[],[a?.diff]);if(!t)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"});if(l)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading diff..."});if(d)return S.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message});const f=a?.files?.some(g=>g.status==="untracked")??!1;return p.length===0?S.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[S.jsx("p",{children:"No changes detected"}),a?.files&&a.files.length>0&&S.jsxs("div",{className:"text-xs",children:[S.jsx("p",{className:"text-center mb-2",children:"Modified files:"}),S.jsxs("div",{className:"flex flex-col gap-1",children:[a.files.map(g=>S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("span",{className:ze("w-4 text-center",g.status==="added"&&"text-green-500",g.status==="deleted"&&"text-red-500",g.status==="modified"&&"text-yellow-500",g.status==="untracked"&&"text-gray-500"),children:[g.status==="added"&&"A",g.status==="deleted"&&"D",g.status==="modified"&&"M",g.status==="untracked"&&"?"]}),S.jsx("span",{children:g.path})]},g.path)),f&&S.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-muted-foreground hover:text-foreground mt-1",children:[S.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-4 h-3"}),S.jsx("span",{children:"Show untracked files"})]})]})]})]}):S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[a?.branch&&S.jsxs("span",{className:"text-muted-foreground",children:[a.branch,a.isBranchDiff&&S.jsx("span",{className:"opacity-70",children:" (vs master)"})]}),S.jsx("div",{className:"flex-1"}),S.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[S.jsx("input",{type:"checkbox",checked:o,onChange:g=>s("wrap",g.target.checked),className:"w-3 h-3"}),"Wrap"]}),S.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[S.jsx("input",{type:"checkbox",checked:u,onChange:g=>s("ignoreWhitespace",g.target.checked),className:"w-3 h-3"}),"Ignore whitespace"]}),S.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[S.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-3 h-3"}),"Untracked"]})]}),S.jsx(cd,{className:"flex-1 min-h-0",children:S.jsx("div",{className:"font-mono text-xs",children:p.map((g,x)=>S.jsxs("div",{className:ze("flex px-2 py-0.5",g.type==="added"&&"bg-green-500/10",g.type==="removed"&&"bg-red-500/10",g.type==="header"&&"bg-muted/50 text-muted-foreground",g.type==="hunk"&&"bg-blue-500/10 text-blue-400"),children:[(g.type==="added"||g.type==="removed"||g.type==="context")&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.oldLineNumber??""}),S.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.newLineNumber??""})]}),S.jsxs("span",{className:ze("w-4 shrink-0 select-none text-center",g.type==="added"&&"text-green-500",g.type==="removed"&&"text-red-500"),children:[g.type==="added"&&"+",g.type==="removed"&&"-"]}),S.jsx("span",{className:ze("flex-1",o?"whitespace-pre-wrap break-all":"whitespace-pre",g.type==="added"&&"text-green-400",g.type==="removed"&&"text-red-400"),children:g.content})]},x))})})]})}function dB(e){const{viewState:t,setBrowserUrl:n}=Mp(e);return{url:t.browserUrl,setUrl:n}}function fB({taskId:e}){const{url:t,setUrl:n}=dB(e),[s,o]=k.useState(t),[u,h]=k.useState(0);k.useEffect(()=>{o(t)},[t]);const a=k.useCallback(()=>{h(d=>d+1)},[]),l=k.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 S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2 py-1.5",children:[S.jsx(je,{variant:"ghost",size:"icon-xs",disabled:!0,children:S.jsx(Se,{icon:UM,size:14,strokeWidth:2})}),S.jsx(je,{variant:"ghost",size:"icon-xs",disabled:!0,children:S.jsx(Se,{icon:N2,size:14,strokeWidth:2})}),S.jsx(je,{variant:"ghost",size:"icon-xs",onClick:a,children:S.jsx(Se,{icon:a4,size:14,strokeWidth:2})}),S.jsx("form",{onSubmit:l,className:"flex-1",children:S.jsx(Wt,{value:s,onChange:d=>o(d.target.value),className:"h-7 bg-background text-xs",placeholder:"Enter URL..."})})]}),S.jsx("div",{className:"flex-1 overflow-hidden bg-white",children:S.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 hB(e){const{viewState:t,setFilesViewState:n}=Mp(e),s=t.filesViewState??{selectedFile:null,expandedDirs:[]},o=k.useCallback(a=>{n({selectedFile:a})},[n]),u=k.useCallback(a=>{const d=s.expandedDirs.includes(a)?s.expandedDirs.filter(p=>p!==a):[...s.expandedDirs,a];n({expandedDirs:d})},[s.expandedDirs,n]),h=k.useCallback(()=>{n({expandedDirs:[]})},[n]);return{selectedFile:s.selectedFile,expandedDirs:s.expandedDirs,setSelectedFile:o,toggleDir:u,collapseAll:h}}function pB(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?t4:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?XM:QM}function Jk({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=k.useCallback(()=>{l?u(e.path):o(e.path)},[l,e.path,o,u]);return S.jsxs("div",{children:[S.jsxs("div",{className:ze("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:[S.jsx(Se,{icon:l?h?U2:Ss:pB(e.name),size:14,strokeWidth:2,className:ze("shrink-0",l?"text-yellow-500":"text-muted-foreground")}),S.jsx("span",{className:"break-all",children:e.name})]}),l&&h&&e.children&&S.jsx("div",{children:e.children.map(p=>S.jsx(Jk,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function mB({entries:e,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o,onCollapseAll:u}){return e.length===0?S.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No files"}):S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1 border-b border-border",children:[S.jsx("span",{className:"text-xs text-muted-foreground",children:"Files"}),S.jsx("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Collapse all",children:S.jsx(Se,{icon:i4,size:14,strokeWidth:2})})]}),S.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>S.jsx(Jk,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const gB="modulepreload",vB=function(e){return"/"+e},aw={},te=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=vB(p),p in aw)return;aw[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const x=document.createElement("link");if(x.rel=f?"stylesheet":gB,f||(x.as="script"),x.crossOrigin="",x.href=p,l&&x.setAttribute("nonce",l),document.head.appendChild(x),f)return new Promise((C,w)=>{x.addEventListener("load",C),x.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 _B(e){return X0(e)}function X0(e){return Array.isArray(e)?yB(e):e instanceof RegExp?e:typeof e=="object"?bB(e):e}function yB(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=X0(e[n]);return t}function bB(e){let t={};for(let n in e)t[n]=X0(e[n]);return t}function eT(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function tT(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?tT(e.substring(0,e.length-1)):e.substr(~t+1)}var Mv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,nh=class{static hasCaptures(e){return e===null?!1:(Mv.lastIndex=0,Mv.test(e))}static replaceCaptures(e,t,n){return e.replace(Mv,(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 nT(e,t){return e<t?-1:e>t?1:0}function rT(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=nT(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function lw(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 sT(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var iT=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}},qh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(CB(e),t)}static createFromParsedTheme(e,t){return EB(e,t)}_cachedMatchRoot=new iT(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=>xB(e.parent,o.parentScopes));return s?new oT(s.fontStyle,s.foreground,s.background):null}},Dv=class ph{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new ph(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new ph(n,t[s]);return n}push(t){return new ph(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 xB(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&&!SB(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function SB(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var oT=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function CB(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,x=f.length;g<x;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"&&lw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&lw(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],_=null;C.length>1&&(_=C.slice(0,C.length-1),_.reverse()),n[s++]=new wB(w,_,o,l,d,p)}}return n}var wB=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 EB(e,t){e.sort((l,d)=>{let p=nT(l.scope,d.scope);return p!==0||(p=rT(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 RB(t),h=new oT(n,u.getId(s),u.getId(o)),a=new TB(new b_(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 qh(u,h,a)}var RB=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)}},kB=Object.freeze([]),b_=class aT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||kB,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new aT(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)}},TB=class x_{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(x_._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 x_(this._mainRule.clone(),b_.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(rT(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 b_(t,n,s,o,u))}},Yl=class Qr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Qr.getLanguageId(t),s=Qr.getTokenType(t),o=Qr.getFontStyle(t),u=Qr.getForeground(t),h=Qr.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=Qr.getLanguageId(t),d=Qr.getTokenType(t),p=Qr.containsBalancedBrackets(t)?1:0,f=Qr.getFontStyle(t),g=Qr.getForeground(t),x=Qr.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&&(x=a),(l<<0|d<<8|p<<10|f<<11|g<<15|x<<24)>>>0}};function Gh(e,t){const n=[],s=LB(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(cw(o)){const l=[];do l.push(o),o=s.next();while(cw(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 cw(e){return!!e&&!!e.match(/[\w\.:]+/)}function LB(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 lT(e){typeof e.dispose=="function"&&e.dispose()}var qu=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},AB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},OB=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))}},MB=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new qu(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new OB;for(const n of e)DB(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof qu){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 DB(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 qu?mh({baseGrammar:u,selfGrammar:o},s):S_(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 qu(a))}function S_(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];$h([s],t,n)}}function mh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&$h(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&$h(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function $h(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?eT({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&$h(s.patterns,{...t,repository:o},n);const u=s.include;if(!u)continue;const h=cT(u);switch(h.kind){case 0:mh({...t,selfGrammar:t.baseGrammar},n);break;case 1:mh(t,n);break;case 2:S_(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?S_(h.ruleName,l,n):mh(l,n)}else h.kind===4?n.add(new AB(h.scopeName,h.ruleName)):n.add(new qu(h.scopeName));break}}}var PB=class{kind=0},IB=class{kind=1},jB=class{constructor(e){this.ruleName=e}kind=2},NB=class{constructor(e){this.scopeName=e}kind=3},BB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function cT(e){if(e==="$base")return new PB;if(e==="$self")return new IB;const t=e.indexOf("#");if(t===-1)return new NB(e);if(t===0)return new jB(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new BB(n,s)}}var zB=/\\(\d+)/,uw=/\\(\d+)/g,HB=-1,uT=-2;var pd=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,s){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=nh.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=nh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${tT(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:nh.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:nh.replaceCaptures(this._contentName,e,t)}},VB=class extends pd{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!")}},FB=class extends pd{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,null),this._match=new Gu(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 $u,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dw=class extends pd{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 $u,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},C_=class extends pd{_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 Gu(o,this.id),this.beginCaptures=u,this._end=new Gu(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 $u;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}},Kh=class extends pd{_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 Gu(o,this.id),this.beginCaptures=u,this.whileCaptures=a,this._while=new Gu(h,uT),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 $u;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 $u,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},dT=class Qn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new VB(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new FB(t.$vscodeTextmateLocation,t.id,t.name,t.match,Qn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=eT({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new dw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Qn._compilePatterns(u,n,s))}return t.while?new Kh(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 C_(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=cT(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,x=n.getExternalGrammar(f,s);if(x)if(g){let C=x.repository[g];C&&(l=Qn.getCompiledRuleId(C,n,x.repository))}else l=Qn.getCompiledRuleId(x.repository.$self,n,x.repository);break}}else l=Qn.getCompiledRuleId(a,n,s);if(l!==-1){const d=n.getRule(l);let p=!1;if((d instanceof dw||d instanceof C_||d instanceof Kh)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Gu=class fT{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=zB.test(this.source):this.hasBackReferences=!1}clone(){return new fT(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 uw.lastIndex=0,this.source.replace(uw,(o,u)=>sT(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}},$u=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 fw(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 fw(e,s,this._items.map(o=>o.ruleId))}},fw=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(`
|
|
35
|
+
`)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Pv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},UB=class w_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Pv(t,8),this._embeddedLanguagesMatcher=new WB(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?w_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Pv(0,0);_getBasicScopeAttributes=new iT(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Pv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(w_.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/},WB=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])=>sT(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 hT(e,t,n,s,o,u,h,a){const l=t.content.length;let d=!1,p=-1;if(h){const x=qB(e,t,n,s,o,u);o=x.stack,s=x.linePos,n=x.isFirstLine,p=x.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 x=GB(e,t,n,s,o,p);if(!x){u.produce(o,l),d=!0;return}const C=x.captureIndices,w=x.matchedRuleId,_=C&&C.length>0?C[0].end>s:!1;if(w===HB){const y=o.getRule(e);u.produce(o,C[0].start),o=o.withContentNameScopesList(o.nameScopesList),wu(e,t,n,o,u,y.endCaptures,C),u.produce(o,C[0].end);const v=o;if(o=o.parent,p=v.getAnchorPos(),!_&&v.getEnterPos()===s){o=v,u.produce(o,l),d=!0;return}}else{const y=e.getRule(w);u.produce(o,C[0].start);const v=o,b=y.getName(t.content,C),E=o.contentNameScopesList.pushAttributed(b,e);if(o=o.push(w,s,p,C[0].end===l,null,E,E),y instanceof C_){const T=y;wu(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))),!_&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(y instanceof Kh){const T=y;wu(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))),!_&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,l),d=!0;return}}else if(wu(e,t,n,o,u,y.captures,C),u.produce(o,C[0].end),o=o.pop(),!_){o=o.safePop(),u.produce(o,l),d=!0;return}}C[0].end>s&&(s=C[0].end,n=!1)}}function qB(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 Kh&&a.push({rule:d,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:d,findOptions:p}=YB(l.rule,e,l.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==uT){o=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(u.produce(l.stack,f.captureIndices[0].start),wu(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 GB(e,t,n,s,o,u){const h=$B(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const l=KB(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 $B(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:l}=pT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,l);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function KB(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,x=e.length;g<x;g++){const C=e[g];if(!C.matcher(f))continue;const w=t.getRule(C.ruleId),{ruleScanner:_,findOptions:y}=pT(w,t,null,s,o===h),v=_.findNextMatchSync(n,o,y);if(!v)continue;const b=v.captureIndices[0].start;if(!(b>=a)&&(a=b,l=v.captureIndices,d=v.ruleId,p=C.priority,a===o))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:d}:null}function pT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function YB(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function wu(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 x=h[f];if(x.length===0)continue;if(x.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=x.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,x.start):o.produce(s,x.start),g.retokenizeCapturedWithRuleId){const w=g.getName(a,h),_=s.contentNameScopesList.pushAttributed(w,e),y=g.getContentName(a,h),v=_.pushAttributed(y,e),b=s.push(g.retokenizeCapturedWithRuleId,x.start,-1,!1,null,_,v),E=e.createOnigString(a.substring(0,x.end));hT(e,E,n&&x.start===0,x.start,b,o,!1,0),lT(E);continue}const C=g.getName(a,h);if(C!==null){const _=(d.length>0?d[d.length-1].scopes:s.contentNameScopesList).pushAttributed(C,e);d.push(new XB(_,x.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var XB=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function QB(e,t,n,s,o,u,h,a){return new JB(e,t,n,s,o,u,h,a)}function pw(e,t,n,s,o){const u=Gh(t,Yh),h=dT.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 Yh(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(ZB(t[o],s))return n=o+1,!0;return!1})}function ZB(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 JB=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new UB(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=mw(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const l of Object.keys(o)){const d=Gh(l,Yh);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)pw(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&&pw(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]=mw(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=dT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===E_.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),f=Yl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let x;g?x=Ou.createRootAndLookUpScopeName(g,f,this):x=Ou.createRoot("unknown",f),t=new E_(null,this._rootId,-1,-1,!1,null,x,x)}else o=!1,t.reset();e=e+`
|
|
36
|
+
`;const u=this.createOnigString(e),h=u.content.length,a=new tz(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=hT(this,u,o,0,t,a,!0,s);return lT(u),{lineLength:h,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function mw(e,t){return e=_B(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 Ou=class Ds{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=Dv.push(o,u.scopeNames),s=new Ds(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new Ds(null,new Dv(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Dv(null,t),h=s.themeProvider.themeMatch(u),a=Ds.mergeAttributes(n,o,h);return new Ds(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ds.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),Yl.set(t,n.languageId,n.tokenType,null,o,u,h)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ds._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=Ds._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=Ds.mergeAttributes(t.tokenAttributes,o,h);return new Ds(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}},E_=class Xo{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 Xo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Xo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ou.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(){Xo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,u,h,a){return new Xo(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 Xo(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=Ou.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Xo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,Ou.fromExtension(s,n.contentNameScopesList))}},ez=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Gh(n,Yh).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Gh(n,Yh).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}},tz=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=Yl.set(s,0,h.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(u))}if(o&&(s=Yl.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}},nz=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,QB(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},rz=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new nz(qh.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(qh.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 ez(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new MB(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)}},R_=E_.NULL;const sz=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class md{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}md.prototype.normal={};md.prototype.property={};md.prototype.space=void 0;function mT(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new md(n,s,t)}function k_(e){return e.toLowerCase()}class br{constructor(t,n){this.attribute=n,this.property=t}}br.prototype.attribute="";br.prototype.booleanish=!1;br.prototype.boolean=!1;br.prototype.commaOrSpaceSeparated=!1;br.prototype.commaSeparated=!1;br.prototype.defined=!1;br.prototype.mustUseProperty=!1;br.prototype.number=!1;br.prototype.overloadedBoolean=!1;br.prototype.property="";br.prototype.spaceSeparated=!1;br.prototype.space=void 0;let iz=0;const yt=za(),Sn=za(),T_=za(),Pe=za(),Kt=za(),Nl=za(),Mr=za();function za(){return 2**++iz}const L_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Sn,commaOrSpaceSeparated:Mr,commaSeparated:Nl,number:Pe,overloadedBoolean:T_,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),Iv=Object.keys(L_);class Q0 extends br{constructor(t,n,s,o){let u=-1;if(super(t,n),gw(this,"space",o),typeof s=="number")for(;++u<Iv.length;){const h=Iv[u];gw(this,Iv[u],(s&L_[h])===L_[h])}}}Q0.prototype.defined=!0;function gw(e,t,n){n&&(e[t]=n)}function mc(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new Q0(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[k_(s)]=s,n[k_(u.attribute)]=s}return new md(t,n,e.space)}const gT=mc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,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:Pe,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Kt,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:Sn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vT(e,t){return t in e?e[t]:t}function _T(e,t){return vT(e,t.toLowerCase())}const oz=mc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nl,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:Pe,colSpan:null,content:null,contentEditable:Sn,controls:yt,controlsList:Kt,coords:Pe|Nl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:T_,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Kt,height:Pe,hidden:T_,high:Pe,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:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,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:Pe,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:Pe,rowSpan:Pe,sandbox:Kt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Sn,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,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:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:Pe,security:null,unselectable:null},space:"html",transform:_T}),az=mc({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:Mr,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,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:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,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:Nl,g2:Nl,glyphName:Nl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:Mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,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:Pe,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:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mr,rev:Mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mr,requiredFeatures:Mr,requiredFonts:Mr,requiredFormats:Mr,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:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:Mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mr,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vT}),yT=mc({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()}}),bT=mc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_T}),xT=mc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lz=/[A-Z]/g,vw=/-[a-z]/g,cz=/^data[-\w.:]+$/i;function uz(e,t){const n=k_(t);let s=t,o=br;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cz.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(vw,fz);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!vw.test(u)){let h=u.replace(lz,dz);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=Q0}return new o(s,t)}function dz(e){return"-"+e.toLowerCase()}function fz(e){return e.charAt(1).toUpperCase()}const hz=mT([gT,oz,yT,bT,xT],"html"),ST=mT([gT,az,yT,bT,xT],"svg"),_w={}.hasOwnProperty;function pz(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&_w.call(o,e)){const l=String(o[e]);h=_w.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 mz=/["&'<>`]/g,gz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,vz=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,_z=/[|\\{}()[\]^$+*?.]/g,yw=new WeakMap;function yz(e,t){if(e=e.replace(t.subset?bz(t.subset):mz,s),t.subset||t.escapeOnly)return e;return e.replace(gz,n).replace(vz,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 bz(e){let t=yw.get(e);return t||(t=xz(e),yw.set(e,t)),t}function xz(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(_z,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Sz=/[\dA-Fa-f]/;function Cz(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!Sz.test(String.fromCharCode(t))?s:s+";"}const wz=/\d/;function Ez(e,t,n){const s="&#"+String(e);return n&&t&&!wz.test(String.fromCharCode(t))?s:s+";"}const Rz=["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"],jv={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:"€"},kz=["cent","copy","divide","gt","lt","not","para","times"],CT={}.hasOwnProperty,A_={};let rh;for(rh in jv)CT.call(jv,rh)&&(A_[jv[rh]]=rh);const Tz=/[^\dA-Za-z]/;function Lz(e,t,n,s){const o=String.fromCharCode(e);if(CT.call(A_,o)){const u=A_[o],h="&"+u;return n&&Rz.includes(u)&&!kz.includes(u)&&(!s||t&&t!==61&&Tz.test(String.fromCharCode(t)))?h:h+";"}return""}function Az(e,t,n){let s=Cz(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Lz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=Ez(e,t,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Bl(e,t){return yz(e,Object.assign({format:Az},t))}const Oz=/^>|^->|<!--|-->|--!>|<!-$/g,Mz=[">"],Dz=["<",">"];function Pz(e,t,n,s){return s.settings.bogusComments?"<?"+Bl(e.value,Object.assign({},s.settings.characterReferences,{subset:Mz}))+">":"<!--"+e.value.replace(Oz,o)+"-->";function o(u){return Bl(u,Object.assign({},s.settings.characterReferences,{subset:Dz}))}}function Iz(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function bw(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 jz(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Nz(e){return e.join(" ").trim()}const Bz=/[ \t\n\f\r]/g;function Z0(e){return typeof e=="object"?e.type==="text"?xw(e.value):!1:xw(e)}function xw(e){return e.replace(Bz,"")===""}const In=ET(1),wT=ET(-1),zz=[];function ET(e){return t;function t(n,s,o){const u=n?n.children:zz;let h=(s||0)+e,a=u[h];if(!o)for(;a&&Z0(a);)h+=e,a=u[h];return a}}const Hz={}.hasOwnProperty;function RT(e){return t;function t(n,s,o){return Hz.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const J0=RT({body:Fz,caption:Nv,colgroup:Nv,dd:Gz,dt:qz,head:Nv,html:Vz,li:Wz,optgroup:$z,option:Kz,p:Uz,rp:Sw,rt:Sw,tbody:Xz,td:Cw,tfoot:Qz,th:Cw,thead:Yz,tr:Zz});function Nv(e,t,n){const s=In(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Z0(s.value.charAt(0)))}function Vz(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function Fz(e,t,n){const s=In(n,t);return!s||s.type!=="comment"}function Uz(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 Wz(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="li"}function qz(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Gz(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Sw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function $z(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Kz(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Yz(e,t,n){const s=In(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Xz(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Qz(e,t,n){return!In(n,t)}function Zz(e,t,n){const s=In(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function Cw(e,t,n){const s=In(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const Jz=RT({body:nH,colgroup:rH,head:tH,html:eH,tbody:sH});function eH(e){const t=In(e,-1);return!t||t.type!=="comment"}function tH(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 nH(e){const t=In(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Z0(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function rH(e,t,n){const s=wT(n,t),o=In(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&J0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function sH(e,t,n){const s=wT(n,t),o=In(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&J0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const sh={name:[[`
|
|
37
|
+
\f\r &/=>`.split(""),`
|
|
38
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
39
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
40
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
41
|
+
\f\r &>`.split(""),`\0
|
|
42
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
43
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
44
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function iH(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=ST);const d=oH(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!Jz(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||!J0(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function oH(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=aH(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 aH(e,t,n){const s=uz(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=Bl(s.attribute,Object.assign({},e.settings.characterReferences,{subset:sh.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?jz:Nz)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=Bl(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:sh.unquoted[o][u]}))),a!==n&&(e.settings.quoteSmart&&bw(n,h)>bw(n,e.alternative)&&(h=e.alternative),a=h+Bl(n,Object.assign({},e.settings.characterReferences,{subset:(h==="'"?sh.single:sh.double)[o][u],attribute:!0}))+h),l+(a&&"="+a))}const lH=["<","&"];function kT(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Bl(e.value,Object.assign({},s.settings.characterReferences,{subset:lH}))}function cH(e,t,n,s){return s.settings.allowDangerousHtml?e.value:kT(e,t,n,s)}function uH(e,t,n,s){return s.all(e)}const dH=pz("type",{invalid:fH,unknown:hH,handlers:{comment:Pz,doctype:Iz,element:iH,raw:cH,root:uH,text:kT}});function fH(e){throw new Error("Expected node, not `"+e+"`")}function hH(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const pH={},mH={},gH=[];function vH(e,t){const n=t||pH,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:_H,all:yH,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||sz,characterReferences:n.characterReferences||mH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ST:hz,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function _H(e,t,n){return dH(e,t,n,this)}function yH(e){const t=[],n=e&&e.children||gH;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function Xh(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 go(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function bH(e){return Array.isArray(e)?e:[e]}async function TT(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function ey(e){return!e||["plaintext","txt","text","plain"].includes(e)}function LT(e){return e==="ansi"||ey(e)}function ty(e){return e==="none"}function AT(e){return ty(e)}function OT(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 Dp(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 xH(e){const t=Dp(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 ny="light-dark()",SH=["color","background-color"];function CH(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 wH(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?CH(o,u):o})):e}function EH(e,t,n,s,o="css-vars"){const u={content:e.content,explanation:e.explanation,offset:e.offset},h=t.map(p=>Qh(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 x=p[g]||"inherit";if(f===0&&s&&SH.includes(g))if(s===ny&&h.length>1){const C=t.findIndex(v=>v==="light"),w=t.findIndex(v=>v==="dark");if(C===-1||w===-1)throw new En('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=h[C][g]||"inherit",y=h[w][g]||"inherit";l[g]=`light-dark(${_}, ${y})`,o==="css-vars"&&(l[d(f,g)]=x)}else l[g]=x;else o==="css-vars"&&(l[d(f,g)]=x)}}),u.htmlStyle=l,u}function Qh(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 O_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const MT=new WeakMap;function Pp(e,t){MT.set(e,t)}function Ku(e){return MT.get(e)}class gc{_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 gc(Object.fromEntries(bH(n).map(s=>[s,R_])),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 RH(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function RH(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 kH(e,t){if(!(e instanceof gc))throw new En("Invalid grammar state");return e.getInternalStack(t)}function TH(){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=xH(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));LH(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 wH(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,x){const C=o[p];let w="",_=-1,y=-1;if(f===0&&(_=0),g===0&&(y=0),g===Number.POSITIVE_INFINITY&&(y=C.children.length),_===-1||y===-1)for(let b=0;b<C.children.length;b++)w+=DT(C.children[b]),_===-1&&w.length===f&&(_=b+1),y===-1&&w.length===g&&(y=b+1);if(_===-1)throw new En(`Failed to find start index for decoration ${JSON.stringify(x.start)}`);if(y===-1)throw new En(`Failed to find end index for decoration ${JSON.stringify(x.end)}`);const v=C.children.slice(_,y);if(!x.alwaysWrap&&v.length===C.children.length)a(C,x,"line");else if(!x.alwaysWrap&&v.length===1&&v[0].type==="element")a(v[0],x,"token");else{const b={type:"element",tagName:"span",properties:{},children:v};a(b,x,"wrapper"),C.children.splice(_,v.length,b)}}function h(p,f){o[p]=a(o[p],f,"line")}function a(p,f,g){const x=f.properties||{},C=f.transform||(w=>w);return p.tagName=f.tagName||"span",p.properties={...p.properties,...x,class:p.properties.class},f.properties?.class&&OT(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 x=f.line+1;x<g.line;x++)l.unshift(()=>h(x,p));u(g.line,0,g.character,p)}}l.forEach(p=>p())}}}function LH(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 DT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(DT).join(""):""}const AH=[TH()];function Zh(e){const t=OH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...AH]}function OH(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 la=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Bv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function MH(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 ww(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 DH(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)Bv[s]&&t.push({type:"setDecoration",value:Bv[s]});else if(s<=29){const o=Bv[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:la[s-30]}});else if(s===38){const o=ww(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:la[s-40]}});else if(s===48){const o=ww(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:la[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:la[s-100+8]}})}return t}function PH(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=MH(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=DH(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 IH={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 jH(e=IH){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<la.length;d++)s.push(t(la[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 NH={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 BH(e,t,n){const s=Xh(e,n),o=Dp(t),u=Object.fromEntries(la.map(l=>{const d=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,p=e.colors?.[d];return[l,p||NH[l]]})),h=jH(u),a=PH();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=go(p,s),f=go(f,s),d.decorations.has("dim")&&(p=zH(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 zH(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 ry(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(ey(o)||ty(s))return Dp(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return BH(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 VH(t,a,u,h,n)}function HH(...e){if(e.length===2)return Ku(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:u=t.getLoadedThemes()[0]}=s;if(ey(o)||ty(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 gc(sy(n,l,h,a,s).stateStack,l.name,h.name)}function VH(e,t,n,s,o){const u=sy(e,t,n,s,o),h=new gc(u.stateStack,t.name,n.name);return Pp(u.tokens,h),u.tokens}function sy(e,t,n,s,o){const u=Xh(n,o),{tokenizeMaxLineLength:h=0,tokenizeTimeLimit:a=500}=o,l=Dp(e);let d=o.grammarState?kH(o.grammarState,n.name)??R_:o.grammarContextCode!=null?sy(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:R_,p=[];const f=[];for(let g=0,x=l.length;g<x;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 _,y,v;o.includeExplanation&&(_=t.tokenizeLine(C,d,a),y=_.tokens,v=0);const b=t.tokenizeLine2(C,d,a),E=b.tokens.length/2;for(let T=0;T<E;T++){const A=b.tokens[2*T],M=T+1<E?b.tokens[2*T+2]:C.length;if(A===M)continue;const L=b.tokens[2*T+1],D=go(s[Yl.getForeground(L)],u),H=Yl.getFontStyle(L),z={content:C.substring(A,M),offset:w+A,color:D,fontStyle:H};if(o.includeExplanation){const q=[];if(o.includeExplanation!=="scopeName")for(const K of n.settings){let $;switch(typeof K.scope){case"string":$=K.scope.split(/,/).map(V=>V.trim());break;case"object":$=K.scope;break;default:continue}q.push({settings:K,selectors:$.map(V=>V.split(/ /))})}z.explanation=[];let j=0;for(;A+j<M;){const K=y[v],$=C.substring(K.startIndex,K.endIndex);j+=$.length,z.explanation.push({content:$,scopes:o.includeExplanation==="scopeName"?FH(K.scopes):UH(q,K.scopes)}),v+=1}}p.push(z)}f.push(p),p=[],d=b.ruleStack}return{tokens:f,stateStack:d}}function FH(e){return e.map(t=>({scopeName:t}))}function UH(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:qH(e,u,t.slice(0,s))}}return n}function Ew(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function WH(e,t,n){if(!Ew(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)Ew(e[s],n[o])&&(s-=1),o-=1;return s===-1}function qH(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(WH(h,t,n)){s.push(u);break}return s}function PT(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=ry(e,t,{...n,theme:l.theme}),p=Ku(d),f=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:d,state:p,theme:f}}),u=GH(...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((x,C)=>{const{content:w,explanation:_,offset:y,...v}=x[d][f];g.variants[s[C].color]=v}),g})),a=o[0].state?new gc(Object.fromEntries(o.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),o[0].state.lang):void 0;return a&&Pp(h,a),h}function GH(...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 Jh(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(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,v)=>y.color===d?-1:v.color===d?1:0);if(g.length===0)throw new En("`themes` option must not be empty");const x=PT(e,t,n);if(l=Ku(x),d&&ny!==d&&!g.find(y=>y.color===d))throw new En(`\`themes\` option must contain the defaultColor key \`${d}\``);const C=g.map(y=>e.getTheme(y.theme)),w=g.map(y=>y.color);u=x.map(y=>y.map(v=>EH(v,w,p,d,f))),l&&Pp(u,l);const _=g.map(y=>Xh(y.theme,n));o=Rw(g,C,_,p,d,"fg",f),s=Rw(g,C,_,p,d,"bg",f),h=`shiki-themes ${C.map(y=>y.name).join(" ")}`,a=d?void 0:[o,s].join(";")}else if("theme"in n){const d=Xh(n.theme,n);u=ry(e,t,n);const p=e.getTheme(n.theme);s=go(p.bg,d),o=go(p.fg,d),h=p.name,l=Ku(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 Rw(e,t,n,s,o,u,h){return e.map((a,l)=>{const d=go(t[l][u],n[l])||"inherit",p=`${s+a.color}${u==="bg"?"-bg":""}:${d}`;if(l===0&&o){if(o===ny&&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 x=go(t[f][u],n[f])||"inherit",C=go(t[g][u],n[g])||"inherit";return`light-dark(${x}, ${C});${p}`}return d}return h==="css-vars"?p:null}).filter(a=>!!a).join(";")}function ep(e,t,n,s={meta:{},options:n,codeToHast:(o,u)=>ep(e,o,u),codeToTokens:(o,u)=>Jh(e,o,u)}){let o=t;for(const C of Zh(n))o=C.preprocess?.call(s,o,n)||o;let{tokens:u,fg:h,bg:a,themeName:l,rootStyle:d,grammarState:p}=Jh(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?u=KH(u):f==="never"&&(u=YH(u)),g&&(u=XH(u));const x={...s,get source(){return o}};for(const C of Zh(n))u=C.tokens?.call(x,u)||u;return $H(u,{...n,fg:h,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},x,p)}function $H(e,t,n,s=Ku(e)){const o=Zh(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,_]of Object.entries(t.meta||{}))w.startsWith("_")||(d[w]=_);let p={type:"element",tagName:"pre",properties:d,children:[]},f={type:"element",tagName:"code",properties:{},children:u};const g=[],x={...n,structure:a,addClassToHast:OT,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,_)=>{_&&(a==="inline"?h.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&u.push({type:"text",value:`
|
|
45
|
+
`}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const b of w){let E={type:"element",tagName:"span",properties:{...b.htmlAttrs},children:[{type:"text",value:b.content}]};const T=O_(b.htmlStyle||Qh(b));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(x,E,_+1,v,y,b)||E;a==="inline"?h.children.push(E):a==="classic"&&y.children.push(E),v+=b.content.length}if(a==="classic"){for(const b of o)y=b?.line?.call(x,y,_+1)||y;g.push(y),u.push(y)}else a==="inline"&&g.push(y)}),a==="classic"){for(const w of o)f=w?.code?.call(x,f)||f;p.children.push(f);for(const w of o)p=w?.pre?.call(x,p)||p;h.children.push(p)}else if(a==="inline"){const w=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const b of h.children)b.type==="element"&&b.tagName==="br"?(w.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&_.children.push(b);w.push(_);let v={type:"element",tagName:"code",properties:{},children:w};for(const b of o)v=b?.code?.call(x,v)||v;h.children=[];for(let b=0;b<v.children.length;b++){b>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=v.children[b];E.type==="element"&&h.children.push(...E.children)}}let C=h;for(const w of o)C=w?.root?.call(x,C)||C;return s&&Pp(C,s),C}function KH(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 YH(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 XH(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=O_(o.htmlStyle||Qh(o)),h=O_(s.htmlStyle||Qh(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 QH=vH;function ZH(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>ep(e,u,h),codeToTokens:(u,h)=>Jh(e,u,h)};let o=QH(ep(e,t,n,s));for(const u of Zh(n))o=u.postprocess?.call(s,o,n)||o;return o}const kw={light:"#333333",dark:"#bbbbbb"},Tw={light:"#fffffe",dark:"#1e1e1e"},Lw="__shiki_resolved";function iy(e){if(e?.[Lw])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"?kw.light:kw.dark),n||(n=t.type==="light"?Tw.light:Tw.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,Lw,{enumerable:!1,writable:!1,value:!0}),t}async function IT(e){return Array.from(new Set((await Promise.all(e.filter(t=>!LT(t)).map(async t=>await TT(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function jT(e){return(await Promise.all(e.map(async n=>AT(n)?null:iy(await TT(n))))).filter(n=>!!n)}let JH=3;function eV(e,t=3){t>JH||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let Rl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function NT(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 Rl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class tV extends rz{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=iy(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=qh.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=NT(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 Rl(`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 nV{_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 bu=0;function rV(e){bu+=1,e.warnings!==!1&&bu>=10&&bu%10===0&&console.warn(`[Shiki] ${bu} 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 Rl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(iy),o=new nV(e.engine,n),u=new tV(o,s,n,e.langAlias);let h;function a(b){return NT(b,e.langAlias)}function l(b){y();const E=u.getGrammar(typeof b=="string"?b:b.name);if(!E)throw new Rl(`Language \`${b}\` not found, you may need to load it first`);return E}function d(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const E=u.getTheme(b);if(!E)throw new Rl(`Theme \`${b}\` not found, you may need to load it first`);return E}function p(b){y();const E=d(b);h!==b&&(u.setTheme(E),h=b);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return y(),u.getLoadedThemes()}function g(){return y(),u.getLoadedLanguages()}function x(...b){y(),u.loadLanguages(b.flat(1))}async function C(...b){return x(await IT(b))}function w(...b){y();for(const E of b.flat(1))u.loadTheme(E)}async function _(...b){return y(),w(await jT(b))}function y(){if(t)throw new Rl("Shiki instance has been disposed")}function v(){t||(t=!0,u.dispose(),bu-=1)}return{setTheme:p,getTheme:d,getLanguage:l,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:C,loadLanguageSync:x,loadTheme:_,loadThemeSync:w,dispose:v,[Symbol.dispose]:v}}async function sV(e){e.engine||eV("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([jT(e.themes||[]),IT(e.langs||[]),e.engine]);return rV({...e,themes:t,langs:n,engine:s})}async function iV(e){const t=await sV(e);return{getLastGrammarState:(...n)=>HH(t,...n),codeToTokensBase:(n,s)=>ry(t,n,s),codeToTokensWithThemes:(n,s)=>PT(t,n,s),codeToTokens:(n,s)=>Jh(t,n,s),codeToHast:(n,s)=>ep(t,n,s),codeToHtml:(n,s)=>ZH(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function oV(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,LT(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(AT(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 iV({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 BT=[{id:"abap",name:"ABAP",import:(()=>te(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>te(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>te(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>te(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>te(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>te(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>te(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>te(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>te(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>te(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>te(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>te(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>te(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>te(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>te(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>te(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>te(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>te(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>te(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>te(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>te(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>te(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>te(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>te(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>te(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>te(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>te(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>te(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>te(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>te(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>te(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>te(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>te(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>te(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>te(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>te(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>te(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>te(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>te(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>te(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>te(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>te(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>te(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>te(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>te(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>te(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>te(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>te(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>te(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>te(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>te(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>te(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>te(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>te(()=>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:(()=>te(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>te(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>te(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>te(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>te(()=>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:(()=>te(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>te(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>te(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>te(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>te(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>te(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>te(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>te(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>te(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>te(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>te(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>te(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>te(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>te(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>te(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>te(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>te(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>te(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>te(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>te(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>te(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>te(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>te(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>te(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>te(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>te(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>te(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>te(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>te(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>te(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>te(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>te(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>te(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>te(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>te(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>te(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>te(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>te(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>te(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>te(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>te(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>te(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>te(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>te(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>te(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>te(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>te(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>te(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>te(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>te(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>te(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>te(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>te(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>te(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>te(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>te(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>te(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>te(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>te(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>te(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>te(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>te(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>te(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>te(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>te(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>te(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>te(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>te(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>te(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>te(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>te(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>te(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>te(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>te(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>te(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>te(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>te(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>te(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>te(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>te(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>te(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>te(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>te(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>te(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>te(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>te(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>te(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>te(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>te(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>te(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>te(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>te(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>te(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>te(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>te(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>te(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>te(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>te(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>te(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>te(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>te(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>te(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>te(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>te(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>te(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>te(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>te(()=>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:(()=>te(()=>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:(()=>te(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>te(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>te(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>te(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>te(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>te(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>te(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>te(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>te(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>te(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>te(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>te(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>te(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>te(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>te(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>te(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>te(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>te(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>te(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>te(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>te(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>te(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>te(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>te(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>te(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>te(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>te(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>te(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>te(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>te(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>te(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>te(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>te(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>te(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>te(()=>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:(()=>te(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>te(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>te(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>te(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>te(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>te(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>te(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>te(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>te(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>te(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>te(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>te(()=>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:(()=>te(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>te(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>te(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>te(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>te(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>te(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>te(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>te(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>te(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>te(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>te(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>te(()=>import("./zig-VOosw3JB.js"),[]))}],aV=Object.fromEntries(BT.map(e=>[e.id,e.import])),lV=Object.fromEntries(BT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),cV={...aV,...lV},uV=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>te(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>te(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>te(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>te(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>te(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>te(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>te(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>te(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>te(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>te(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>te(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>te(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>te(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>te(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>te(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>te(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>te(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>te(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>te(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>te(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>te(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>te(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>te(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>te(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>te(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>te(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>te(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>te(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>te(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>te(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>te(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>te(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>te(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>te(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>te(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>te(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>te(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>te(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>te(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>te(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>te(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>te(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>te(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>te(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>te(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>te(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>te(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>te(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>te(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>te(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>te(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>te(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>te(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>te(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>te(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>te(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>te(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],dV=Object.fromEntries(uV.map(e=>[e.id,e.import]));class oy extends Error{constructor(t){super(t),this.name="ShikiError"}}function fV(){return 2147483648}function hV(){return typeof performance<"u"?performance.now():Date.now()}const pV=(e,t)=>e+(t-e%t)%t;async function mV(e){let t,n;const s={};function o(x){n=x,s.HEAPU8=new Uint8Array(x),s.HEAPU32=new Uint32Array(x)}function u(x,C,w){s.HEAPU8.copyWithin(x,C,C+w)}function h(x){try{return t.grow(x-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(x){const C=s.HEAPU8.length;x=x>>>0;const w=fV();if(x>w)return!1;for(let _=1;_<=4;_*=2){let y=C*(1+.2/_);y=Math.min(y,x+100663296);const v=Math.min(w,pV(Math.max(x,y),65536));if(h(v))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(x,C,w=1024){const _=C+w;let y=C;for(;x[y]&&!(y>=_);)++y;if(y-C>16&&x.buffer&&l)return l.decode(x.subarray(C,y));let v="";for(;C<y;){let b=x[C++];if(!(b&128)){v+=String.fromCharCode(b);continue}const E=x[C++]&63;if((b&224)===192){v+=String.fromCharCode((b&31)<<6|E);continue}const T=x[C++]&63;if((b&240)===224?b=(b&15)<<12|E<<6|T:b=(b&7)<<18|E<<12|T<<6|x[C++]&63,b<65536)v+=String.fromCharCode(b);else{const A=b-65536;v+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return v}function p(x,C){return x?d(s.HEAPU8,x,C):""}const f={emscripten_get_now:hV,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 gV=Object.defineProperty,vV=(e,t,n)=>t in e?gV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t,n)=>vV(e,typeof t!="symbol"?t+"":t,n);let Nn=null;function _V(e){throw new oy(e.UTF8ToString(e.getLastOnigError()))}class Ip{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=Ip._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 x=t.charCodeAt(d+1);x>=56320&&x<=57343&&(f=(p-55296<<10)+65536|x-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 jp=class Ps{constructor(t){if(On(this,"id",++Ps.LAST_ID),On(this,"_onigBinding"),On(this,"content"),On(this,"utf16Length"),On(this,"utf8Length"),On(this,"utf16OffsetToUtf8"),On(this,"utf8OffsetToUtf16"),On(this,"ptr"),!Nn)throw new oy("Must invoke loadWasm first.");this._onigBinding=Nn,this.content=t;const n=new Ip(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ps._sharedPtrInUse?(Ps._sharedPtr||(Ps._sharedPtr=Nn.omalloc(1e4)),Ps._sharedPtrInUse=!0,Nn.HEAPU8.set(n.utf8Value,Ps._sharedPtr),this.ptr=Ps._sharedPtr):this.ptr=n.createString(Nn)}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===Ps._sharedPtr?Ps._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};On(jp,"LAST_ID",0);On(jp,"_sharedPtr",0);On(jp,"_sharedPtrInUse",!1);let zT=jp;class yV{constructor(t){if(On(this,"_onigBinding"),On(this,"_ptr"),!Nn)throw new oy("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,l=t.length;a<l;a++){const d=new Ip(t[a]);n[a]=d.createString(Nn),s[a]=d.utf8Length}const o=Nn.omalloc(4*t.length);Nn.HEAPU32.set(n,o/4);const u=Nn.omalloc(4*t.length);Nn.HEAPU32.set(s,u/4);const h=Nn.createOnigScanner(o,u,t.length);for(let a=0,l=t.length;a<l;a++)Nn.ofree(n[a]);Nn.ofree(u),Nn.ofree(o),h===0&&_V(Nn),this._onigBinding=Nn,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 zT(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 x=t.convertUtf8OffsetToUtf16(a[l++]),C=t.convertUtf8OffsetToUtf16(a[l++]);f[g]={start:x,end:C,length:C-x}}return{index:d,captureIndices:f}}}function bV(e){return typeof e.instantiator=="function"}function xV(e){return typeof e.default=="function"}function SV(e){return typeof e.data<"u"}function CV(e){return typeof Response<"u"&&e instanceof Response}function wV(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 ih;function EV(e){if(ih)return ih;async function t(){Nn=await mV(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),bV(s)?s=await s.instantiator(n):xV(s)?s=await s.default(n):(SV(s)&&(s=s.data),CV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await RV(s)(n):s=await kV(s)(n):wV(s)?s=await zv(s)(n):s instanceof WebAssembly.Module?s=await zv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await zv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return ih=t(),ih}function zv(e){return t=>WebAssembly.instantiate(e,t)}function RV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function kV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function TV(e){return e&&await EV(e),{createScanner(t){return new yV(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new zT(t)}}}const LV=oV({langs:cV,themes:dV,engine:()=>TV(te(()=>import("./wasm-CG6Dc4jp.js"),[]))});let oh=null,ah=null;const AV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function OV(){return oh||ah||(ah=LV({themes:["github-dark"],langs:AV}),oh=await ah,oh)}async function MV(e,t){const n=await OV(),s=DV(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 DV(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 PV(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 IV({filePath:e,content:t,isLoading:n,error:s,onClose:o}){const[u,h]=k.useState(null),[a,l]=k.useState(!1),[d,p]=k.useState(!0);if(k.useEffect(()=>{if(!t||!e){h(null);return}if(t.mimeType.startsWith("image/")||t.mimeType==="application/octet-stream"){h(null);return}l(!0);const g=PV(e);MV(t.content,g).then(x=>{h(x),l(!1)}).catch(()=>{h(null),l(!1)})},[t,e]),!e)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(n)return S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(s)return S.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s.message});if(!t)return S.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 S.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[S.jsx("p",{children:"Binary file"}),S.jsxs("p",{className:"text-xs",children:[(t.size/1024).toFixed(1)," KB"]})]});if(t.mimeType.startsWith("image/"))return S.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[S.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:[S.jsx("span",{className:"text-muted-foreground truncate",title:e,children:e.split("/").pop()||e}),S.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:S.jsx(Se,{icon:vo,size:14,strokeWidth:2})})]}),S.jsx("div",{className:"flex flex-1 items-center justify-center p-4 bg-[#0d1117]",children:S.jsx("img",{src:t.content,alt:e,className:"max-w-full max-h-full object-contain"})})]});const f=e.split("/").pop()||e;return S.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[S.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:[S.jsx("span",{className:"text-muted-foreground truncate flex-1",title:e,children:f}),t.truncated&&S.jsxs("span",{className:"text-yellow-500",children:["Truncated (",t.lineCount.toLocaleString()," lines)"]}),S.jsxs("span",{className:"text-muted-foreground",children:[(t.size/1024).toFixed(1)," KB"]}),S.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[S.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked),className:"w-3 h-3"}),"Wrap"]}),S.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:S.jsx(Se,{icon:vo,size:14,strokeWidth:2})})]}),S.jsx(cd,{className:"flex-1 min-h-0",children:a?S.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm",children:"Highlighting..."}):u?S.jsx("div",{className:ze("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}}):S.jsx("pre",{className:ze("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function jV({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=hB(e),{data:a,isLoading:l,error:d}=mI(t),{data:p,isLoading:f,error:g}=gI(t,n),x=k.useCallback(_=>{o(_)},[o]),C=k.useCallback(()=>{o(null)},[o]),w=k.useCallback(_=>{u(_)},[u]);return t?l?S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):d?S.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message}):S.jsxs(Jo,{direction:"horizontal",className:"h-full",children:[S.jsx(Jr,{defaultSize:65,minSize:30,className:"overflow-hidden",children:S.jsx(IV,{filePath:n,content:p??null,isLoading:f,error:g,onClose:C})}),S.jsx(ea,{withHandle:!0}),S.jsx(Jr,{defaultSize:35,minSize:15,children:S.jsx(cd,{className:"h-full",children:S.jsx(mB,{entries:a?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:x,onToggleDir:w,onCollapseAll:h})})})]}):S.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}function NV({...e}){return S.jsx(S9,{"data-slot":"dropdown-menu",...e})}function BV({...e}){return S.jsx(w9,{"data-slot":"dropdown-menu-trigger",...e})}function zV({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return S.jsx(u9,{children:S.jsx(d9,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:S.jsx(l9,{"data-slot":"dropdown-menu-content",className:ze("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 HV({...e}){return S.jsx(h9,{"data-slot":"dropdown-menu-radio-group",...e})}function VV({className:e,children:t,...n}){return S.jsxs(m9,{"data-slot":"dropdown-menu-radio-item",className:ze("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:[S.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:S.jsx(g9,{children:S.jsx(Se,{icon:La,strokeWidth:2})})}),t]})}const HT=xs("/tasks/$taskId")({component:UV}),Aw={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},FV={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}=HT.useParams(),t=_o(),n=I3(),{data:s,isLoading:o}=JR(e),u=N0(),h=uI(),{tab:a,setTab:l}=iB(e),d=Lk(),p=Ak(),f=Ok(),{data:g}=Tp(),{data:x}=Lp(),{data:C}=oB(s?.linearTicketId??null),w=n.state,_=w?.aiMode&&w?.description?w.aiMode:void 0,y=w?.description,[v,b]=k.useState(!1),[E,T]=k.useState(null),[A,M]=k.useState(!1),[L,D]=k.useState(!1),[H,z]=k.useState(null),[q,j]=k.useState(!1),[K,$]=k.useState(!1),[V,G]=k.useState(null),[U,P]=k.useState(!1),[B,I]=k.useState(!1),[W,Y]=k.useState(!1),{terminals:J,writeToTerminal:Z}=$0();k.useEffect(()=>{if(L){const de=setTimeout(()=>D(!1),3e3);return()=>clearTimeout(de)}},[L]),k.useEffect(()=>{if(K){const de=setTimeout(()=>$(!1),3e3);return()=>clearTimeout(de)}},[K]),k.useEffect(()=>{if(B){const de=setTimeout(()=>I(!1),3e3);return()=>clearTimeout(de)}},[B]);const ee=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){T(null),D(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),D(!0)}catch(de){const xe=de instanceof Error?de.message:"Sync failed";T(xe),M(!0)}}},X=()=>{if(!s||!E)return"";const de=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${de} | Error: ${E} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${de} branch`},F=()=>{if(!s||!H)return"";const de=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${de} | 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 ${de} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},se=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){z(null),$(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),$(!0),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(de){const xe=de instanceof Error?de.message:"Merge failed";z(xe),j(!0)}}},ne=async()=>{if(s?.repoPath){G(null),I(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),I(!0)}catch(de){const xe=de instanceof Error?de.message:"Sync parent failed";G(xe),P(!0)}}},re=()=>{if(!s||!V)return"";const de=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${de} | Error: ${V} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${de}`},oe=J.find(de=>de.cwd===s?.worktreePath),le=()=>{if(!oe)return;const de=X();Z(oe.id,de+"\r"),M(!1)},_e=()=>{if(!oe)return;const xe=`claude -p "${X().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;Z(oe.id,xe),M(!1)},ve=()=>{if(!oe)return;const de=F();Z(oe.id,de+"\r"),j(!1)},he=()=>{if(!oe)return;const xe=`claude -p "${F().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;Z(oe.id,xe),j(!1)},ue=()=>{if(!oe)return;const de=re();Z(oe.id,de+"\r"),P(!1)},Ie=()=>{if(!oe)return;const xe=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;Z(oe.id,xe),P(!1)},Me=()=>{Y(!0)},Ae=()=>{if(!s?.worktreePath)return;const de=Wh(s.worktreePath,g,x);window.open(de,"_blank"),Y(!1)},be=()=>{if(!s?.repoPath)return;const de=Wh(s.repoPath,g,x);window.open(de,"_blank"),Y(!1)},Oe=de=>{s&&u.mutate({taskId:s.id,updates:{status:de}})},me=()=>{s&&h.mutate(s.id,{onSuccess:()=>{t({to:"/tasks"})}})};return o?S.jsx("div",{className:"flex h-full items-center justify-center",children:S.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):s?S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[S.jsxs("div",{className:"flex-1",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("h1",{className:"text-sm font-medium",children:s.title}),S.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>b(!0),title:"Task settings",children:S.jsx(Se,{icon:$2,size:14,strokeWidth:2})})]}),S.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[S.jsx("span",{children:s.repoName}),S.jsx(Se,{icon:t_,size:12,strokeWidth:2}),S.jsx("span",{className:"font-mono",children:s.branch}),s.prUrl&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-muted-foreground/50",children:"•"}),S.jsxs("a",{href:s.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:de=>de.stopPropagation(),children:[S.jsx(Se,{icon:J_,size:14,strokeWidth:2}),S.jsxs("span",{children:["#",s.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),s.linearTicketUrl&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-muted-foreground/50",children:"•"}),S.jsxs("a",{href:s.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:de=>de.stopPropagation(),title:C?.title,children:[S.jsx(Se,{icon:e0,size:14,strokeWidth:2}),S.jsx("span",{children:s.linearTicketId}),C?.status&&S.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",C.status,")"]})]})]})]})]}),S.jsxs(NV,{children:[S.jsx(BV,{render:S.jsx(je,{variant:"ghost",size:"sm",className:FV[s.status]}),children:Aw[s.status]}),S.jsx(zV,{align:"end",children:S.jsx(HV,{value:s.status,onValueChange:Oe,children:Object.entries(Aw).map(([de,xe])=>S.jsx(VV,{value:de,children:xe},de))})})]}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:ee,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:S.jsx(Se,{icon:I2,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:se,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:S.jsx(Se,{icon:z2,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:ne,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:S.jsx(Se,{icon:q2,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:Me,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:S.jsx(Se,{icon:t0,size:16,strokeWidth:2})}),L&&S.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),K&&S.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),B&&S.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),S.jsxs(oc,{children:[S.jsx(ac,{render:S.jsx(je,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:S.jsx(Se,{icon:Xu,size:16,strokeWidth:2})}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsx(dc,{children:"Delete Task"}),S.jsxs(fc,{children:['This will permanently delete "',s.title,'", close its terminal, and remove its worktree. This action cannot be undone.']})]}),S.jsxs(uc,{children:[S.jsx(hc,{children:"Cancel"}),S.jsx(ck,{onClick:me,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),S.jsxs(Jo,{direction:"horizontal",className:"min-h-0 flex-1",children:[S.jsx(Jr,{defaultSize:50,minSize:30,children:S.jsx(aB,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,aiMode:_,description:y,startupScript:s.startupScript})}),S.jsx(ea,{withHandle:!0}),S.jsx(Jr,{defaultSize:50,minSize:30,children:S.jsxs(Cp,{value:a,onValueChange:l,className:"flex h-full flex-col",children:[S.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:S.jsxs(wp,{variant:"line",children:[S.jsxs(mo,{value:"diff",children:[S.jsx(Se,{icon:KM,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),S.jsxs(mo,{value:"browser",children:[S.jsx(Se,{icon:H2,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),S.jsxs(mo,{value:"files",children:[S.jsx(Se,{icon:Ss,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),S.jsx(ga,{value:"diff",className:"flex-1 overflow-hidden",children:S.jsx(uB,{taskId:s.id,worktreePath:s.worktreePath})}),S.jsx(ga,{value:"browser",className:"flex-1 overflow-hidden",children:S.jsx(fB,{taskId:s.id})}),S.jsx(ga,{value:"files",className:"flex-1 overflow-hidden",children:S.jsx(jV,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),S.jsx(Xk,{task:s,open:v,onOpenChange:b}),S.jsx(_s,{open:W,onOpenChange:Y,children:S.jsxs(ys,{className:"sm:max-w-sm",children:[S.jsxs(js,{children:[S.jsx(Ns,{children:"Open in VS Code"}),S.jsx(ia,{children:"Choose which folder to open"})]}),S.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[S.jsxs(je,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Ae,disabled:!s.worktreePath,children:[S.jsx(Se,{icon:t_,size:16,strokeWidth:2,className:"mr-2"}),"Worktree",S.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.branch})]}),S.jsxs(je,{variant:"outline",className:"justify-start font-mono text-sm",onClick:be,disabled:!s.repoPath,children:[S.jsx(Se,{icon:Ss,size:16,strokeWidth:2,className:"mr-2"}),"Repository",S.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.repoName})]})]})]})}),S.jsx(_s,{open:A,onOpenChange:M,children:S.jsxs(ys,{className:"sm:max-w-md",children:[S.jsxs(js,{children:[S.jsx(Ns,{className:"text-destructive",children:"Sync Failed"}),S.jsx(ia,{children:"An error occurred while syncing with upstream."})]}),S.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:E}),S.jsxs(po,{className:"mt-4 gap-2",children:[S.jsx(je,{variant:"outline",onClick:()=>M(!1),children:"Close"}),S.jsx(je,{variant:"outline",onClick:le,disabled:!oe,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),S.jsx(je,{variant:"destructive",onClick:_e,disabled:!oe,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),S.jsx(_s,{open:q,onOpenChange:j,children:S.jsxs(ys,{className:"sm:max-w-md",children:[S.jsxs(js,{children:[S.jsx(Ns,{className:"text-destructive",children:"Merge Failed"}),S.jsxs(ia,{children:["An error occurred while merging to ",s?.baseBranch||"main","."]})]}),S.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:H}),S.jsxs(po,{className:"mt-4 gap-2",children:[S.jsx(je,{variant:"outline",onClick:()=>j(!1),children:"Close"}),S.jsx(je,{variant:"outline",onClick:ve,disabled:!oe,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),S.jsx(je,{variant:"destructive",onClick:he,disabled:!oe,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),S.jsx(_s,{open:U,onOpenChange:P,children:S.jsxs(ys,{className:"sm:max-w-md",children:[S.jsxs(js,{children:[S.jsx(Ns,{className:"text-destructive",children:"Sync Parent Failed"}),S.jsx(ia,{children:"An error occurred while syncing the parent repository with origin."})]}),S.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:V}),S.jsxs(po,{className:"mt-4 gap-2",children:[S.jsx(je,{variant:"outline",onClick:()=>P(!1),children:"Close"}),S.jsx(je,{variant:"outline",onClick:ue,disabled:!oe,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),S.jsx(je,{variant:"destructive",onClick:Ie,disabled:!oe,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})})]}):S.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),S.jsx(qn,{to:"/tasks",children:S.jsx(je,{variant:"outline",children:"Back to Tasks"})})]})}const VT=xs("/repositories/$repoId")({component:WV});function WV(){const{repoId:e}=VT.useParams(),t=_o(),{data:n,isLoading:s,error:o}=TI(e),u=LI(),h=rk(),{data:a}=Tp(),{data:l}=Lp(),[d,p]=k.useState(""),[f,g]=k.useState(""),[x,C]=k.useState(""),[w,_]=k.useState(!1);k.useEffect(()=>{n&&(p(n.displayName),g(n.startupScript||""),C(n.copyFiles||""),_(!1))},[n]),k.useEffect(()=>{if(n){const E=d!==n.displayName||f!==(n.startupScript||"")||x!==(n.copyFiles||"");_(E)}},[d,f,x,n]);const y=()=>{n&&u.mutate({id:n.id,updates:{displayName:d.trim()||n.path.split("/").pop()||"repo",startupScript:f.trim()||null,copyFiles:x.trim()||null}})},v=async()=>{n&&(await h.mutateAsync(n.id),t({to:"/repositories"}))},b=()=>{if(!n)return;const E=Wh(n.path,a,l);window.open(E,"_blank")};return s?S.jsx("div",{className:"flex h-full items-center justify-center",children:S.jsx(Se,{icon:Nr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):o||!n?S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2",children:S.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[S.jsx(Se,{icon:PS,size:16,strokeWidth:2}),"Repositories"]})}),S.jsx("div",{className:"flex flex-1 items-center justify-center",children:S.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[S.jsx(Se,{icon:Jl,size:20,strokeWidth:2}),S.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):S.jsxs("div",{className:"flex h-full flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs(qn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[S.jsx(Se,{icon:PS,size:16,strokeWidth:2}),"Repositories"]}),S.jsx("span",{className:"text-muted-foreground",children:"/"}),S.jsx("span",{className:"text-sm font-medium",children:n.displayName})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(je,{variant:"ghost",size:"icon-sm",onClick:b,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:S.jsx(Se,{icon:t0,size:14,strokeWidth:2})}),S.jsxs(oc,{children:[S.jsxs(ac,{render:S.jsx(je,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive"}),children:[S.jsx(Se,{icon:Xu,size:14,strokeWidth:2,"data-slot":"icon"}),"Delete"]}),S.jsxs(lc,{children:[S.jsxs(cc,{children:[S.jsx(dc,{children:"Delete Repository"}),S.jsxs(fc,{children:['This will remove "',n.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),S.jsxs(uc,{children:[S.jsx(hc,{children:"Cancel"}),S.jsx(je,{variant:"destructive",onClick:v,children:"Delete"})]})]})]}),S.jsx(je,{size:"sm",onClick:y,disabled:!w||u.isPending,children:u.isPending?"Saving...":"Save"})]})]}),S.jsx("div",{className:"flex-1 overflow-auto p-4",children:S.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[S.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[S.jsx(Se,{icon:Ss,size:14,strokeWidth:2}),S.jsx("span",{className:"font-mono",children:n.path})]}),S.jsxs(id,{children:[S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"displayName",children:"Display Name"}),S.jsx(Wt,{id:"displayName",value:d,onChange:E=>p(E.target.value),placeholder:n.path.split("/").pop()||"My Project"})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"startupScript",children:"Startup Script"}),S.jsx(Sp,{id:"startupScript",value:f,onChange:E=>g(E.target.value),placeholder:"npm install && npm run dev",rows:3}),S.jsx(so,{children:"Command to run in the terminal when creating a worktree."})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"copyFiles",children:"Copy Files"}),S.jsx(Wt,{id:"copyFiles",value:x,onChange:E=>C(E.target.value),placeholder:".env, config.local.json"}),S.jsx(so,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]})]})})]})}const qV=Rj.update({id:"/",path:"/",getParentRoute:()=>Gs}),GV=Pj.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Gs}),$V=DN.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Gs}),KV=z7.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Gs}),YV=F7.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Gs}),XV=Z7.update({id:"/review/",path:"/review/",getParentRoute:()=>Gs}),QV=eB.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Gs}),ZV=HT.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Gs}),JV=VT.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Gs}),eF={IndexRoute:qV,RepositoriesRepoIdRoute:JV,TasksTaskIdRoute:ZV,RepositoriesIndexRoute:QV,ReviewIndexRoute:XV,SettingsIndexRoute:YV,TasksIndexRoute:KV,TerminalsIndexRoute:$V,WorktreesIndexRoute:GV},tF=Gs._addFileChildren(eF)._addFileTypes(),FT=k.createContext(null);function nF({children:e}){const[t,n]=k.useState(!1),[s,o]=k.useState(!0),[u,h]=k.useState(!1),[a,l]=k.useState(!1),d=k.useCallback(async()=>{try{const x=await fetch("/api/auth/check");if(x.ok){const C=await x.json();h(C.authRequired),n(C.authenticated),C.authRequired&&!C.authenticated&&l(!0)}}catch{h(!1),n(!0)}finally{o(!1)}},[]);k.useEffect(()=>{d()},[d]),k.useEffect(()=>{const x=()=>{u&&(n(!1),l(!0))};return window.addEventListener("vibora:auth-required",x),()=>window.removeEventListener("vibora:auth-required",x)},[u]);const p=k.useCallback(async(x,C)=>{const w=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:x,password:C})});if(!w.ok){const _=await w.json();throw new Error(_.error||"Login failed")}n(!0),l(!1)},[]),f=k.useCallback(async()=>{await fetch("/api/auth/logout",{method:"POST"}),n(!1),l(!0)},[]),g=k.useMemo(()=>({isAuthenticated:t,isLoading:s,authRequired:u,showLoginModal:a,setShowLoginModal:l,login:p,logout:f}),[t,s,u,a,p,f]);return S.jsx(FT.Provider,{value:g,children:e})}function rF(){const e=k.useContext(FT);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function sF(){const{showLoginModal:e,login:t}=rF(),[n,s]=k.useState(""),[o,u]=k.useState(""),[h,a]=k.useState(null),[l,d]=k.useState(!1),p=k.useCallback(async g=>{g.preventDefault(),a(null),d(!0);try{await t(n,o)}catch(x){a(x instanceof Error?x.message:"Login failed")}finally{d(!1)}},[n,o,t]),f=g=>{g.key==="Enter"&&!l&&n&&o&&(g.preventDefault(),p(g))};return S.jsx(_s,{open:e,children:S.jsxs(ys,{showCloseButton:!1,className:"sm:max-w-sm",onKeyDown:f,children:[S.jsx(js,{children:S.jsx(Ns,{children:"Login to Vibora"})}),S.jsxs("form",{onSubmit:p,children:[S.jsxs(id,{className:"mt-4",children:[S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"login-username",children:"Username"}),S.jsx(Wt,{id:"login-username",type:"text",value:n,onChange:g=>s(g.target.value),autoComplete:"username",autoFocus:!0,required:!0})]}),S.jsxs(Cn,{children:[S.jsx(wn,{htmlFor:"login-password",children:"Password"}),S.jsx(Wt,{id:"login-password",type:"password",value:o,onChange:g=>u(g.target.value),autoComplete:"current-password",required:!0})]}),h&&S.jsx("p",{className:"text-sm text-red-500",children:h})]}),S.jsx(po,{className:"mt-4",children:S.jsx(je,{type:"submit",disabled:l||!n||!o,children:l?"Logging in...":"Login"})})]})]})})}const iF=new sO({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),oF=O3({routeTree:tF});eA.createRoot(document.getElementById("root")).render(S.jsx(k.StrictMode,{children:S.jsx(iO,{client:iF,children:S.jsxs(nF,{children:[S.jsx(P3,{router:oF}),S.jsx(sF,{})]})})}));
|