vibora 0.1.14 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,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 BL(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 Tw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fg={exports:{}},iu={};var jS;function zL(){if(jS)return iu;jS=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 iu.Fragment=t,iu.jsx=n,iu.jsxs=n,iu}var NS;function HL(){return NS||(NS=1,Fg.exports=zL()),Fg.exports}var x=HL(),Ug={exports:{}},pt={};var BS;function VL(){if(BS)return pt;BS=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"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function b(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function y(I,G,K){this.props=I,this.context=G,this.refs=_,this.updater=K||w}y.prototype.isReactComponent={},y.prototype.setState=function(I,G){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,G,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=y.prototype;function S(I,G,K){this.props=I,this.context=G,this.refs=_,this.updater=K||w}var E=S.prototype=new v;E.constructor=S,C(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,G,K){var J=K.ref;return{$$typeof:e,type:I,key:G,ref:J!==void 0?J:null,props:K}}function U(I,G){return D(I.type,G,I.props)}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function W(I){var G={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(K){return G[K]})}var j=/\/+/g;function Y(I,G){return typeof I=="object"&&I!==null&&I.key!=null?W(""+I.key):G.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(G){I.status==="pending"&&(I.status="fulfilled",I.value=G)},function(G){I.status==="pending"&&(I.status="rejected",I.reason=G)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function V(I,G,K,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),G,K,J,Z)}}if(X)return Z=Z(I),X=J===""?"."+Y(I,0):J,T(Z)?(K="",X!=null&&(K=X.replace(j,"$&/")+"/"),V(Z,G,K,"",function(re){return re})):Z!=null&&(z(Z)&&(Z=U(Z,K+(Z.key==null||I&&I.key===Z.key?"":(""+Z.key).replace(j,"$&/")+"/")+X)),G.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+Y(J,se),X+=V(J,G,K,ee,Z);else if(se=b(I),typeof se=="function")for(I=se.call(I),se=0;!(J=I.next()).done;)J=J.value,ee=F+Y(J,se++),X+=V(J,G,K,ee,Z);else if(ee==="object"){if(typeof I.then=="function")return V($(I),G,K,J,Z);throw G=String(I),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return X}function q(I,G,K){if(I==null)return I;var J=[],Z=0;return V(I,J,"","",function(ee){return G.call(K,ee,Z++)}),J}function H(I){if(I._status===-1){var G=I._result;G=G(),G.then(function(K){(I._status===0||I._status===-1)&&(I._status=1,I._result=K)},function(K){(I._status===0||I._status===-1)&&(I._status=2,I._result=K)}),I._status===-1&&(I._status=0,I._result=G)}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 G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},B={map:q,forEach:function(I,G,K){q(I,function(){G.apply(this,arguments)},K)},count:function(I){var G=0;return q(I,function(){G++}),G},toArray:function(I){return q(I,function(G){return G})||[]},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=S,pt.StrictMode=s,pt.Suspense=c,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,G,K){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=C({},I.props),Z=I.key;if(G!=null)for(ee in G.key!==void 0&&(Z=""+G.key),G)!L.call(G,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&G.ref===void 0||(J[ee]=G[ee]);var ee=arguments.length-2;if(ee===1)J.children=K;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,G,K){var J,Z={},ee=null;if(G!=null)for(J in G.key!==void 0&&(ee=""+G.key),G)L.call(G,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Z[J]=G[J]);var X=arguments.length-2;if(X===1)Z.children=K;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:H}},pt.memo=function(I,G){return{$$typeof:d,type:I,compare:G===void 0?null:G}},pt.startTransition=function(I){var G=M.T,K={};M.T=K;try{var J=I(),Z=M.S;Z!==null&&Z(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(A,P)}catch(ee){P(ee)}finally{G!==null&&K.types!==null&&(G.types=K.types),M.T=G}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(I){return M.H.use(I)},pt.useActionState=function(I,G,K){return M.H.useActionState(I,G,K)},pt.useCallback=function(I,G){return M.H.useCallback(I,G)},pt.useContext=function(I){return M.H.useContext(I)},pt.useDebugValue=function(){},pt.useDeferredValue=function(I,G){return M.H.useDeferredValue(I,G)},pt.useEffect=function(I,G){return M.H.useEffect(I,G)},pt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(I,G,K){return M.H.useImperativeHandle(I,G,K)},pt.useInsertionEffect=function(I,G){return M.H.useInsertionEffect(I,G)},pt.useLayoutEffect=function(I,G){return M.H.useLayoutEffect(I,G)},pt.useMemo=function(I,G){return M.H.useMemo(I,G)},pt.useOptimistic=function(I,G){return M.H.useOptimistic(I,G)},pt.useReducer=function(I,G,K){return M.H.useReducer(I,G,K)},pt.useRef=function(I){return M.H.useRef(I)},pt.useState=function(I){return M.H.useState(I)},pt.useSyncExternalStore=function(I,G,K){return M.H.useSyncExternalStore(I,G,K)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var zS;function Wu(){return zS||(zS=1,Ug.exports=VL()),Ug.exports}var k=Wu();const Ie=Tw(k),Lw=BL({__proto__:null,default:Ie},[k]);var Wg={exports:{}},ou={},qg={exports:{}},Gg={};var HS;function FL(){return HS||(HS=1,(function(e){function t(V,q){var H=V.length;V.push(q);e:for(;0<H;){var P=H-1>>>1,B=V[P];if(0<o(B,q))V[P]=q,V[H]=B,H=P;else break e}}function n(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var q=V[0],H=V.pop();if(H!==q){V[0]=H;e:for(var P=0,B=V.length,I=B>>>1;P<I;){var G=2*(P+1)-1,K=V[G],J=G+1,Z=V[J];if(0>o(K,H))J<B&&0>o(Z,K)?(V[P]=Z,V[J]=H,P=J):(V[P]=K,V[G]=H,P=G);else if(J<B&&0>o(Z,H))V[P]=Z,V[J]=H,P=J;else break e}}return q}function o(V,q){var H=V.sortIndex-q.sortIndex;return H!==0?H:V.id-q.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 c=[],d=[],p=1,f=null,g=3,b=!1,w=!1,C=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var q=n(d);q!==null;){if(q.callback===null)s(d);else if(q.startTime<=V)s(d),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(d)}}function T(V){if(C=!1,E(V),!w)if(n(c)!==null)w=!0,A||(A=!0,W());else{var q=n(d);q!==null&&$(T,q.startTime-V)}}var A=!1,M=-1,L=5,D=-1;function U(){return _?!0:!(e.unstable_now()-D<L)}function z(){if(_=!1,A){var V=e.unstable_now();D=V;var q=!0;try{e:{w=!1,C&&(C=!1,v(M),M=-1),b=!0;var H=g;try{t:{for(E(V),f=n(c);f!==null&&!(f.expirationTime>V&&U());){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),q=!0;break t}f===n(c)&&s(c),E(V)}else s(c);f=n(c)}if(f!==null)q=!0;else{var I=n(d);I!==null&&$(T,I.startTime-V),q=!1}}break e}finally{f=null,g=H,b=!1}q=void 0}}finally{q?W():A=!1}}}var W;if(typeof S=="function")W=function(){S(z)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,Y=j.port2;j.port1.onmessage=z,W=function(){Y.postMessage(null)}}else W=function(){y(z,0)};function $(V,q){M=y(function(){V(e.unstable_now())},q)}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 q=3;break;default:q=g}var H=g;g=q;try{return V()}finally{g=H}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(V,q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var H=g;g=V;try{return q()}finally{g=H}},e.unstable_scheduleCallback=function(V,q,H){var P=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?P+H:P):H=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=H+B,V={id:p++,callback:q,priorityLevel:V,startTime:H,expirationTime:B,sortIndex:-1},H>P?(V.sortIndex=H,t(d,V),n(c)===null&&V===n(d)&&(C?(v(M),M=-1):C=!0,$(T,H-P))):(V.sortIndex=B,t(c,V),w||b||(w=!0,A||(A=!0,W()))),V},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(V){var q=g;return function(){var H=g;g=q;try{return V.apply(this,arguments)}finally{g=H}}}})(Gg)),Gg}var VS;function UL(){return VS||(VS=1,qg.exports=FL()),qg.exports}var $g={exports:{}},Yn={};var FS;function WL(){if(FS)return Yn;FS=1;var e=Wu();function t(c){var d="https://react.dev/errors/"+c;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 #"+c+"; 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(c,d,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:c,containerInfo:d,implementation:p}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Yn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Yn.createPortal=function(c,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(c,d,null,p)},Yn.flushSync=function(c){var d=h.T,p=s.p;try{if(h.T=null,s.p=2,c)return c()}finally{h.T=d,s.p=p,s.d.f()}},Yn.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(c,d))},Yn.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},Yn.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?s.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:b}):p==="script"&&s.d.X(c,{crossOrigin:f,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Yn.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=a(d.as,d.crossOrigin);s.d.M(c,{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(c)},Yn.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin);s.d.L(c,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})}},Yn.preloadModule=function(c,d){if(typeof c=="string")if(d){var p=a(d.as,d.crossOrigin);s.d.m(c,{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(c)},Yn.requestFormReset=function(c){s.d.r(c)},Yn.unstable_batchedUpdates=function(c,d){return c(d)},Yn.useFormState=function(c,d,p){return h.H.useFormState(c,d,p)},Yn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Yn.version="19.2.3",Yn}var US;function Aw(){if(US)return $g.exports;US=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(),$g.exports=WL(),$g.exports}var WS;function qL(){if(WS)return ou;WS=1;var e=UL(),t=Wu(),n=Aw();function s(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}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,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l: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 c(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 l=r,m=i;;){var R=l.return;if(R===null)break;var O=R.alternate;if(O===null){if(m=R.return,m!==null){l=m;continue}break}if(R.child===O.child){for(O=R.child;O;){if(O===l)return c(R),r;if(O===m)return c(R),i;O=O.sibling}throw Error(s(188))}if(l.return!==m.return)l=R,m=O;else{for(var N=!1,Q=R.child;Q;){if(Q===l){N=!0,l=R,m=O;break}if(Q===m){N=!0,m=R,l=O;break}Q=Q.sibling}if(!N){for(Q=O.child;Q;){if(Q===l){N=!0,l=O,m=R;break}if(Q===m){N=!0,m=O,l=R;break}Q=Q.sibling}if(!N)throw Error(s(189))}}if(l.alternate!==m)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?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"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),S=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"),U=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function W(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 Y(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 C: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 w:return"Portal";case S: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:Y(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return Y(r(i))}catch{}}return null}var $=Array.isArray,V=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},P=[],B=-1;function I(r){return{current:r}}function G(r){0>B||(r.current=P[B],P[B]=null,B--)}function K(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(K(ee,i),K(Z,r),K(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?iS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=iS(i),r=oS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(J),K(J,r)}function se(){G(J),G(Z),G(ee)}function re(r){r.memoizedState!==null&&K(X,r);var i=J.current,l=oS(i,r.type);i!==l&&(K(Z,r),K(J,l))}function ne(r){Z.current===r&&(G(J),G(Z)),X.current===r&&(G(X),tu._currentValue=H)}var oe,ce;function _e(r){if(oe===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);oe=i&&i[1]||"",ce=-1<l.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+oe+r+ce}var ve=!1;function he(r,i){if(!r||ve)return"";ve=!0;var l=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
+ `),me=Q.split(`
6
+ `);for(R=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;R<me.length&&!me[R].includes("DetermineComponentFrameRoot");)R++;if(m===ie.length||R===me.length)for(m=ie.length-1,R=me.length-1;1<=m&&0<=R&&ie[m]!==me[R];)R--;for(;1<=m&&0<=R;m--,R--)if(ie[m]!==me[R]){if(m!==1||R!==1)do if(m--,R--,0>R||ie[m]!==me[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=l}return(l=r?r.displayName||r.name:"")?_e(l):""}function fe(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 De(r){try{var i="",l=null;do i+=fe(r,l),l=r,r=r.return;while(r);return i}catch(m){return`
8
+ Error generating stack: `+m.message+`
9
+ `+m.stack}}var Ae=Object.prototype.hasOwnProperty,Pe=e.unstable_scheduleCallback,Se=e.unstable_cancelCallback,be=e.unstable_shouldYield,ae=e.unstable_requestPaint,xe=e.unstable_now,Re=e.unstable_getCurrentPriorityLevel,Ue=e.unstable_ImmediatePriority,nt=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,st=e.unstable_LowPriority,et=e.unstable_IdlePriority,ht=e.log,qe=e.unstable_setDisableYieldValue,$e=null,ue=null;function je(r){if(typeof ht=="function"&&qe(r),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode($e,r)}catch{}}var rt=Math.clz32?Math.clz32:Ct,Xe=Math.log,it=Math.LN2;function Ct(r){return r>>>=0,r===0?32:31-(Xe(r)/it|0)|0}var lt=256,tn=262144,kt=4194304;function vt(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Je(r,i,l){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):l||(l=Q&~r,l!==0&&(R=vt(l))))):(Q=m&~O,Q!==0?R=vt(Q):N!==0?R=vt(N):l||(l=m&~r,l!==0&&(R=vt(l)))),R===0?0:i!==0&&i!==R&&(i&O)===0&&(O=R&-R,l=i&-i,O>=l||O===32&&(l&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 at(){var r=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),r}function wt(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function bt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function St(r,i,l,m,R,O){var N=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var Q=r.entanglements,ie=r.expirationTimes,me=r.hiddenUpdates;for(l=N&~l;0<l;){var we=31-rt(l),Te=1<<we;Q[we]=0,ie[we]=-1;var ge=me[we];if(ge!==null)for(me[we]=null,we=0;we<ge.length;we++){var ye=ge[we];ye!==null&&(ye.lane&=-536870913)}l&=~Te}m!==0&&Qe(r,m,0),O!==0&&R===0&&r.tag!==0&&(r.suspendedLanes|=O&~(N&~i))}function Qe(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-rt(i);r.entangledLanes|=i,r.entanglements[m]=r.entanglements[m]|1073741824|l&261930}function Ht(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var m=31-rt(l),R=1<<m;R&i|r[m]&i&&(r[m]|=i),l&=~R}}function wn(r,i){var l=i&-i;return l=(l&42)!==0?1:Kn(l),(l&(r.suspendedLanes|i))!==0?0:l}function Kn(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 Bn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ys(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:LS(r.type))}function za(r,i){var l=q.p;try{return q.p=r,i()}finally{q.p=l}}var _r=Math.random().toString(36).slice(2),hn="__reactFiber$"+_r,pn="__reactProps$"+_r,bs="__reactContainer$"+_r,yr="__reactEvents$"+_r,qs="__reactListeners$"+_r,jp="__reactHandles$"+_r,hc="__reactResources$"+_r,wo="__reactMarker$"+_r;function Eo(r){delete r[hn],delete r[pn],delete r[yr],delete r[qs],delete r[jp]}function Gs(r){var i=r[hn];if(i)return i;for(var l=r.parentNode;l;){if(i=l[bs]||l[hn]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=hS(r);r!==null;){if(l=r[hn])return l;r=hS(r)}return i}r=l,l=r.parentNode}return null}function Ss(r){if(r=r[hn]||r[bs]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Ro(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(s(33))}function os(r){var i=r[hc];return i||(i=r[hc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function mn(r){r[wo]=!0}var er=new Set,tr={};function br(r,i){as(r,i),as(r+"Capture",i)}function as(r,i){for(tr[r]=i,r=0;r<i.length;r++)er.add(i[r])}var Np=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]*$"),Ha={},Va={};function Bp(r){return Ae.call(Va,r)?!0:Ae.call(Ha,r)?!1:Np.test(r)?Va[r]=!0:(Ha[r]=!0,!1)}function $s(r,i,l){if(Bp(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){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,""+l)}}function Ri(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function Sr(r,i,l,m){if(m===null)r.removeAttribute(l);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+m)}}function ir(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function vd(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function zp(r,i,l){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){l=""+N,O.call(this,N)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return l},setValue:function(N){l=""+N},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function pc(r){if(!r._valueTracker){var i=vd(r)?"checked":"value";r._valueTracker=zp(r,i,""+r[i])}}function Fa(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),m="";return r&&(m=vd(r)?r.checked?"true":"false":r.value),r=m,r!==l?(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 mc=/[\n"\\]/g;function or(r){return r.replace(mc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function gc(r,i,l,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=""+ir(i)):r.value!==""+ir(i)&&(r.value=""+ir(i)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),i!=null?vc(r,N,ir(i)):l!=null?vc(r,N,ir(l)):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=""+ir(Q):r.removeAttribute("name")}function _d(r,i,l,m,R,O,N,Q){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.type=O),i!=null||l!=null){if(!(O!=="submit"&&O!=="reset"||i!=null)){pc(r);return}l=l!=null?""+ir(l):"",i=i!=null?""+ir(i):l,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),pc(r)}function vc(r,i,l){i==="number"&&ki(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ti(r,i,l,m){if(r=r.options,i){i={};for(var R=0;R<l.length;R++)i["$"+l[R]]=!0;for(l=0;l<r.length;l++)R=i.hasOwnProperty("$"+r[l].value),r[l].selected!==R&&(r[l].selected=R),R&&m&&(r[l].defaultSelected=!0)}else{for(l=""+ir(l),i=null,R=0;R<r.length;R++){if(r[R].value===l){r[R].selected=!0,m&&(r[R].defaultSelected=!0);return}i!==null||r[R].disabled||(i=r[R])}i!==null&&(i.selected=!0)}}function yd(r,i,l){if(i!=null&&(i=""+ir(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+ir(l):""}function Ve(r,i,l,m){if(i==null){if(m!=null){if(l!=null)throw Error(s(92));if($(m)){if(1<m.length)throw Error(s(93));m=m[0]}l=m}l==null&&(l=""),i=l}l=ir(i),r.defaultValue=l,m=r.textContent,m===l&&m!==""&&m!==null&&(r.value=m),pc(r)}function tt(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.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,l){var m=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?m?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":m?r.setProperty(i,l):typeof l!="number"||l===0||mt.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function nn(r,i,l){if(i!=null&&typeof i!="object")throw Error(s(62));if(r=r.style,l!=null){for(var m in l)!l.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)&&l[R]!==m&&$t(r,R,m)}else for(var O in i)i.hasOwnProperty(O)&&$t(r,O,i[O])}function gn(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 Ks=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"]]),Ys=/^[\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 Xs(r){return Ys.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ls(){}var bd=null;function Hp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ua=null,Wa=null;function sy(r){var i=Ss(r);if(i&&(r=i.stateNode)){var l=r[pn]||null;e:switch(r=i.stateNode,i.type){case"input":if(gc(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+or(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var m=l[i];if(m!==r&&m.form===r.form){var R=m[pn]||null;if(!R)throw Error(s(90));gc(m,R.value,R.defaultValue,R.defaultValue,R.checked,R.defaultChecked,R.type,R.name)}}for(i=0;i<l.length;i++)m=l[i],m.form===r.form&&Fa(m)}break e;case"textarea":yd(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ti(r,!!l.multiple,i,!1)}}}var Vp=!1;function iy(r,i,l){if(Vp)return r(i,l);Vp=!0;try{var m=r(i);return m}finally{if(Vp=!1,(Ua!==null||Wa!==null)&&(lf(),Ua&&(i=Ua,r=Wa,Wa=Ua=null,sy(i),r)))for(i=0;i<r.length;i++)sy(r[i])}}function _c(r,i){var l=r.stateNode;if(l===null)return null;var m=l[pn]||null;if(m===null)return null;l=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(l&&typeof l!="function")throw Error(s(231,i,typeof l));return l}var Qs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fp=!1;if(Qs)try{var yc={};Object.defineProperty(yc,"passive",{get:function(){Fp=!0}}),window.addEventListener("test",yc,yc),window.removeEventListener("test",yc,yc)}catch{Fp=!1}var Li=null,Up=null,Sd=null;function oy(){if(Sd)return Sd;var r,i=Up,l=i.length,m,R="value"in Li?Li.value:Li.textContent,O=R.length;for(r=0;r<l&&i[r]===R[r];r++);var N=l-r;for(m=1;m<=N&&i[l-m]===R[O-m];m++);return Sd=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 Cd(){return!0}function ay(){return!1}function ar(r){function i(l,m,R,O,N){this._reactName=l,this._targetInst=R,this.type=m,this.nativeEvent=O,this.target=N,this.currentTarget=null;for(var Q in r)r.hasOwnProperty(Q)&&(l=r[Q],this[Q]=l?l(O):O[Q]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Cd:ay,this.isPropagationStopped=ay,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Cd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Cd)},persist:function(){},isPersistent:Cd}),i}var ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wd=ar(ko),bc=f({},ko,{view:0,detail:0}),jT=ar(bc),Wp,qp,Sc,Ed=f({},bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$p,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!==Sc&&(Sc&&r.type==="mousemove"?(Wp=r.screenX-Sc.screenX,qp=r.screenY-Sc.screenY):qp=Wp=0,Sc=r),Wp)},movementY:function(r){return"movementY"in r?r.movementY:qp}}),ly=ar(Ed),NT=f({},Ed,{dataTransfer:0}),BT=ar(NT),zT=f({},bc,{relatedTarget:0}),Gp=ar(zT),HT=f({},ko,{animationName:0,elapsedTime:0,pseudoElement:0}),VT=ar(HT),FT=f({},ko,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),UT=ar(FT),WT=f({},ko,{data:0}),cy=ar(WT),qT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GT={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"},$T={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KT(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=$T[r])?!!i[r]:!1}function $p(){return KT}var YT=f({},bc,{key:function(r){if(r.key){var i=qT[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"?GT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$p,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}}),XT=ar(YT),QT=f({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uy=ar(QT),ZT=f({},bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$p}),JT=ar(ZT),e5=f({},ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),t5=ar(e5),n5=f({},Ed,{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}),r5=ar(n5),s5=f({},ko,{newState:0,oldState:0}),i5=ar(s5),o5=[9,13,27,32],Kp=Qs&&"CompositionEvent"in window,xc=null;Qs&&"documentMode"in document&&(xc=document.documentMode);var a5=Qs&&"TextEvent"in window&&!xc,dy=Qs&&(!Kp||xc&&8<xc&&11>=xc),fy=" ",hy=!1;function py(r,i){switch(r){case"keyup":return o5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function my(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qa=!1;function l5(r,i){switch(r){case"compositionend":return my(i);case"keypress":return i.which!==32?null:(hy=!0,fy);case"textInput":return r=i.data,r===fy&&hy?null:r;default:return null}}function c5(r,i){if(qa)return r==="compositionend"||!Kp&&py(r,i)?(r=oy(),Sd=Up=Li=null,qa=!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 dy&&i.locale!=="ko"?null:i.data;default:return null}}var u5={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 gy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!u5[r.type]:i==="textarea"}function vy(r,i,l,m){Ua?Wa?Wa.push(m):Wa=[m]:Ua=m,i=mf(i,"onChange"),0<i.length&&(l=new wd("onChange","change",null,l,m),r.push({event:l,listeners:i}))}var Cc=null,wc=null;function d5(r){Jb(r,0)}function Rd(r){var i=Ro(r);if(Fa(i))return r}function _y(r,i){if(r==="change")return i}var yy=!1;if(Qs){var Yp;if(Qs){var Xp="oninput"in document;if(!Xp){var by=document.createElement("div");by.setAttribute("oninput","return;"),Xp=typeof by.oninput=="function"}Yp=Xp}else Yp=!1;yy=Yp&&(!document.documentMode||9<document.documentMode)}function Sy(){Cc&&(Cc.detachEvent("onpropertychange",xy),wc=Cc=null)}function xy(r){if(r.propertyName==="value"&&Rd(wc)){var i=[];vy(i,wc,r,Hp(r)),iy(d5,i)}}function f5(r,i,l){r==="focusin"?(Sy(),Cc=i,wc=l,Cc.attachEvent("onpropertychange",xy)):r==="focusout"&&Sy()}function h5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Rd(wc)}function p5(r,i){if(r==="click")return Rd(i)}function m5(r,i){if(r==="input"||r==="change")return Rd(i)}function g5(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var xr=typeof Object.is=="function"?Object.is:g5;function Ec(r,i){if(xr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),m=Object.keys(i);if(l.length!==m.length)return!1;for(m=0;m<l.length;m++){var R=l[m];if(!Ae.call(i,R)||!xr(r[R],i[R]))return!1}return!0}function Cy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function wy(r,i){var l=Cy(r);r=0;for(var m;l;){if(l.nodeType===3){if(m=r+l.textContent.length,r<=i&&m>=i)return{node:l,offset:i-r};r=m}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Cy(l)}}function Ey(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Ey(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Ry(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 l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=ki(r.document)}return i}function Qp(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 v5=Qs&&"documentMode"in document&&11>=document.documentMode,Ga=null,Zp=null,Rc=null,Jp=!1;function ky(r,i,l){var m=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jp||Ga==null||Ga!==ki(m)||(m=Ga,"selectionStart"in m&&Qp(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}),Rc&&Ec(Rc,m)||(Rc=m,m=mf(Zp,"onSelect"),0<m.length&&(i=new wd("onSelect","select",null,i,l),r.push({event:i,listeners:m}),i.target=Ga)))}function To(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var $a={animationend:To("Animation","AnimationEnd"),animationiteration:To("Animation","AnimationIteration"),animationstart:To("Animation","AnimationStart"),transitionrun:To("Transition","TransitionRun"),transitionstart:To("Transition","TransitionStart"),transitioncancel:To("Transition","TransitionCancel"),transitionend:To("Transition","TransitionEnd")},em={},Ty={};Qs&&(Ty=document.createElement("div").style,"AnimationEvent"in window||(delete $a.animationend.animation,delete $a.animationiteration.animation,delete $a.animationstart.animation),"TransitionEvent"in window||delete $a.transitionend.transition);function Lo(r){if(em[r])return em[r];if(!$a[r])return r;var i=$a[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Ty)return em[r]=i[l];return r}var Ly=Lo("animationend"),Ay=Lo("animationiteration"),Oy=Lo("animationstart"),_5=Lo("transitionrun"),y5=Lo("transitionstart"),b5=Lo("transitioncancel"),My=Lo("transitionend"),Dy=new Map,tm="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(" ");tm.push("scrollEnd");function cs(r,i){Dy.set(r,i),br(i,[r])}var kd=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)},Hr=[],Ka=0,nm=0;function Td(){for(var r=Ka,i=nm=Ka=0;i<r;){var l=Hr[i];Hr[i++]=null;var m=Hr[i];Hr[i++]=null;var R=Hr[i];Hr[i++]=null;var O=Hr[i];if(Hr[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&&Py(l,R,O)}}function Ld(r,i,l,m){Hr[Ka++]=r,Hr[Ka++]=i,Hr[Ka++]=l,Hr[Ka++]=m,nm|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function rm(r,i,l,m){return Ld(r,i,l,m),Ad(r)}function Ao(r,i){return Ld(r,null,null,i),Ad(r)}function Py(r,i,l){r.lanes|=l;var m=r.alternate;m!==null&&(m.lanes|=l);for(var R=!1,O=r.return;O!==null;)O.childLanes|=l,m=O.alternate,m!==null&&(m.childLanes|=l),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-rt(l),r=O.hiddenUpdates,m=r[R],m===null?r[R]=[i]:m.push(i),i.lane=l|536870912),O):null}function Ad(r){if(50<Kc)throw Kc=0,fg=null,Error(s(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ya={};function S5(r,i,l,m){this.tag=r,this.key=l,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 Cr(r,i,l,m){return new S5(r,i,l,m)}function sm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Zs(r,i){var l=r.alternate;return l===null?(l=Cr(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function Iy(r,i){r.flags&=65011714;var l=r.alternate;return l===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=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Od(r,i,l,m,R,O){var N=0;if(m=r,typeof r=="function")sm(r)&&(N=1);else if(typeof r=="string")N=RL(r,l,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Cr(31,l,i,R),r.elementType=D,r.lanes=O,r;case C:return Oo(l.children,R,O,i);case _:N=8,R|=24;break;case y:return r=Cr(12,l,i,R|2),r.elementType=y,r.lanes=O,r;case T:return r=Cr(13,l,i,R),r.elementType=T,r.lanes=O,r;case A:return r=Cr(19,l,i,R),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case S: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,l=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Cr(N,l,i,R),i.elementType=r,i.type=m,i.lanes=O,i}function Oo(r,i,l,m){return r=Cr(7,r,m,i),r.lanes=l,r}function im(r,i,l){return r=Cr(6,r,null,i),r.lanes=l,r}function jy(r){var i=Cr(18,null,null,0);return i.stateNode=r,i}function om(r,i,l){return i=Cr(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Ny=new WeakMap;function Vr(r,i){if(typeof r=="object"&&r!==null){var l=Ny.get(r);return l!==void 0?l:(i={value:r,source:i,stack:De(i)},Ny.set(r,i),i)}return{value:r,source:i,stack:De(i)}}var Xa=[],Qa=0,Md=null,kc=0,Fr=[],Ur=0,Ai=null,xs=1,Cs="";function Js(r,i){Xa[Qa++]=kc,Xa[Qa++]=Md,Md=r,kc=i}function By(r,i,l){Fr[Ur++]=xs,Fr[Ur++]=Cs,Fr[Ur++]=Ai,Ai=r;var m=xs;r=Cs;var R=32-rt(m)-1;m&=~(1<<R),l+=1;var O=32-rt(i)+R;if(30<O){var N=R-R%5;O=(m&(1<<N)-1).toString(32),m>>=N,R-=N,xs=1<<32-rt(i)+R|l<<R|m,Cs=O+r}else xs=1<<O|l<<R|m,Cs=r}function am(r){r.return!==null&&(Js(r,1),By(r,1,0))}function lm(r){for(;r===Md;)Md=Xa[--Qa],Xa[Qa]=null,kc=Xa[--Qa],Xa[Qa]=null;for(;r===Ai;)Ai=Fr[--Ur],Fr[Ur]=null,Cs=Fr[--Ur],Fr[Ur]=null,xs=Fr[--Ur],Fr[Ur]=null}function zy(r,i){Fr[Ur++]=xs,Fr[Ur++]=Cs,Fr[Ur++]=Ai,xs=i.id,Cs=i.overflow,Ai=r}var zn=null,Yt=null,At=!1,Oi=null,Wr=!1,cm=Error(s(519));function Mi(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tc(Vr(i,r)),cm}function Hy(r){var i=r.stateNode,l=r.type,m=r.memoizedProps;switch(i[hn]=r,i[pn]=m,l){case"dialog":Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":case"embed":Rt("load",i);break;case"video":case"audio":for(l=0;l<Xc.length;l++)Rt(Xc[l],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),_d(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Rt("invalid",i);break;case"textarea":Rt("invalid",i),Ve(i,m.value,m.defaultValue,m.children)}l=m.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||m.suppressHydrationWarning===!0||rS(i.textContent,l)?(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=ls),i=!0):i=!1,i||Mi(r,!0)}function Vy(r){for(zn=r.return;zn;)switch(zn.tag){case 5:case 31:case 13:Wr=!1;return;case 27:case 3:Wr=!0;return;default:zn=zn.return}}function Za(r){if(r!==zn)return!1;if(!At)return Vy(r),At=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||kg(r.type,r.memoizedProps)),l=!l),l&&Yt&&Mi(r),Vy(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=fS(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=fS(r)}else i===27?(i=Yt,Gi(r.type)?(r=Mg,Mg=null,Yt=r):Yt=i):Yt=zn?Gr(r.stateNode.nextSibling):null;return!0}function Mo(){Yt=zn=null,At=!1}function um(){var r=Oi;return r!==null&&(dr===null?dr=r:dr.push.apply(dr,r),Oi=null),r}function Tc(r){Oi===null?Oi=[r]:Oi.push(r)}var dm=I(null),Do=null,ei=null;function Di(r,i,l){K(dm,i._currentValue),i._currentValue=l}function ti(r){r._currentValue=dm.current,G(dm)}function fm(r,i,l){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===l)break;r=r.return}}function hm(r,i,l,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|=l,Q=O.alternate,Q!==null&&(Q.lanes|=l),fm(O.return,l,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|=l,O=N.alternate,O!==null&&(O.lanes|=l),fm(N,l,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 Ja(r,i,l,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;xr(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(tu):r=[tu])}R=R.return}r!==null&&hm(i,r,l,m),i.flags|=262144}function Dd(r){for(r=r.firstContext;r!==null;){if(!xr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Po(r){Do=r,ei=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Hn(r){return Fy(Do,r)}function Pd(r,i){return Do===null&&Po(r),Fy(r,i)}function Fy(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},ei===null){if(r===null)throw Error(s(308));ei=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ei=ei.next=i;return l}var x5=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,m){r.push(m)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},C5=e.unstable_scheduleCallback,w5=e.unstable_NormalPriority,vn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pm(){return{controller:new x5,data:new Map,refCount:0}}function Lc(r){r.refCount--,r.refCount===0&&C5(w5,function(){r.controller.abort()})}var Ac=null,mm=0,el=0,tl=null;function E5(r,i){if(Ac===null){var l=Ac=[];mm=0,el=_g(),tl={status:"pending",value:void 0,then:function(m){l.push(m)}}}return mm++,i.then(Uy,Uy),i}function Uy(){if(--mm===0&&Ac!==null){tl!==null&&(tl.status="fulfilled");var r=Ac;Ac=null,el=0,tl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function R5(r,i){var l=[],m={status:"pending",value:null,reason:null,then:function(R){l.push(R)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var R=0;R<l.length;R++)(0,l[R])(i)},function(R){for(m.status="rejected",m.reason=R,R=0;R<l.length;R++)(0,l[R])(void 0)}),m}var Wy=V.S;V.S=function(r,i){kb=xe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&E5(r,i),Wy!==null&&Wy(r,i)};var Io=I(null);function gm(){var r=Io.current;return r!==null?r:Wt.pooledCache}function Id(r,i){i===null?K(Io,Io.current):K(Io,i.pool)}function qy(){var r=gm();return r===null?null:{parent:vn._currentValue,pool:r}}var nl=Error(s(460)),vm=Error(s(474)),jd=Error(s(542)),Nd={then:function(){}};function Gy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function $y(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(ls,ls),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Yy(r),r;default:if(typeof i.status=="string")i.then(ls,ls);else{if(r=Wt,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,Yy(r),r}throw No=i,nl}}function jo(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(No=l,nl):l}}var No=null;function Ky(){if(No===null)throw Error(s(459));var r=No;return No=null,r}function Yy(r){if(r===nl||r===jd)throw Error(s(483))}var rl=null,Oc=0;function Bd(r){var i=Oc;return Oc+=1,rl===null&&(rl=[]),$y(rl,r,i)}function Mc(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function zd(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 Xy(r){function i(de,le){if(r){var pe=de.deletions;pe===null?(de.deletions=[le],de.flags|=16):pe.push(le)}}function l(de,le){if(!r)return null;for(;le!==null;)i(de,le),le=le.sibling;return null}function m(de){for(var le=new Map;de!==null;)de.key!==null?le.set(de.key,de):le.set(de.index,de),de=de.sibling;return le}function R(de,le){return de=Zs(de,le),de.index=0,de.sibling=null,de}function O(de,le,pe){return de.index=pe,r?(pe=de.alternate,pe!==null?(pe=pe.index,pe<le?(de.flags|=67108866,le):pe):(de.flags|=67108866,le)):(de.flags|=1048576,le)}function N(de){return r&&de.alternate===null&&(de.flags|=67108866),de}function Q(de,le,pe,ke){return le===null||le.tag!==6?(le=im(pe,de.mode,ke),le.return=de,le):(le=R(le,pe),le.return=de,le)}function ie(de,le,pe,ke){var ot=pe.type;return ot===C?we(de,le,pe.props.children,ke,pe.key):le!==null&&(le.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===L&&jo(ot)===le.type)?(le=R(le,pe.props),Mc(le,pe),le.return=de,le):(le=Od(pe.type,pe.key,pe.props,null,de.mode,ke),Mc(le,pe),le.return=de,le)}function me(de,le,pe,ke){return le===null||le.tag!==4||le.stateNode.containerInfo!==pe.containerInfo||le.stateNode.implementation!==pe.implementation?(le=om(pe,de.mode,ke),le.return=de,le):(le=R(le,pe.children||[]),le.return=de,le)}function we(de,le,pe,ke,ot){return le===null||le.tag!==7?(le=Oo(pe,de.mode,ke,ot),le.return=de,le):(le=R(le,pe),le.return=de,le)}function Te(de,le,pe){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=im(""+le,de.mode,pe),le.return=de,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return pe=Od(le.type,le.key,le.props,null,de.mode,pe),Mc(pe,le),pe.return=de,pe;case w:return le=om(le,de.mode,pe),le.return=de,le;case L:return le=jo(le),Te(de,le,pe)}if($(le)||W(le))return le=Oo(le,de.mode,pe,null),le.return=de,le;if(typeof le.then=="function")return Te(de,Bd(le),pe);if(le.$$typeof===S)return Te(de,Pd(de,le),pe);zd(de,le)}return null}function ge(de,le,pe,ke){var ot=le!==null?le.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ot!==null?null:Q(de,le,""+pe,ke);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return pe.key===ot?ie(de,le,pe,ke):null;case w:return pe.key===ot?me(de,le,pe,ke):null;case L:return pe=jo(pe),ge(de,le,pe,ke)}if($(pe)||W(pe))return ot!==null?null:we(de,le,pe,ke,null);if(typeof pe.then=="function")return ge(de,le,Bd(pe),ke);if(pe.$$typeof===S)return ge(de,le,Pd(de,pe),ke);zd(de,pe)}return null}function ye(de,le,pe,ke,ot){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return de=de.get(pe)||null,Q(le,de,""+ke,ot);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case b:return de=de.get(ke.key===null?pe:ke.key)||null,ie(le,de,ke,ot);case w:return de=de.get(ke.key===null?pe:ke.key)||null,me(le,de,ke,ot);case L:return ke=jo(ke),ye(de,le,pe,ke,ot)}if($(ke)||W(ke))return de=de.get(pe)||null,we(le,de,ke,ot,null);if(typeof ke.then=="function")return ye(de,le,pe,Bd(ke),ot);if(ke.$$typeof===S)return ye(de,le,pe,Pd(le,ke),ot);zd(le,ke)}return null}function Ge(de,le,pe,ke){for(var ot=null,Mt=null,Ze=le,_t=le=0,Lt=null;Ze!==null&&_t<pe.length;_t++){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Dt=ge(de,Ze,pe[_t],ke);if(Dt===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Dt.alternate===null&&i(de,Ze),le=O(Dt,le,_t),Mt===null?ot=Dt:Mt.sibling=Dt,Mt=Dt,Ze=Lt}if(_t===pe.length)return l(de,Ze),At&&Js(de,_t),ot;if(Ze===null){for(;_t<pe.length;_t++)Ze=Te(de,pe[_t],ke),Ze!==null&&(le=O(Ze,le,_t),Mt===null?ot=Ze:Mt.sibling=Ze,Mt=Ze);return At&&Js(de,_t),ot}for(Ze=m(Ze);_t<pe.length;_t++)Lt=ye(Ze,de,_t,pe[_t],ke),Lt!==null&&(r&&Lt.alternate!==null&&Ze.delete(Lt.key===null?_t:Lt.key),le=O(Lt,le,_t),Mt===null?ot=Lt:Mt.sibling=Lt,Mt=Lt);return r&&Ze.forEach(function(Qi){return i(de,Qi)}),At&&Js(de,_t),ot}function ct(de,le,pe,ke){if(pe==null)throw Error(s(151));for(var ot=null,Mt=null,Ze=le,_t=le=0,Lt=null,Dt=pe.next();Ze!==null&&!Dt.done;_t++,Dt=pe.next()){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Qi=ge(de,Ze,Dt.value,ke);if(Qi===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Qi.alternate===null&&i(de,Ze),le=O(Qi,le,_t),Mt===null?ot=Qi:Mt.sibling=Qi,Mt=Qi,Ze=Lt}if(Dt.done)return l(de,Ze),At&&Js(de,_t),ot;if(Ze===null){for(;!Dt.done;_t++,Dt=pe.next())Dt=Te(de,Dt.value,ke),Dt!==null&&(le=O(Dt,le,_t),Mt===null?ot=Dt:Mt.sibling=Dt,Mt=Dt);return At&&Js(de,_t),ot}for(Ze=m(Ze);!Dt.done;_t++,Dt=pe.next())Dt=ye(Ze,de,_t,Dt.value,ke),Dt!==null&&(r&&Dt.alternate!==null&&Ze.delete(Dt.key===null?_t:Dt.key),le=O(Dt,le,_t),Mt===null?ot=Dt:Mt.sibling=Dt,Mt=Dt);return r&&Ze.forEach(function(NL){return i(de,NL)}),At&&Js(de,_t),ot}function Ut(de,le,pe,ke){if(typeof pe=="object"&&pe!==null&&pe.type===C&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:e:{for(var ot=pe.key;le!==null;){if(le.key===ot){if(ot=pe.type,ot===C){if(le.tag===7){l(de,le.sibling),ke=R(le,pe.props.children),ke.return=de,de=ke;break e}}else if(le.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===L&&jo(ot)===le.type){l(de,le.sibling),ke=R(le,pe.props),Mc(ke,pe),ke.return=de,de=ke;break e}l(de,le);break}else i(de,le);le=le.sibling}pe.type===C?(ke=Oo(pe.props.children,de.mode,ke,pe.key),ke.return=de,de=ke):(ke=Od(pe.type,pe.key,pe.props,null,de.mode,ke),Mc(ke,pe),ke.return=de,de=ke)}return N(de);case w:e:{for(ot=pe.key;le!==null;){if(le.key===ot)if(le.tag===4&&le.stateNode.containerInfo===pe.containerInfo&&le.stateNode.implementation===pe.implementation){l(de,le.sibling),ke=R(le,pe.children||[]),ke.return=de,de=ke;break e}else{l(de,le);break}else i(de,le);le=le.sibling}ke=om(pe,de.mode,ke),ke.return=de,de=ke}return N(de);case L:return pe=jo(pe),Ut(de,le,pe,ke)}if($(pe))return Ge(de,le,pe,ke);if(W(pe)){if(ot=W(pe),typeof ot!="function")throw Error(s(150));return pe=ot.call(pe),ct(de,le,pe,ke)}if(typeof pe.then=="function")return Ut(de,le,Bd(pe),ke);if(pe.$$typeof===S)return Ut(de,le,Pd(de,pe),ke);zd(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,le!==null&&le.tag===6?(l(de,le.sibling),ke=R(le,pe),ke.return=de,de=ke):(l(de,le),ke=im(pe,de.mode,ke),ke.return=de,de=ke),N(de)):l(de,le)}return function(de,le,pe,ke){try{Oc=0;var ot=Ut(de,le,pe,ke);return rl=null,ot}catch(Ze){if(Ze===nl||Ze===jd)throw Ze;var Mt=Cr(29,Ze,null,de.mode);return Mt.lanes=ke,Mt.return=de,Mt}}}var Bo=Xy(!0),Qy=Xy(!1),Pi=!1;function _m(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ym(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,l){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(Pt&2)!==0){var R=m.pending;return R===null?i.next=i:(i.next=R.next,R.next=i),m.pending=i,i=Ad(r),Py(r,null,l),i}return Ld(r,m,i,l),Ad(r)}function Dc(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var m=i.lanes;m&=r.pendingLanes,l|=m,i.lanes=l,Ht(r,l)}}function bm(r,i){var l=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,l===m)){var R=null,O=null;if(l=l.firstBaseUpdate,l!==null){do{var N={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};O===null?R=O=N:O=O.next=N,l=l.next}while(l!==null);O===null?R=O=i:O=O.next=i}else R=O=i;l={baseState:m.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:m.shared,callbacks:m.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var Sm=!1;function Pc(){if(Sm){var r=tl;if(r!==null)throw r}}function Ic(r,i,l,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,me=ie.next;ie.next=null,N===null?O=me:N.next=me,N=ie;var we=r.alternate;we!==null&&(we=we.updateQueue,Q=we.lastBaseUpdate,Q!==N&&(Q===null?we.firstBaseUpdate=me:Q.next=me,we.lastBaseUpdate=ie))}if(O!==null){var Te=R.baseState;N=0,we=me=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===el&&(Sm=!0),we!==null&&(we=we.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var Ge=r,ct=Q;ge=i;var Ut=l;switch(ct.tag){case 1:if(Ge=ct.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=ct.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?(me=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=me,R.lastBaseUpdate=we,O===null&&(R.shared.lanes=0),Vi|=N,r.lanes=N,r.memoizedState=Te}}function Zy(r,i){if(typeof r!="function")throw Error(s(191,r));r.call(i)}function Jy(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)Zy(l[r],i)}var sl=I(null),Hd=I(0);function e1(r,i){r=ui,K(Hd,r),K(sl,i),ui=r|i.baseLanes}function xm(){K(Hd,ui),K(sl,sl.current)}function Cm(){ui=Hd.current,G(sl),G(Hd)}var wr=I(null),qr=null;function Ni(r){var i=r.alternate;K(ln,ln.current&1),K(wr,r),qr===null&&(i===null||sl.current!==null||i.memoizedState!==null)&&(qr=r)}function wm(r){K(ln,ln.current),K(wr,r),qr===null&&(qr=r)}function t1(r){r.tag===22?(K(ln,ln.current),K(wr,r),qr===null&&(qr=r)):Bi()}function Bi(){K(ln,ln.current),K(wr,wr.current)}function Er(r){G(wr),qr===r&&(qr=null),G(ln)}var ln=I(0);function Vd(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ag(l)||Og(l)))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 ni=0,gt=null,Vt=null,_n=null,Fd=!1,il=!1,zo=!1,Ud=0,jc=0,ol=null,k5=0;function sn(){throw Error(s(321))}function Em(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!xr(r[l],i[l]))return!1;return!0}function Rm(r,i,l,m,R,O){return ni=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=r===null||r.memoizedState===null?B1:Vm,zo=!1,O=l(m,R),zo=!1,il&&(O=r1(i,l,m,R)),n1(r),O}function n1(r){V.H=zc;var i=Vt!==null&&Vt.next!==null;if(ni=0,_n=Vt=gt=null,Fd=!1,jc=0,ol=null,i)throw Error(s(300));r===null||yn||(r=r.dependencies,r!==null&&Dd(r)&&(yn=!0))}function r1(r,i,l,m){gt=r;var R=0;do{if(il&&(ol=null),jc=0,il=!1,25<=R)throw Error(s(301));if(R+=1,_n=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=z1,O=i(l,m)}while(il);return O}function T5(){var r=V.H,i=r.useState()[0];return i=typeof i.then=="function"?Nc(i):i,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(gt.flags|=1024),i}function km(){var r=Ud!==0;return Ud=0,r}function Tm(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function Lm(r){if(Fd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Fd=!1}ni=0,_n=Vt=gt=null,il=!1,jc=Ud=0,ol=null}function nr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?gt.memoizedState=_n=r:_n=_n.next=r,_n}function cn(){if(Vt===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var i=_n===null?gt.memoizedState:_n.next;if(i!==null)_n=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},_n===null?gt.memoizedState=_n=r:_n=_n.next=r}return _n}function Wd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nc(r){var i=jc;return jc+=1,ol===null&&(ol=[]),r=$y(ol,r,i),i=gt,(_n===null?i.memoizedState:_n.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?B1:Vm),r}function qd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Nc(r);if(r.$$typeof===S)return Hn(r)}throw Error(s(438,String(r)))}function Am(r){var i=null,l=gt.updateQueue;if(l!==null&&(i=l.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}),l===null&&(l=Wd(),gt.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),m=0;m<r;m++)l[m]=U;return i.index++,l}function ri(r,i){return typeof i=="function"?i(r):i}function Gd(r){var i=cn();return Om(i,Vt,r)}function Om(r,i,l){var m=r.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=l;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,me=i,we=!1;do{var Te=me.lane&-536870913;if(Te!==me.lane?(Tt&Te)===Te:(ni&Te)===Te){var ge=me.revertLane;if(ge===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),Te===el&&(we=!0);else if((ni&ge)===ge){me=me.next,ge===el&&(we=!0);continue}else Te={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ie===null?(Q=ie=Te,N=O):ie=ie.next=Te,gt.lanes|=ge,Vi|=ge;Te=me.action,zo&&l(O,Te),O=me.hasEagerState?me.eagerState:l(O,Te)}else ge={lane:Te,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},ie===null?(Q=ie=ge,N=O):ie=ie.next=ge,gt.lanes|=Te,Vi|=Te;me=me.next}while(me!==null&&me!==i);if(ie===null?N=O:ie.next=Q,!xr(O,r.memoizedState)&&(yn=!0,we&&(l=tl,l!==null)))throw l;r.memoizedState=O,r.baseState=N,r.baseQueue=ie,m.lastRenderedState=O}return R===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function Mm(r){var i=cn(),l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=r;var m=l.dispatch,R=l.pending,O=i.memoizedState;if(R!==null){l.pending=null;var N=R=R.next;do O=r(O,N.action),N=N.next;while(N!==R);xr(O,i.memoizedState)||(yn=!0),i.memoizedState=O,i.baseQueue===null&&(i.baseState=O),l.lastRenderedState=O}return[O,m]}function s1(r,i,l){var m=gt,R=cn(),O=At;if(O){if(l===void 0)throw Error(s(407));l=l()}else l=i();var N=!xr((Vt||R).memoizedState,l);if(N&&(R.memoizedState=l,yn=!0),R=R.queue,Im(a1.bind(null,m,R,r),[r]),R.getSnapshot!==i||N||_n!==null&&_n.memoizedState.tag&1){if(m.flags|=2048,al(9,{destroy:void 0},o1.bind(null,m,R,l,i),null),Wt===null)throw Error(s(349));O||(ni&127)!==0||i1(m,i,l)}return l}function i1(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=gt.updateQueue,i===null?(i=Wd(),gt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function o1(r,i,l,m){i.value=l,i.getSnapshot=m,l1(i)&&c1(r)}function a1(r,i,l){return l(function(){l1(i)&&c1(r)})}function l1(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!xr(r,l)}catch{return!0}}function c1(r){var i=Ao(r,2);i!==null&&fr(i,r,2)}function Dm(r){var i=nr();if(typeof r=="function"){var l=r;if(r=l(),zo){je(!0);try{l()}finally{je(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:r},i}function u1(r,i,l,m){return r.baseState=l,Om(r,Vt,typeof m=="function"?m:ri)}function L5(r,i,l,m,R){if(Yd(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?l(!0):O.isTransition=!1,m(O),l=i.pending,l===null?(O.next=i.pending=O,d1(i,O)):(O.next=l.next,i.pending=l.next=O)}}function d1(r,i){var l=i.action,m=i.payload,R=r.state;if(i.isTransition){var O=V.T,N={};V.T=N;try{var Q=l(R,m),ie=V.S;ie!==null&&ie(N,Q),f1(r,i,Q)}catch(me){Pm(r,i,me)}finally{O!==null&&N.types!==null&&(O.types=N.types),V.T=O}}else try{O=l(R,m),f1(r,i,O)}catch(me){Pm(r,i,me)}}function f1(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(m){h1(r,i,m)},function(m){return Pm(r,i,m)}):h1(r,i,l)}function h1(r,i,l){i.status="fulfilled",i.value=l,p1(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,d1(r,l)))}function Pm(r,i,l){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=l,p1(i),i=i.next;while(i!==m)}r.action=null}function p1(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function m1(r,i){return i}function g1(r,i){if(At){var l=Wt.formState;if(l!==null){e:{var m=gt;if(At){if(Yt){t:{for(var R=Yt,O=Wr;R.nodeType!==8;){if(!O){R=null;break t}if(R=Gr(R.nextSibling),R===null){R=null;break t}}O=R.data,R=O==="F!"||O==="F"?R:null}if(R){Yt=Gr(R.nextSibling),m=R.data==="F!";break e}}Mi(m)}m=!1}m&&(i=l[0])}}return l=nr(),l.memoizedState=l.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m1,lastRenderedState:i},l.queue=m,l=I1.bind(null,gt,m),m.dispatch=l,m=Dm(!1),O=Hm.bind(null,gt,!1,m.queue),m=nr(),R={state:i,dispatch:null,action:r,pending:null},m.queue=R,l=L5.bind(null,gt,R,O,l),R.dispatch=l,m.memoizedState=r,[i,l,!1]}function v1(r){var i=cn();return _1(i,Vt,r)}function _1(r,i,l){if(i=Om(r,i,m1)[0],r=Gd(ri)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=Nc(i)}catch(N){throw N===nl?jd:N}else m=i;i=cn();var R=i.queue,O=R.dispatch;return l!==i.memoizedState&&(gt.flags|=2048,al(9,{destroy:void 0},A5.bind(null,R,l),null)),[m,O,r]}function A5(r,i){r.action=i}function y1(r){var i=cn(),l=Vt;if(l!==null)return _1(i,l,r);cn(),i=i.memoizedState,l=cn();var m=l.queue.dispatch;return l.memoizedState=r,[i,m,!1]}function al(r,i,l,m){return r={tag:r,create:l,deps:m,inst:i,next:null},i=gt.updateQueue,i===null&&(i=Wd(),gt.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(m=l.next,l.next=r,r.next=m,i.lastEffect=r),r}function b1(){return cn().memoizedState}function $d(r,i,l,m){var R=nr();gt.flags|=r,R.memoizedState=al(1|i,{destroy:void 0},l,m===void 0?null:m)}function Kd(r,i,l,m){var R=cn();m=m===void 0?null:m;var O=R.memoizedState.inst;Vt!==null&&m!==null&&Em(m,Vt.memoizedState.deps)?R.memoizedState=al(i,O,l,m):(gt.flags|=r,R.memoizedState=al(1|i,O,l,m))}function S1(r,i){$d(8390656,8,r,i)}function Im(r,i){Kd(2048,8,r,i)}function O5(r){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=Wd(),gt.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function x1(r){var i=cn().memoizedState;return O5({ref:i,nextImpl:r}),function(){if((Pt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function C1(r,i){return Kd(4,2,r,i)}function w1(r,i){return Kd(4,4,r,i)}function E1(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function R1(r,i,l){l=l!=null?l.concat([r]):null,Kd(4,4,E1.bind(null,i,r),l)}function jm(){}function k1(r,i){var l=cn();i=i===void 0?null:i;var m=l.memoizedState;return i!==null&&Em(i,m[1])?m[0]:(l.memoizedState=[r,i],r)}function T1(r,i){var l=cn();i=i===void 0?null:i;var m=l.memoizedState;if(i!==null&&Em(i,m[1]))return m[0];if(m=r(),zo){je(!0);try{r()}finally{je(!1)}}return l.memoizedState=[m,i],m}function Nm(r,i,l){return l===void 0||(ni&1073741824)!==0&&(Tt&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=Lb(),gt.lanes|=r,Vi|=r,l)}function L1(r,i,l,m){return xr(l,i)?l:sl.current!==null?(r=Nm(r,l,m),xr(r,i)||(yn=!0),r):(ni&42)===0||(ni&1073741824)!==0&&(Tt&261930)===0?(yn=!0,r.memoizedState=l):(r=Lb(),gt.lanes|=r,Vi|=r,i)}function A1(r,i,l,m,R){var O=q.p;q.p=O!==0&&8>O?O:8;var N=V.T,Q={};V.T=Q,Hm(r,!1,i,l);try{var ie=R(),me=V.S;if(me!==null&&me(Q,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var we=R5(ie,m);Bc(r,i,we,Tr(r))}else Bc(r,i,m,Tr(r))}catch(Te){Bc(r,i,{then:function(){},status:"rejected",reason:Te},Tr())}finally{q.p=O,N!==null&&Q.types!==null&&(N.types=Q.types),V.T=N}}function M5(){}function Bm(r,i,l,m){if(r.tag!==5)throw Error(s(476));var R=O1(r).queue;A1(r,R,i,H,l===null?M5:function(){return M1(r),l(m)})}function O1(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:H},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function M1(r){var i=O1(r);i.next===null&&(i=r.alternate.memoizedState),Bc(r,i.next.queue,{},Tr())}function zm(){return Hn(tu)}function D1(){return cn().memoizedState}function P1(){return cn().memoizedState}function D5(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Tr();r=Ii(l);var m=ji(i,r,l);m!==null&&(fr(m,i,l),Dc(m,i,l)),i={cache:pm()},r.payload=i;return}i=i.return}}function P5(r,i,l){var m=Tr();l={lane:m,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Yd(r)?j1(i,l):(l=rm(r,i,l,m),l!==null&&(fr(l,r,m),N1(l,i,m)))}function I1(r,i,l){var m=Tr();Bc(r,i,l,m)}function Bc(r,i,l,m){var R={lane:m,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Yd(r))j1(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,l);if(R.hasEagerState=!0,R.eagerState=Q,xr(Q,N))return Ld(r,i,R,0),Wt===null&&Td(),!1}catch{}if(l=rm(r,i,R,m),l!==null)return fr(l,r,m),N1(l,i,m),!0}return!1}function Hm(r,i,l,m){if(m={lane:2,revertLane:_g(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Yd(r)){if(i)throw Error(s(479))}else i=rm(r,l,m,2),i!==null&&fr(i,r,2)}function Yd(r){var i=r.alternate;return r===gt||i!==null&&i===gt}function j1(r,i){il=Fd=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function N1(r,i,l){if((l&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,l|=m,i.lanes=l,Ht(r,l)}}var zc={readContext:Hn,use:qd,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};zc.useEffectEvent=sn;var B1={readContext:Hn,use:qd,useCallback:function(r,i){return nr().memoizedState=[r,i===void 0?null:i],r},useContext:Hn,useEffect:S1,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,$d(4194308,4,E1.bind(null,i,r),l)},useLayoutEffect:function(r,i){return $d(4194308,4,r,i)},useInsertionEffect:function(r,i){$d(4,2,r,i)},useMemo:function(r,i){var l=nr();i=i===void 0?null:i;var m=r();if(zo){je(!0);try{r()}finally{je(!1)}}return l.memoizedState=[m,i],m},useReducer:function(r,i,l){var m=nr();if(l!==void 0){var R=l(i);if(zo){je(!0);try{l(i)}finally{je(!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=P5.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=nr();return r={current:r},i.memoizedState=r},useState:function(r){r=Dm(r);var i=r.queue,l=I1.bind(null,gt,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:jm,useDeferredValue:function(r,i){var l=nr();return Nm(l,r,i)},useTransition:function(){var r=Dm(!1);return r=A1.bind(null,gt,r.queue,!0,!1),nr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var m=gt,R=nr();if(At){if(l===void 0)throw Error(s(407));l=l()}else{if(l=i(),Wt===null)throw Error(s(349));(Tt&127)!==0||i1(m,i,l)}R.memoizedState=l;var O={value:l,getSnapshot:i};return R.queue=O,S1(a1.bind(null,m,O,r),[r]),m.flags|=2048,al(9,{destroy:void 0},o1.bind(null,m,O,l,i),null),l},useId:function(){var r=nr(),i=Wt.identifierPrefix;if(At){var l=Cs,m=xs;l=(m&~(1<<32-rt(m)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Ud++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=k5++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:zm,useFormState:g1,useActionState:g1,useOptimistic:function(r){var i=nr();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Hm.bind(null,gt,!0,l),l.dispatch=i,[r,i]},useMemoCache:Am,useCacheRefresh:function(){return nr().memoizedState=D5.bind(null,gt)},useEffectEvent:function(r){var i=nr(),l={impl:r};return i.memoizedState=l,function(){if((Pt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Vm={readContext:Hn,use:qd,useCallback:k1,useContext:Hn,useEffect:Im,useImperativeHandle:R1,useInsertionEffect:C1,useLayoutEffect:w1,useMemo:T1,useReducer:Gd,useRef:b1,useState:function(){return Gd(ri)},useDebugValue:jm,useDeferredValue:function(r,i){var l=cn();return L1(l,Vt.memoizedState,r,i)},useTransition:function(){var r=Gd(ri)[0],i=cn().memoizedState;return[typeof r=="boolean"?r:Nc(r),i]},useSyncExternalStore:s1,useId:D1,useHostTransitionStatus:zm,useFormState:v1,useActionState:v1,useOptimistic:function(r,i){var l=cn();return u1(l,Vt,r,i)},useMemoCache:Am,useCacheRefresh:P1};Vm.useEffectEvent=x1;var z1={readContext:Hn,use:qd,useCallback:k1,useContext:Hn,useEffect:Im,useImperativeHandle:R1,useInsertionEffect:C1,useLayoutEffect:w1,useMemo:T1,useReducer:Mm,useRef:b1,useState:function(){return Mm(ri)},useDebugValue:jm,useDeferredValue:function(r,i){var l=cn();return Vt===null?Nm(l,r,i):L1(l,Vt.memoizedState,r,i)},useTransition:function(){var r=Mm(ri)[0],i=cn().memoizedState;return[typeof r=="boolean"?r:Nc(r),i]},useSyncExternalStore:s1,useId:D1,useHostTransitionStatus:zm,useFormState:y1,useActionState:y1,useOptimistic:function(r,i){var l=cn();return Vt!==null?u1(l,Vt,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:Am,useCacheRefresh:P1};z1.useEffectEvent=x1;function Fm(r,i,l,m){i=r.memoizedState,l=l(m,i),l=l==null?i:f({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Um={enqueueSetState:function(r,i,l){r=r._reactInternals;var m=Tr(),R=Ii(m);R.payload=i,l!=null&&(R.callback=l),i=ji(r,R,m),i!==null&&(fr(i,r,m),Dc(i,r,m))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var m=Tr(),R=Ii(m);R.tag=1,R.payload=i,l!=null&&(R.callback=l),i=ji(r,R,m),i!==null&&(fr(i,r,m),Dc(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Tr(),m=Ii(l);m.tag=2,i!=null&&(m.callback=i),i=ji(r,m,l),i!==null&&(fr(i,r,l),Dc(i,r,l))}};function H1(r,i,l,m,R,O,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,N):i.prototype&&i.prototype.isPureReactComponent?!Ec(l,m)||!Ec(R,O):!0}function V1(r,i,l,m){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,m),i.state!==r&&Um.enqueueReplaceState(i,i.state,null)}function Ho(r,i){var l=i;if("ref"in i){l={};for(var m in i)m!=="ref"&&(l[m]=i[m])}if(r=r.defaultProps){l===i&&(l=f({},l));for(var R in r)l[R]===void 0&&(l[R]=r[R])}return l}function F1(r){kd(r)}function U1(r){console.error(r)}function W1(r){kd(r)}function Xd(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function q1(r,i,l){try{var m=r.onCaughtError;m(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(R){setTimeout(function(){throw R})}}function Wm(r,i,l){return l=Ii(l),l.tag=3,l.payload={element:null},l.callback=function(){Xd(r,i)},l}function G1(r){return r=Ii(r),r.tag=3,r}function $1(r,i,l,m){var R=l.type.getDerivedStateFromError;if(typeof R=="function"){var O=m.value;r.payload=function(){return R(O)},r.callback=function(){q1(i,l,m)}}var N=l.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){q1(i,l,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 I5(r,i,l,m,R){if(l.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=l.alternate,i!==null&&Ja(i,l,R,!0),l=wr.current,l!==null){switch(l.tag){case 31:case 13:return qr===null?cf():l.alternate===null&&on===0&&(on=3),l.flags&=-257,l.flags|=65536,l.lanes=R,m===Nd?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([m]):i.add(m),mg(r,m,R)),!1;case 22:return l.flags|=65536,m===Nd?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([m]):l.add(m)),mg(r,m,R)),!1}throw Error(s(435,l.tag))}return mg(r,m,R),cf(),!1}if(At)return i=wr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=R,m!==cm&&(r=Error(s(422),{cause:m}),Tc(Vr(r,l)))):(m!==cm&&(i=Error(s(423),{cause:m}),Tc(Vr(i,l))),r=r.current.alternate,r.flags|=65536,R&=-R,r.lanes|=R,m=Vr(m,l),R=Wm(r.stateNode,m,R),bm(r,R),on!==4&&(on=2)),!1;var O=Error(s(520),{cause:m});if(O=Vr(O,l),$c===null?$c=[O]:$c.push(O),on!==4&&(on=2),i===null)return!0;m=Vr(m,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=R&-R,l.lanes|=r,r=Wm(l.stateNode,m,r),bm(l,r),!1;case 1:if(i=l.type,O=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Fi===null||!Fi.has(O))))return l.flags|=65536,R&=-R,l.lanes|=R,R=G1(R),$1(R,r,l,m),bm(l,R),!1}l=l.return}while(l!==null);return!1}var qm=Error(s(461)),yn=!1;function Vn(r,i,l,m){i.child=r===null?Qy(i,null,l,m):Bo(i,r.child,l,m)}function K1(r,i,l,m,R){l=l.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 Po(i),m=Rm(r,i,l,N,O,R),Q=km(),r!==null&&!yn?(Tm(r,i,R),si(r,i,R)):(At&&Q&&am(i),i.flags|=1,Vn(r,i,m,R),i.child)}function Y1(r,i,l,m,R){if(r===null){var O=l.type;return typeof O=="function"&&!sm(O)&&O.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=O,X1(r,i,O,m,R)):(r=Od(l.type,null,m,i,i.mode,R),r.ref=i.ref,r.return=i,i.child=r)}if(O=r.child,!Jm(r,R)){var N=O.memoizedProps;if(l=l.compare,l=l!==null?l:Ec,l(N,m)&&r.ref===i.ref)return si(r,i,R)}return i.flags|=1,r=Zs(O,m),r.ref=i.ref,r.return=i,i.child=r}function X1(r,i,l,m,R){if(r!==null){var O=r.memoizedProps;if(Ec(O,m)&&r.ref===i.ref)if(yn=!1,i.pendingProps=m=O,Jm(r,R))(r.flags&131072)!==0&&(yn=!0);else return i.lanes=r.lanes,si(r,i,R)}return Gm(r,i,l,m,R)}function Q1(r,i,l,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|l:l,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 Z1(r,i,O,l,m)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Id(i,O!==null?O.cachePool:null),O!==null?e1(i,O):xm(),t1(i);else return m=i.lanes=536870912,Z1(r,i,O!==null?O.baseLanes|l:l,l,m)}else O!==null?(Id(i,O.cachePool),e1(i,O),Bi(),i.memoizedState=null):(r!==null&&Id(i,null),xm(),Bi());return Vn(r,i,R,l),i.child}function Hc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Z1(r,i,l,m,R){var O=gm();return O=O===null?null:{parent:vn._currentValue,pool:O},i.memoizedState={baseLanes:l,cachePool:O},r!==null&&Id(i,null),xm(),t1(i),r!==null&&Ja(r,i,m,!0),i.childLanes=R,null}function Qd(r,i){return i=Jd({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function J1(r,i,l){return Bo(i,r.child,null,l),r=Qd(i,i.pendingProps),r.flags|=2,Er(i),i.memoizedState=null,r}function j5(r,i,l){var m=i.pendingProps,R=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(m.mode==="hidden")return r=Qd(i,m),i.lanes=536870912,Hc(null,r);if(wm(i),(r=Yt)?(r=dS(r,Wr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ai!==null?{id:xs,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},l=jy(r),l.return=i,i.child=l,zn=i,Yt=null)):r=null,r===null)throw Mi(i);return i.lanes=536870912,null}return Qd(i,m)}var O=r.memoizedState;if(O!==null){var N=O.dehydrated;if(wm(i),R)if(i.flags&256)i.flags&=-257,i=J1(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(s(558));else if(yn||Ja(r,i,l,!1),R=(l&r.childLanes)!==0,yn||R){if(m=Wt,m!==null&&(N=wn(m,l),N!==0&&N!==O.retryLane))throw O.retryLane=N,Ao(r,N),fr(m,r,N),qm;cf(),i=J1(r,i,l)}else r=O.treeContext,Yt=Gr(N.nextSibling),zn=i,At=!0,Oi=null,Wr=!1,r!==null&&zy(i,r),i=Qd(i,m),i.flags|=4096;return i}return r=Zs(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Zd(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function Gm(r,i,l,m,R){return Po(i),l=Rm(r,i,l,m,void 0,R),m=km(),r!==null&&!yn?(Tm(r,i,R),si(r,i,R)):(At&&m&&am(i),i.flags|=1,Vn(r,i,l,R),i.child)}function eb(r,i,l,m,R,O){return Po(i),i.updateQueue=null,l=r1(i,m,l,R),n1(r),m=km(),r!==null&&!yn?(Tm(r,i,O),si(r,i,O)):(At&&m&&am(i),i.flags|=1,Vn(r,i,l,O),i.child)}function tb(r,i,l,m,R){if(Po(i),i.stateNode===null){var O=Ya,N=l.contextType;typeof N=="object"&&N!==null&&(O=Hn(N)),O=new l(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Um,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},_m(i),N=l.contextType,O.context=typeof N=="object"&&N!==null?Hn(N):Ya,O.state=i.memoizedState,N=l.getDerivedStateFromProps,typeof N=="function"&&(Fm(i,l,N,m),O.state=i.memoizedState),typeof l.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&&Um.enqueueReplaceState(O,O.state,null),Ic(i,m,O,R),Pc(),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=Ho(l,Q);O.props=ie;var me=O.context,we=l.contextType;N=Ya,typeof we=="object"&&we!==null&&(N=Hn(we));var Te=l.getDerivedStateFromProps;we=typeof Te=="function"||typeof O.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,we||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q||me!==N)&&V1(i,O,m,N),Pi=!1;var ge=i.memoizedState;O.state=ge,Ic(i,m,O,R),Pc(),me=i.memoizedState,Q||ge!==me||Pi?(typeof Te=="function"&&(Fm(i,l,Te,m),me=i.memoizedState),(ie=Pi||H1(i,l,ie,m,ge,me,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=me),O.props=m,O.state=me,O.context=N,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,ym(r,i),N=i.memoizedProps,we=Ho(l,N),O.props=we,Te=i.pendingProps,ge=O.context,me=l.contextType,ie=Ya,typeof me=="object"&&me!==null&&(ie=Hn(me)),Q=l.getDerivedStateFromProps,(me=typeof Q=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(N!==Te||ge!==ie)&&V1(i,O,m,ie),Pi=!1,ge=i.memoizedState,O.state=ge,Ic(i,m,O,R),Pc();var ye=i.memoizedState;N!==Te||ge!==ye||Pi||r!==null&&r.dependencies!==null&&Dd(r.dependencies)?(typeof Q=="function"&&(Fm(i,l,Q,m),ye=i.memoizedState),(we=Pi||H1(i,l,we,m,ge,ye,ie)||r!==null&&r.dependencies!==null&&Dd(r.dependencies))?(me||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,Zd(r,i),m=(i.flags&128)!==0,O||m?(O=i.stateNode,l=m&&typeof l.getDerivedStateFromError!="function"?null:O.render(),i.flags|=1,r!==null&&m?(i.child=Bo(i,r.child,null,R),i.child=Bo(i,null,l,R)):Vn(r,i,l,R),i.memoizedState=O.state,r=i.child):r=si(r,i,R),r}function nb(r,i,l,m){return Mo(),i.flags|=256,Vn(r,i,l,m),i.child}var $m={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Km(r){return{baseLanes:r,cachePool:qy()}}function Ym(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=kr),r}function rb(r,i,l){var m=i.pendingProps,R=!1,O=(i.flags&128)!==0,N;if((N=O)||(N=r!==null&&r.memoizedState===null?!1:(ln.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=dS(r,Wr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ai!==null?{id:xs,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},l=jy(r),l.return=i,i.child=l,zn=i,Yt=null)):r=null,r===null)throw Mi(i);return Og(r)?i.lanes=32:i.lanes=536870912,null}var Q=m.children;return m=m.fallback,R?(Bi(),R=i.mode,Q=Jd({mode:"hidden",children:Q},R),m=Oo(m,R,l,null),Q.return=i,m.return=i,Q.sibling=m,i.child=Q,m=i.child,m.memoizedState=Km(l),m.childLanes=Ym(r,N,l),i.memoizedState=$m,Hc(null,m)):(Ni(i),Xm(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=Qm(r,i,l)):i.memoizedState!==null?(Bi(),i.child=r.child,i.flags|=128,i=null):(Bi(),Q=m.fallback,R=i.mode,m=Jd({mode:"visible",children:m.children},R),Q=Oo(Q,R,l,null),Q.flags|=2,m.return=i,Q.return=i,m.sibling=Q,i.child=m,Bo(i,r.child,null,l),m=i.child,m.memoizedState=Km(l),m.childLanes=Ym(r,N,l),i.memoizedState=$m,i=Hc(null,m));else if(Ni(i),Og(Q)){if(N=Q.nextSibling&&Q.nextSibling.dataset,N)var me=N.dgst;N=me,m=Error(s(419)),m.stack="",m.digest=N,Tc({value:m,source:null,stack:null}),i=Qm(r,i,l)}else if(yn||Ja(r,i,l,!1),N=(l&r.childLanes)!==0,yn||N){if(N=Wt,N!==null&&(m=wn(N,l),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Ao(r,m),fr(N,r,m),qm;Ag(Q)||cf(),i=Qm(r,i,l)}else Ag(Q)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,Yt=Gr(Q.nextSibling),zn=i,At=!0,Oi=null,Wr=!1,r!==null&&zy(i,r),i=Xm(i,m.children),i.flags|=4096);return i}return R?(Bi(),Q=m.fallback,R=i.mode,ie=r.child,me=ie.sibling,m=Zs(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,me!==null?Q=Zs(me,Q):(Q=Oo(Q,R,l,null),Q.flags|=2),Q.return=i,m.return=i,m.sibling=Q,i.child=m,Hc(null,m),m=i.child,Q=r.child.memoizedState,Q===null?Q=Km(l):(R=Q.cachePool,R!==null?(ie=vn._currentValue,R=R.parent!==ie?{parent:ie,pool:ie}:R):R=qy(),Q={baseLanes:Q.baseLanes|l,cachePool:R}),m.memoizedState=Q,m.childLanes=Ym(r,N,l),i.memoizedState=$m,Hc(r.child,m)):(Ni(i),l=r.child,r=l.sibling,l=Zs(l,{mode:"visible",children:m.children}),l.return=i,l.sibling=null,r!==null&&(N=i.deletions,N===null?(i.deletions=[r],i.flags|=16):N.push(r)),i.child=l,i.memoizedState=null,l)}function Xm(r,i){return i=Jd({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Jd(r,i){return r=Cr(22,r,null,i),r.lanes=0,r}function Qm(r,i,l){return Bo(i,r.child,null,l),r=Xm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function sb(r,i,l){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),fm(r.return,i,l)}function Zm(r,i,l,m,R,O){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:l,tailMode:R,treeForkCount:O}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=l,N.tailMode=R,N.treeForkCount=O)}function ib(r,i,l){var m=i.pendingProps,R=m.revealOrder,O=m.tail;m=m.children;var N=ln.current,Q=(N&2)!==0;if(Q?(N=N&1|2,i.flags|=128):N&=1,K(ln,N),Vn(r,i,m,l),m=At?kc:0,!Q&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&sb(r,l,i);else if(r.tag===19)sb(r,l,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(l=i.child,R=null;l!==null;)r=l.alternate,r!==null&&Vd(r)===null&&(R=l),l=l.sibling;l=R,l===null?(R=i.child,i.child=null):(R=l.sibling,l.sibling=null),Zm(i,!1,R,l,O,m);break;case"backwards":case"unstable_legacy-backwards":for(l=null,R=i.child,i.child=null;R!==null;){if(r=R.alternate,r!==null&&Vd(r)===null){i.child=R;break}r=R.sibling,R.sibling=l,l=R,R=r}Zm(i,!0,l,null,O,m);break;case"together":Zm(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function si(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Vi|=i.lanes,(l&i.childLanes)===0)if(r!==null){if(Ja(r,i,l,!1),(l&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,l=Zs(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Zs(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Jm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Dd(r)))}function N5(r,i,l){switch(i.tag){case 3:F(i,i.stateNode.containerInfo),Di(i,vn,r.memoizedState.cache),Mo();break;case 27:case 5:re(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,wm(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(Ni(i),i.flags|=128,null):(l&i.child.childLanes)!==0?rb(r,i,l):(Ni(i),r=si(r,i,l),r!==null?r.sibling:null);Ni(i);break;case 19:var R=(r.flags&128)!==0;if(m=(l&i.childLanes)!==0,m||(Ja(r,i,l,!1),m=(l&i.childLanes)!==0),R){if(m)return ib(r,i,l);i.flags|=128}if(R=i.memoizedState,R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),K(ln,ln.current),m)break;return null;case 22:return i.lanes=0,Q1(r,i,l,i.pendingProps);case 24:Di(i,vn,r.memoizedState.cache)}return si(r,i,l)}function ob(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)yn=!0;else{if(!Jm(r,l)&&(i.flags&128)===0)return yn=!1,N5(r,i,l);yn=(r.flags&131072)!==0}else yn=!1,At&&(i.flags&1048576)!==0&&By(i,kc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=jo(i.elementType),i.type=r,typeof r=="function")sm(r)?(m=Ho(r,m),i.tag=1,i=tb(null,i,r,m,l)):(i.tag=0,i=Gm(null,i,r,m,l));else{if(r!=null){var R=r.$$typeof;if(R===E){i.tag=11,i=K1(null,i,r,m,l);break e}else if(R===M){i.tag=14,i=Y1(null,i,r,m,l);break e}}throw i=Y(r)||r,Error(s(306,i,""))}}return i;case 0:return Gm(r,i,i.type,i.pendingProps,l);case 1:return m=i.type,R=Ho(m,i.pendingProps),tb(r,i,m,R,l);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,ym(r,i),Ic(i,m,null,l);var N=i.memoizedState;if(m=N.cache,Di(i,vn,m),m!==O.cache&&hm(i,[vn],l,!0),Pc(),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=nb(r,i,m,l);break e}else if(m!==R){R=Vr(Error(s(424)),i),Tc(R),i=nb(r,i,m,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Yt=Gr(r.firstChild),zn=i,At=!0,Oi=null,Wr=!0,l=Qy(i,null,m,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Mo(),m===R){i=si(r,i,l);break e}Vn(r,i,m,l)}i=i.child}return i;case 26:return Zd(r,i),r===null?(l=vS(i.type,null,i.pendingProps,null))?i.memoizedState=l:At||(l=i.type,r=i.pendingProps,m=gf(ee.current).createElement(l),m[hn]=i,m[pn]=r,Fn(m,l,r),mn(m),i.stateNode=m):i.memoizedState=vS(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return re(i),r===null&&At&&(m=i.stateNode=pS(i.type,i.pendingProps,ee.current),zn=i,Wr=!0,R=Yt,Gi(i.type)?(Mg=R,Yt=Gr(m.firstChild)):Yt=R),Vn(r,i,i.pendingProps.children,l),Zd(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((R=m=Yt)&&(m=hL(m,i.type,i.pendingProps,Wr),m!==null?(i.stateNode=m,zn=i,Yt=Gr(m.firstChild),Wr=!1,R=!0):R=!1),R||Mi(i)),re(i),R=i.type,O=i.pendingProps,N=r!==null?r.memoizedProps:null,m=O.children,kg(R,O)?m=null:N!==null&&kg(R,N)&&(i.flags|=32),i.memoizedState!==null&&(R=Rm(r,i,T5,null,null,l),tu._currentValue=R),Zd(r,i),Vn(r,i,m,l),i.child;case 6:return r===null&&At&&((r=l=Yt)&&(l=pL(l,i.pendingProps,Wr),l!==null?(i.stateNode=l,zn=i,Yt=null,r=!0):r=!1),r||Mi(i)),null;case 13:return rb(r,i,l);case 4:return F(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=Bo(i,null,m,l):Vn(r,i,m,l),i.child;case 11:return K1(r,i,i.type,i.pendingProps,l);case 7:return Vn(r,i,i.pendingProps,l),i.child;case 8:return Vn(r,i,i.pendingProps.children,l),i.child;case 12:return Vn(r,i,i.pendingProps.children,l),i.child;case 10:return m=i.pendingProps,Di(i,i.type,m.value),Vn(r,i,m.children,l),i.child;case 9:return R=i.type._context,m=i.pendingProps.children,Po(i),R=Hn(R),m=m(R),i.flags|=1,Vn(r,i,m,l),i.child;case 14:return Y1(r,i,i.type,i.pendingProps,l);case 15:return X1(r,i,i.type,i.pendingProps,l);case 19:return ib(r,i,l);case 31:return j5(r,i,l);case 22:return Q1(r,i,l,i.pendingProps);case 24:return Po(i),m=Hn(vn),r===null?(R=gm(),R===null&&(R=Wt,O=pm(),R.pooledCache=O,O.refCount++,O!==null&&(R.pooledCacheLanes|=l),R=O),i.memoizedState={parent:m,cache:R},_m(i),Di(i,vn,R)):((r.lanes&l)!==0&&(ym(r,i),Ic(i,null,null,l),Pc()),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,vn,m)):(m=O.cache,Di(i,vn,m),m!==R.cache&&hm(i,[vn],l,!0))),Vn(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function ii(r){r.flags|=4}function eg(r,i,l,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(Db())r.flags|=8192;else throw No=Nd,vm}else r.flags&=-16777217}function ab(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!xS(i))if(Db())r.flags|=8192;else throw No=Nd,vm}function ef(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?at():536870912,r.lanes|=i,dl|=i)}function Vc(r,i){if(!At)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var m=null;l!==null;)l.alternate!==null&&(m=l),l=l.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,l=0,m=0;if(i)for(var R=r.child;R!==null;)l|=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;)l|=R.lanes|R.childLanes,m|=R.subtreeFlags,m|=R.flags,R.return=r,R=R.sibling;return r.subtreeFlags|=m,r.childLanes=l,i}function B5(r,i,l){var m=i.pendingProps;switch(lm(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 l=i.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),ti(vn),se(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Za(i)?ii(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,um())),Xt(i),null;case 26:var R=i.type,O=i.memoizedState;return r===null?(ii(i),O!==null?(Xt(i),ab(i,O)):(Xt(i),eg(i,R,null,m,l))):O?O!==r.memoizedState?(ii(i),Xt(i),ab(i,O)):(Xt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&ii(i),Xt(i),eg(i,R,r,m,l)),null;case 27:if(ne(i),l=ee.current,R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ii(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}r=J.current,Za(i)?Hy(i):(r=pS(R,m,l),i.stateNode=r,ii(i))}return Xt(i),null;case 5:if(ne(i),R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ii(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(O=J.current,Za(i))Hy(i);else{var N=gf(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[hn]=i,O[pn]=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(Fn(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&&ii(i)}}return Xt(i),eg(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&ii(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(r=ee.current,Za(i)){if(r=i.stateNode,l=i.memoizedProps,m=null,R=zn,R!==null)switch(R.tag){case 27:case 5:m=R.memoizedProps}r[hn]=i,r=!!(r.nodeValue===l||m!==null&&m.suppressHydrationWarning===!0||rS(r.nodeValue,l)),r||Mi(i,!0)}else r=gf(r).createTextNode(m),r[hn]=i,i.stateNode=r}return Xt(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(m=Za(i),l!==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[hn]=i}else Mo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else l=um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(Er(i),i):(Er(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=Za(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[hn]=i}else Mo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),R=!1}else R=um(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=R),R=!0;if(!R)return i.flags&256?(Er(i),i):(Er(i),null)}return Er(i),(i.flags&128)!==0?(i.lanes=l,i):(l=m!==null,r=r!==null&&r.memoizedState!==null,l&&(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)),l!==r&&l&&(i.child.flags|=8192),ef(i,i.updateQueue),Xt(i),null);case 4:return se(),r===null&&xg(i.stateNode.containerInfo),Xt(i),null;case 10:return ti(i.type),Xt(i),null;case 19:if(G(ln),m=i.memoizedState,m===null)return Xt(i),null;if(R=(i.flags&128)!==0,O=m.rendering,O===null)if(R)Vc(m,!1);else{if(on!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(O=Vd(r),O!==null){for(i.flags|=128,Vc(m,!1),r=O.updateQueue,i.updateQueue=r,ef(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Iy(l,r),l=l.sibling;return K(ln,ln.current&1|2),At&&Js(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&xe()>of&&(i.flags|=128,R=!0,Vc(m,!1),i.lanes=4194304)}else{if(!R)if(r=Vd(O),r!==null){if(i.flags|=128,R=!0,r=r.updateQueue,i.updateQueue=r,ef(i,r),Vc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!O.alternate&&!At)return Xt(i),null}else 2*xe()-m.renderingStartTime>of&&l!==536870912&&(i.flags|=128,R=!0,Vc(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=xe(),r.sibling=null,l=ln.current,K(ln,R?l&1|2:l&1),At&&Js(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Er(i),Cm(),m=i.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(l&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),l=i.updateQueue,l!==null&&ef(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==l&&(i.flags|=2048),r!==null&&G(Io),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),ti(vn),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function z5(r,i){switch(lm(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ti(vn),se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ne(i),null;case 31:if(i.memoizedState!==null){if(Er(i),i.alternate===null)throw Error(s(340));Mo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Er(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Mo()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return G(ln),null;case 4:return se(),null;case 10:return ti(i.type),null;case 22:case 23:return Er(i),Cm(),r!==null&&G(Io),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ti(vn),null;case 25:return null;default:return null}}function lb(r,i){switch(lm(i),i.tag){case 3:ti(vn),se();break;case 26:case 27:case 5:ne(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Er(i);break;case 13:Er(i);break;case 19:G(ln);break;case 10:ti(i.type);break;case 22:case 23:Er(i),Cm(),r!==null&&G(Io);break;case 24:ti(vn)}}function Fc(r,i){try{var l=i.updateQueue,m=l!==null?l.lastEffect:null;if(m!==null){var R=m.next;l=R;do{if((l.tag&r)===r){m=void 0;var O=l.create,N=l.inst;m=O(),N.destroy=m}l=l.next}while(l!==R)}}catch(Q){zt(i,i.return,Q)}}function zi(r,i,l){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=l,me=Q;try{me()}catch(we){zt(R,ie,we)}}}m=m.next}while(m!==O)}}catch(we){zt(i,i.return,we)}}function cb(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{Jy(i,l)}catch(m){zt(r,r.return,m)}}}function ub(r,i,l){l.props=Ho(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(m){zt(r,i,m)}}function Uc(r,i){try{var l=r.ref;if(l!==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 l=="function"?r.refCleanup=l(m):l.current=m}}catch(R){zt(r,i,R)}}function ws(r,i){var l=r.ref,m=r.refCleanup;if(l!==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 l=="function")try{l(null)}catch(R){zt(r,i,R)}else l.current=null}function db(r){var i=r.type,l=r.memoizedProps,m=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&m.focus();break e;case"img":l.src?m.src=l.src:l.srcSet&&(m.srcset=l.srcSet)}}catch(R){zt(r,r.return,R)}}function tg(r,i,l){try{var m=r.stateNode;aL(m,r.type,l,i),m[pn]=i}catch(R){zt(r,r.return,R)}}function fb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Gi(r.type)||r.tag===4}function ng(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fb(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 rg(r,i,l){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=ls));else if(m!==4&&(m===27&&Gi(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(rg(r,i,l),r=r.sibling;r!==null;)rg(r,i,l),r=r.sibling}function tf(r,i,l){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(m!==4&&(m===27&&Gi(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(tf(r,i,l),r=r.sibling;r!==null;)tf(r,i,l),r=r.sibling}function hb(r){var i=r.stateNode,l=r.memoizedProps;try{for(var m=r.type,R=i.attributes;R.length;)i.removeAttributeNode(R[0]);Fn(i,m,l),i[hn]=r,i[pn]=l}catch(O){zt(r,r.return,O)}}var oi=!1,bn=!1,sg=!1,pb=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function H5(r,i){if(r=r.containerInfo,Eg=Cf,r=Ry(r),Qp(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var m=l.getSelection&&l.getSelection();if(m&&m.rangeCount!==0){l=m.anchorNode;var R=m.anchorOffset,O=m.focusNode;m=m.focusOffset;try{l.nodeType,O.nodeType}catch{l=null;break e}var N=0,Q=-1,ie=-1,me=0,we=0,Te=r,ge=null;t:for(;;){for(var ye;Te!==l||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===l&&++me===R&&(Q=N),ge===O&&++we===m&&(ie=N),(ye=Te.nextSibling)!==null)break;Te=ge,ge=Te.parentNode}Te=ye}l=Q===-1||ie===-1?null:{start:Q,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(Rg={focusedElem:r,selectionRange:l},Cf=!1,Mn=i;Mn!==null;)if(i=Mn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Mn=r;else for(;Mn!==null;){switch(i=Mn,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(l=0;l<r.length;l++)R=r[l],R.ref.impl=R.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&O!==null){r=void 0,l=i,R=O.memoizedProps,O=O.memoizedState,m=l.stateNode;try{var Ge=Ho(l.type,R);r=m.getSnapshotBeforeUpdate(Ge,O),m.__reactInternalSnapshotBeforeUpdate=r}catch(ct){zt(l,l.return,ct)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)Lg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lg(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,Mn=r;break}Mn=i.return}}function mb(r,i,l){var m=l.flags;switch(l.tag){case 0:case 11:case 15:li(r,l),m&4&&Fc(5,l);break;case 1:if(li(r,l),m&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(N){zt(l,l.return,N)}else{var R=Ho(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(R,i,r.__reactInternalSnapshotBeforeUpdate)}catch(N){zt(l,l.return,N)}}m&64&&cb(l),m&512&&Uc(l,l.return);break;case 3:if(li(r,l),m&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Jy(r,i)}catch(N){zt(l,l.return,N)}}break;case 27:i===null&&m&4&&hb(l);case 26:case 5:li(r,l),i===null&&m&4&&db(l),m&512&&Uc(l,l.return);break;case 12:li(r,l);break;case 31:li(r,l),m&4&&_b(r,l);break;case 13:li(r,l),m&4&&yb(r,l),m&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=Y5.bind(null,l),mL(r,l))));break;case 22:if(m=l.memoizedState!==null||oi,!m){i=i!==null&&i.memoizedState!==null||bn,R=oi;var O=bn;oi=m,(bn=i)&&!O?ci(r,l,(l.subtreeFlags&8772)!==0):li(r,l),oi=R,bn=O}break;case 30:break;default:li(r,l)}}function gb(r){var i=r.alternate;i!==null&&(r.alternate=null,gb(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Eo(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 Zt=null,lr=!1;function ai(r,i,l){for(l=l.child;l!==null;)vb(r,i,l),l=l.sibling}function vb(r,i,l){if(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount($e,l)}catch{}switch(l.tag){case 26:bn||ws(l,i),ai(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:bn||ws(l,i);var m=Zt,R=lr;Gi(l.type)&&(Zt=l.stateNode,lr=!1),ai(r,i,l),Zc(l.stateNode),Zt=m,lr=R;break;case 5:bn||ws(l,i);case 6:if(m=Zt,R=lr,Zt=null,ai(r,i,l),Zt=m,lr=R,Zt!==null)if(lr)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(l.stateNode)}catch(O){zt(l,i,O)}else try{Zt.removeChild(l.stateNode)}catch(O){zt(l,i,O)}break;case 18:Zt!==null&&(lr?(r=Zt,cS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),yl(r)):cS(Zt,l.stateNode));break;case 4:m=Zt,R=lr,Zt=l.stateNode.containerInfo,lr=!0,ai(r,i,l),Zt=m,lr=R;break;case 0:case 11:case 14:case 15:zi(2,l,i),bn||zi(4,l,i),ai(r,i,l);break;case 1:bn||(ws(l,i),m=l.stateNode,typeof m.componentWillUnmount=="function"&&ub(l,i,m)),ai(r,i,l);break;case 21:ai(r,i,l);break;case 22:bn=(m=bn)||l.memoizedState!==null,ai(r,i,l),bn=m;break;default:ai(r,i,l)}}function _b(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{yl(r)}catch(l){zt(i,i.return,l)}}}function yb(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{yl(r)}catch(l){zt(i,i.return,l)}}function V5(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new pb),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new pb),i;default:throw Error(s(435,r.tag))}}function nf(r,i){var l=V5(r);i.forEach(function(m){if(!l.has(m)){l.add(m);var R=X5.bind(null,r,m);m.then(R,R)}})}function cr(r,i){var l=i.deletions;if(l!==null)for(var m=0;m<l.length;m++){var R=l[m],O=r,N=i,Q=N;e:for(;Q!==null;){switch(Q.tag){case 27:if(Gi(Q.type)){Zt=Q.stateNode,lr=!1;break e}break;case 5:Zt=Q.stateNode,lr=!1;break e;case 3:case 4:Zt=Q.stateNode.containerInfo,lr=!0;break e}Q=Q.return}if(Zt===null)throw Error(s(160));vb(O,N,R),Zt=null,lr=!1,O=R.alternate,O!==null&&(O.return=null),R.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)bb(i,r),i=i.sibling}var us=null;function bb(r,i){var l=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:cr(i,r),ur(r),m&4&&(zi(3,r,r.return),Fc(3,r),zi(5,r,r.return));break;case 1:cr(i,r),ur(r),m&512&&(bn||l===null||ws(l,l.return)),m&64&&oi&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?m:l.concat(m))));break;case 26:var R=us;if(cr(i,r),ur(r),m&512&&(bn||l===null||ws(l,l.return)),m&4){var O=l!==null?l.memoizedState:null;if(m=r.memoizedState,l===null)if(m===null)if(r.stateNode===null){e:{m=r.type,l=r.memoizedProps,R=R.ownerDocument||R;t:switch(m){case"title":O=R.getElementsByTagName("title")[0],(!O||O[wo]||O[hn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=R.createElement(m),R.head.insertBefore(O,R.querySelector("head > title"))),Fn(O,m,l),O[hn]=r,mn(O),m=O;break e;case"link":var N=bS("link","href",R).get(m+(l.href||""));if(N){for(var Q=0;Q<N.length;Q++)if(O=N[Q],O.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&O.getAttribute("rel")===(l.rel==null?null:l.rel)&&O.getAttribute("title")===(l.title==null?null:l.title)&&O.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){N.splice(Q,1);break t}}O=R.createElement(m),Fn(O,m,l),R.head.appendChild(O);break;case"meta":if(N=bS("meta","content",R).get(m+(l.content||""))){for(Q=0;Q<N.length;Q++)if(O=N[Q],O.getAttribute("content")===(l.content==null?null:""+l.content)&&O.getAttribute("name")===(l.name==null?null:l.name)&&O.getAttribute("property")===(l.property==null?null:l.property)&&O.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&O.getAttribute("charset")===(l.charSet==null?null:l.charSet)){N.splice(Q,1);break t}}O=R.createElement(m),Fn(O,m,l),R.head.appendChild(O);break;default:throw Error(s(468,m))}O[hn]=r,mn(O),m=O}r.stateNode=m}else SS(R,r.type,r.stateNode);else r.stateNode=yS(R,m,r.memoizedProps);else O!==m?(O===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):O.count--,m===null?SS(R,r.type,r.stateNode):yS(R,m,r.memoizedProps)):m===null&&r.stateNode!==null&&tg(r,r.memoizedProps,l.memoizedProps)}break;case 27:cr(i,r),ur(r),m&512&&(bn||l===null||ws(l,l.return)),l!==null&&m&4&&tg(r,r.memoizedProps,l.memoizedProps);break;case 5:if(cr(i,r),ur(r),m&512&&(bn||l===null||ws(l,l.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,tg(r,R,l!==null?l.memoizedProps:R)),m&1024&&(sg=!0);break;case 6:if(cr(i,r),ur(r),m&4){if(r.stateNode===null)throw Error(s(162));m=r.memoizedProps,l=r.stateNode;try{l.nodeValue=m}catch(Ge){zt(r,r.return,Ge)}}break;case 3:if(yf=null,R=us,us=vf(i.containerInfo),cr(i,r),us=R,ur(r),m&4&&l!==null&&l.memoizedState.isDehydrated)try{yl(i.containerInfo)}catch(Ge){zt(r,r.return,Ge)}sg&&(sg=!1,Sb(r));break;case 4:m=us,us=vf(r.stateNode.containerInfo),cr(i,r),ur(r),us=m;break;case 12:cr(i,r),ur(r);break;case 31:cr(i,r),ur(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,nf(r,m)));break;case 13:cr(i,r),ur(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(sf=xe()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,nf(r,m)));break;case 22:R=r.memoizedState!==null;var ie=l!==null&&l.memoizedState!==null,me=oi,we=bn;if(oi=me||R,bn=we||ie,cr(i,r),bn=we,oi=me,ur(r),m&8192)e:for(i=r.stateNode,i._visibility=R?i._visibility&-2:i._visibility|1,R&&(l===null||ie||oi||bn||Vo(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){ie=l=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(l===null){ie=i;try{ie.stateNode.nodeValue=R?"":ie.memoizedProps}catch(Ge){zt(ie,ie.return,Ge)}}}else if(i.tag===18){if(l===null){ie=i;try{var ye=ie.stateNode;R?uS(ye,!0):uS(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;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=r.updateQueue,m!==null&&(l=m.retryQueue,l!==null&&(m.retryQueue=null,nf(r,l))));break;case 19:cr(i,r),ur(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,nf(r,m)));break;case 30:break;case 21:break;default:cr(i,r),ur(r)}}function ur(r){var i=r.flags;if(i&2){try{for(var l,m=r.return;m!==null;){if(fb(m)){l=m;break}m=m.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var R=l.stateNode,O=ng(r);tf(r,O,R);break;case 5:var N=l.stateNode;l.flags&32&&(tt(N,""),l.flags&=-33);var Q=ng(r);tf(r,Q,N);break;case 3:case 4:var ie=l.stateNode.containerInfo,me=ng(r);rg(r,me,ie);break;default:throw Error(s(161))}}catch(we){zt(r,r.return,we)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Sb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Sb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function li(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)mb(r,i.alternate,i),i=i.sibling}function Vo(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),Vo(i);break;case 1:ws(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&ub(i,i.return,l),Vo(i);break;case 27:Zc(i.stateNode);case 26:case 5:ws(i,i.return),Vo(i);break;case 22:i.memoizedState===null&&Vo(i);break;case 30:Vo(i);break;default:Vo(i)}r=r.sibling}}function ci(r,i,l){for(l=l&&(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:ci(R,O,l),Fc(4,O);break;case 1:if(ci(R,O,l),m=O,R=m.stateNode,typeof R.componentDidMount=="function")try{R.componentDidMount()}catch(me){zt(m,m.return,me)}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++)Zy(ie[R],Q)}catch(me){zt(m,m.return,me)}}l&&N&64&&cb(O),Uc(O,O.return);break;case 27:hb(O);case 26:case 5:ci(R,O,l),l&&m===null&&N&4&&db(O),Uc(O,O.return);break;case 12:ci(R,O,l);break;case 31:ci(R,O,l),l&&N&4&&_b(R,O);break;case 13:ci(R,O,l),l&&N&4&&yb(R,O);break;case 22:O.memoizedState===null&&ci(R,O,l),Uc(O,O.return);break;case 30:break;default:ci(R,O,l)}i=i.sibling}}function ig(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Lc(l))}function og(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Lc(r))}function ds(r,i,l,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)xb(r,i,l,m),i=i.sibling}function xb(r,i,l,m){var R=i.flags;switch(i.tag){case 0:case 11:case 15:ds(r,i,l,m),R&2048&&Fc(9,i);break;case 1:ds(r,i,l,m);break;case 3:ds(r,i,l,m),R&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Lc(r)));break;case 12:if(R&2048){ds(r,i,l,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 ds(r,i,l,m);break;case 31:ds(r,i,l,m);break;case 13:ds(r,i,l,m);break;case 23:break;case 22:O=i.stateNode,N=i.alternate,i.memoizedState!==null?O._visibility&2?ds(r,i,l,m):Wc(r,i):O._visibility&2?ds(r,i,l,m):(O._visibility|=2,ll(r,i,l,m,(i.subtreeFlags&10256)!==0||!1)),R&2048&&ig(N,i);break;case 24:ds(r,i,l,m),R&2048&&og(i.alternate,i);break;default:ds(r,i,l,m)}}function ll(r,i,l,m,R){for(R=R&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var O=r,N=i,Q=l,ie=m,me=N.flags;switch(N.tag){case 0:case 11:case 15:ll(O,N,Q,ie,R),Fc(8,N);break;case 23:break;case 22:var we=N.stateNode;N.memoizedState!==null?we._visibility&2?ll(O,N,Q,ie,R):Wc(O,N):(we._visibility|=2,ll(O,N,Q,ie,R)),R&&me&2048&&ig(N.alternate,N);break;case 24:ll(O,N,Q,ie,R),R&&me&2048&&og(N.alternate,N);break;default:ll(O,N,Q,ie,R)}i=i.sibling}}function Wc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,m=i,R=m.flags;switch(m.tag){case 22:Wc(l,m),R&2048&&ig(m.alternate,m);break;case 24:Wc(l,m),R&2048&&og(m.alternate,m);break;default:Wc(l,m)}i=i.sibling}}var qc=8192;function cl(r,i,l){if(r.subtreeFlags&qc)for(r=r.child;r!==null;)Cb(r,i,l),r=r.sibling}function Cb(r,i,l){switch(r.tag){case 26:cl(r,i,l),r.flags&qc&&r.memoizedState!==null&&kL(l,us,r.memoizedState,r.memoizedProps);break;case 5:cl(r,i,l);break;case 3:case 4:var m=us;us=vf(r.stateNode.containerInfo),cl(r,i,l),us=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=qc,qc=16777216,cl(r,i,l),qc=m):cl(r,i,l));break;default:cl(r,i,l)}}function wb(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 Gc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var m=i[l];Mn=m,Rb(m,r)}wb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Eb(r),r=r.sibling}function Eb(r){switch(r.tag){case 0:case 11:case 15:Gc(r),r.flags&2048&&zi(9,r,r.return);break;case 3:Gc(r);break;case 12:Gc(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,rf(r)):Gc(r);break;default:Gc(r)}}function rf(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var m=i[l];Mn=m,Rb(m,r)}wb(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:zi(8,i,i.return),rf(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,rf(i));break;default:rf(i)}r=r.sibling}}function Rb(r,i){for(;Mn!==null;){var l=Mn;switch(l.tag){case 0:case 11:case 15:zi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var m=l.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Lc(l.memoizedState.cache)}if(m=l.child,m!==null)m.return=l,Mn=m;else e:for(l=r;Mn!==null;){m=Mn;var R=m.sibling,O=m.return;if(gb(m),m===l){Mn=null;break e}if(R!==null){R.return=O,Mn=R;break e}Mn=O}}}var F5={getCacheForType:function(r){var i=Hn(vn),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return Hn(vn).controller.signal}},U5=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Wt=null,Et=null,Tt=0,Bt=0,Rr=null,Hi=!1,ul=!1,ag=!1,ui=0,on=0,Vi=0,Fo=0,lg=0,kr=0,dl=0,$c=null,dr=null,cg=!1,sf=0,kb=0,of=1/0,af=null,Fi=null,En=0,Ui=null,fl=null,di=0,ug=0,dg=null,Tb=null,Kc=0,fg=null;function Tr(){return(Pt&2)!==0&&Tt!==0?Tt&-Tt:V.T!==null?_g():ys()}function Lb(){if(kr===0)if((Tt&536870912)===0||At){var r=tn;tn<<=1,(tn&3932160)===0&&(tn=262144),kr=r}else kr=536870912;return r=wr.current,r!==null&&(r.flags|=32),kr}function fr(r,i,l){(r===Wt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(hl(r,0),Wi(r,Tt,kr,!1)),bt(r,l),((Pt&2)===0||r!==Wt)&&(r===Wt&&((Pt&2)===0&&(Fo|=l),on===4&&Wi(r,Tt,kr,!1)),Es(r))}function Ab(r,i,l){if((Pt&6)!==0)throw Error(s(327));var m=!l&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),R=m?G5(r,i):pg(r,i,!0),O=m;do{if(R===0){ul&&!m&&Wi(r,i,0,!1);break}else{if(l=r.current.alternate,O&&!W5(l)){R=pg(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=$c;var ie=Q.current.memoizedState.isDehydrated;if(ie&&(hl(Q,N).flags|=256),N=pg(Q,N,!1),N!==2){if(ag&&!ie){Q.errorRecoveryDisabledLanes|=O,Fo|=O,R=4;break e}O=dr,dr=R,O!==null&&(dr===null?dr=O:dr.push.apply(dr,O))}R=N}if(O=!1,R!==2)continue}}if(R===1){hl(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,kr,!Hi);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(R=sf+300-xe(),10<R)){if(Wi(m,i,kr,!Hi),Je(m,0,!0)!==0)break e;di=i,m.timeoutHandle=aS(Ob.bind(null,m,l,dr,af,cg,i,kr,Fo,dl,Hi,O,"Throttled",-0,0),R);break e}Ob(m,l,dr,af,cg,i,kr,Fo,dl,Hi,O,null,-0,0)}}break}while(!0);Es(r)}function Ob(r,i,l,m,R,O,N,Q,ie,me,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:ls},Cb(i,O,Te);var Ge=(O&62914560)===O?sf-xe():(O&4194048)===O?kb-xe():0;if(Ge=TL(Te,Ge),Ge!==null){di=O,r.cancelPendingCommit=Ge(zb.bind(null,r,i,O,l,m,R,N,Q,ie,we,Te,null,ge,ye)),Wi(r,O,N,!me);return}}zb(r,i,O,l,m,R,N,Q,ie)}function W5(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var m=0;m<l.length;m++){var R=l[m],O=R.getSnapshot;R=R.value;try{if(!xr(O(),R))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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,l,m){i&=~lg,i&=~Fo,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var R=i;0<R;){var O=31-rt(R),N=1<<O;m[O]=-1,R&=~N}l!==0&&Qe(r,l,i)}function lf(){return(Pt&6)===0?(Yc(0),!1):!0}function hg(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,ei=Do=null,Lm(r),rl=null,Oc=0,r=Et;for(;r!==null;)lb(r.alternate,r),r=r.return;Et=null}}function hl(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,uL(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),di=0,hg(),Wt=r,Et=l=Zs(r.current,null),Tt=i,Bt=0,Rr=null,Hi=!1,ul=Ot(r,i),ag=!1,dl=kr=lg=Fo=Vi=on=0,dr=$c=null,cg=!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-rt(m),O=1<<R;i|=r[R],m&=~O}return ui=i,Td(),l}function Mb(r,i){gt=null,V.H=zc,i===nl||i===jd?(i=Ky(),Bt=3):i===vm?(i=Ky(),Bt=4):Bt=i===qm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rr=i,Et===null&&(on=1,Xd(r,Vr(i,r.current)))}function Db(){var r=wr.current;return r===null?!0:(Tt&4194048)===Tt?qr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===qr:!1}function Pb(){var r=V.H;return V.H=zc,r===null?zc:r}function Ib(){var r=V.A;return V.A=F5,r}function cf(){on=4,Hi||(Tt&4194048)!==Tt&&wr.current!==null||(ul=!0),(Vi&134217727)===0&&(Fo&134217727)===0||Wt===null||Wi(Wt,Tt,kr,!1)}function pg(r,i,l){var m=Pt;Pt|=2;var R=Pb(),O=Ib();(Wt!==r||Tt!==i)&&(af=null,hl(r,i)),i=!1;var N=on;e:do try{if(Bt!==0&&Et!==null){var Q=Et,ie=Rr;switch(Bt){case 8:hg(),N=6;break e;case 3:case 2:case 9:case 6:wr.current===null&&(i=!0);var me=Bt;if(Bt=0,Rr=null,pl(r,Q,ie,me),l&&ul){N=0;break e}break;default:me=Bt,Bt=0,Rr=null,pl(r,Q,ie,me)}}q5(),N=on;break}catch(we){Mb(r,we)}while(!0);return i&&r.shellSuspendCounter++,ei=Do=null,Pt=m,V.H=R,V.A=O,Et===null&&(Wt=null,Tt=0,Td()),N}function q5(){for(;Et!==null;)jb(Et)}function G5(r,i){var l=Pt;Pt|=2;var m=Pb(),R=Ib();Wt!==r||Tt!==i?(af=null,of=xe()+500,hl(r,i)):ul=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=Rr;t:switch(Bt){case 1:Bt=0,Rr=null,pl(r,i,O,1);break;case 2:case 9:if(Gy(O)){Bt=0,Rr=null,Nb(i);break}i=function(){Bt!==2&&Bt!==9||Wt!==r||(Bt=7),Es(r)},O.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:Gy(O)?(Bt=0,Rr=null,Nb(i)):(Bt=0,Rr=null,pl(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?xS(N):Q.stateNode.complete){Bt=0,Rr=null;var ie=Q.sibling;if(ie!==null)Et=ie;else{var me=Q.return;me!==null?(Et=me,uf(me)):Et=null}break t}}Bt=0,Rr=null,pl(r,i,O,5);break;case 6:Bt=0,Rr=null,pl(r,i,O,6);break;case 8:hg(),on=6;break e;default:throw Error(s(462))}}$5();break}catch(we){Mb(r,we)}while(!0);return ei=Do=null,V.H=m,V.A=R,Pt=l,Et!==null?0:(Wt=null,Tt=0,Td(),on)}function $5(){for(;Et!==null&&!be();)jb(Et)}function jb(r){var i=ob(r.alternate,r,ui);r.memoizedProps=r.pendingProps,i===null?uf(r):Et=i}function Nb(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=eb(l,i,i.pendingProps,i.type,void 0,Tt);break;case 11:i=eb(l,i,i.pendingProps,i.type.render,i.ref,Tt);break;case 5:Lm(i);default:lb(l,i),i=Et=Iy(i,ui),i=ob(l,i,ui)}r.memoizedProps=r.pendingProps,i===null?uf(r):Et=i}function pl(r,i,l,m){ei=Do=null,Lm(i),rl=null,Oc=0;var R=i.return;try{if(I5(r,R,i,l,Tt)){on=1,Xd(r,Vr(l,r.current)),Et=null;return}}catch(O){if(R!==null)throw Et=R,O;on=1,Xd(r,Vr(l,r.current)),Et=null;return}i.flags&32768?(At||m===1?r=!0:ul||(Tt&536870912)!==0?r=!1:(Hi=r=!0,(m===2||m===9||m===3||m===6)&&(m=wr.current,m!==null&&m.tag===13&&(m.flags|=16384))),Bb(i,r)):uf(i)}function uf(r){var i=r;do{if((i.flags&32768)!==0){Bb(i,Hi);return}r=i.return;var l=B5(i.alternate,i,ui);if(l!==null){Et=l;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);on===0&&(on=5)}function Bb(r,i){do{var l=z5(r.alternate,r);if(l!==null){l.flags&=32767,Et=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){Et=r;return}Et=r=l}while(r!==null);on=6,Et=null}function zb(r,i,l,m,R,O,N,Q,ie){r.cancelPendingCommit=null;do df();while(En!==0);if((Pt&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=nm,St(r,l,O,N,Q,ie),r===Wt&&(Et=Wt=null,Tt=0),fl=i,Ui=r,di=l,ug=O,dg=R,Tb=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Q5(He,function(){return Wb(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=V.T,V.T=null,R=q.p,q.p=2,N=Pt,Pt|=4;try{H5(r,i,l)}finally{Pt=N,q.p=R,V.T=m}}En=1,Hb(),Vb(),Fb()}}function Hb(){if(En===1){En=0;var r=Ui,i=fl,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=V.T,V.T=null;var m=q.p;q.p=2;var R=Pt;Pt|=4;try{bb(i,r);var O=Rg,N=Ry(r.containerInfo),Q=O.focusedElem,ie=O.selectionRange;if(N!==Q&&Q&&Q.ownerDocument&&Ey(Q.ownerDocument.documentElement,Q)){if(ie!==null&&Qp(Q)){var me=ie.start,we=ie.end;if(we===void 0&&(we=me),"selectionStart"in Q)Q.selectionStart=me,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,ct=Math.min(ie.start,Ge),Ut=ie.end===void 0?ct:Math.min(ie.end,Ge);!ye.extend&&ct>Ut&&(N=Ut,Ut=ct,ct=N);var de=wy(Q,ct),le=wy(Q,Ut);if(de&&le&&(ye.rangeCount!==1||ye.anchorNode!==de.node||ye.anchorOffset!==de.offset||ye.focusNode!==le.node||ye.focusOffset!==le.offset)){var pe=Te.createRange();pe.setStart(de.node,de.offset),ye.removeAllRanges(),ct>Ut?(ye.addRange(pe),ye.extend(le.node,le.offset)):(pe.setEnd(le.node,le.offset),ye.addRange(pe))}}}}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}}Cf=!!Eg,Rg=Eg=null}finally{Pt=R,q.p=m,V.T=l}}r.current=i,En=2}}function Vb(){if(En===2){En=0;var r=Ui,i=fl,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=V.T,V.T=null;var m=q.p;q.p=2;var R=Pt;Pt|=4;try{mb(r,i.alternate,i)}finally{Pt=R,q.p=m,V.T=l}}En=3}}function Fb(){if(En===4||En===3){En=0,ae();var r=Ui,i=fl,l=di,m=Tb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?En=5:(En=0,fl=Ui=null,Ub(r,r.pendingLanes));var R=r.pendingLanes;if(R===0&&(Fi=null),Bn(l),i=i.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot($e,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=V.T,R=q.p,q.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,q.p=R}}(di&3)!==0&&df(),Es(r),R=r.pendingLanes,(l&261930)!==0&&(R&42)!==0?r===fg?Kc++:(Kc=0,fg=r):Kc=0,Yc(0)}}function Ub(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Lc(i)))}function df(){return Hb(),Vb(),Fb(),Wb()}function Wb(){if(En!==5)return!1;var r=Ui,i=ug;ug=0;var l=Bn(di),m=V.T,R=q.p;try{q.p=32>l?32:l,V.T=null,l=dg,dg=null;var O=Ui,N=di;if(En=0,fl=Ui=null,di=0,(Pt&6)!==0)throw Error(s(331));var Q=Pt;if(Pt|=4,Eb(O.current),xb(O,O.current,N,l),Pt=Q,Yc(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot($e,O)}catch{}return!0}finally{q.p=R,V.T=m,Ub(r,i)}}function qb(r,i,l){i=Vr(l,i),i=Wm(r.stateNode,i,2),r=ji(r,i,2),r!==null&&(bt(r,2),Es(r))}function zt(r,i,l){if(r.tag===3)qb(r,r,l);else for(;i!==null;){if(i.tag===3){qb(i,r,l);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=Vr(l,r),l=G1(2),m=ji(i,l,2),m!==null&&($1(l,m,i,r),bt(m,2),Es(m));break}}i=i.return}}function mg(r,i,l){var m=r.pingCache;if(m===null){m=r.pingCache=new U5;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(l)||(ag=!0,R.add(l),r=K5.bind(null,r,i,l),i.then(r,r))}function K5(r,i,l){var m=r.pingCache;m!==null&&m.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,Wt===r&&(Tt&l)===l&&(on===4||on===3&&(Tt&62914560)===Tt&&300>xe()-sf?(Pt&2)===0&&hl(r,0):lg|=l,dl===Tt&&(dl=0)),Es(r)}function Gb(r,i){i===0&&(i=at()),r=Ao(r,i),r!==null&&(bt(r,i),Es(r))}function Y5(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Gb(r,l)}function X5(r,i){var l=0;switch(r.tag){case 31:case 13:var m=r.stateNode,R=r.memoizedState;R!==null&&(l=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),Gb(r,l)}function Q5(r,i){return Pe(r,i)}var ff=null,ml=null,gg=!1,hf=!1,vg=!1,qi=0;function Es(r){r!==ml&&r.next===null&&(ml===null?ff=ml=r:ml=ml.next=r),hf=!0,gg||(gg=!0,J5())}function Yc(r,i){if(!vg&&hf){vg=!0;do for(var l=!1,m=ff;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-rt(42|r)+1)-1,O&=R&~(N&~Q),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(l=!0,Xb(m,O))}else O=Tt,O=Je(m,m===Wt?O:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(O&3)===0||Ot(m,O)||(l=!0,Xb(m,O));m=m.next}while(l);vg=!1}}function Z5(){$b()}function $b(){hf=gg=!1;var r=0;qi!==0&&cL()&&(r=qi);for(var i=xe(),l=null,m=ff;m!==null;){var R=m.next,O=Kb(m,i);O===0?(m.next=null,l===null?ff=R:l.next=R,R===null&&(ml=l)):(l=m,(r!==0||(O&3)!==0)&&(hf=!0)),m=R}En!==0&&En!==5||Yc(r),qi!==0&&(qi=0)}function Kb(r,i){for(var l=r.suspendedLanes,m=r.pingedLanes,R=r.expirationTimes,O=r.pendingLanes&-62914561;0<O;){var N=31-rt(O),Q=1<<N,ie=R[N];ie===-1?((Q&l)===0||(Q&m)!==0)&&(R[N]=jt(Q,i)):ie<=i&&(r.expiredLanes|=Q),O&=~Q}if(i=Wt,l=Tt,l=Je(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,l===0||r===i&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&Se(m),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Ot(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(m!==null&&Se(m),Bn(l)){case 2:case 8:l=nt;break;case 32:l=He;break;case 268435456:l=et;break;default:l=He}return m=Yb.bind(null,r),l=Pe(l,m),r.callbackPriority=i,r.callbackNode=l,i}return m!==null&&m!==null&&Se(m),r.callbackPriority=2,r.callbackNode=null,2}function Yb(r,i){if(En!==0&&En!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(df()&&r.callbackNode!==l)return null;var m=Tt;return m=Je(r,r===Wt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(Ab(r,m,i),Kb(r,xe()),r.callbackNode!=null&&r.callbackNode===l?Yb.bind(null,r):null)}function Xb(r,i){if(df())return null;Ab(r,i,!0)}function J5(){dL(function(){(Pt&6)!==0?Pe(Ue,Z5):$b()})}function _g(){if(qi===0){var r=el;r===0&&(r=lt,lt<<=1,(lt&261888)===0&&(lt=256)),qi=r}return qi}function Qb(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Xs(""+r)}function Zb(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function eL(r,i,l,m,R){if(i==="submit"&&l&&l.stateNode===R){var O=Qb((R[pn]||null).action),N=m.submitter;N&&(i=(i=N[pn]||null)?Qb(i.formAction):N.getAttribute("formAction"),i!==null&&(O=i,N=null));var Q=new wd("action","action",null,m,R);r.push({event:Q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(qi!==0){var ie=N?Zb(R,N):new FormData(R);Bm(l,{pending:!0,data:ie,method:R.method,action:O},null,ie)}}else typeof O=="function"&&(Q.preventDefault(),ie=N?Zb(R,N):new FormData(R),Bm(l,{pending:!0,data:ie,method:R.method,action:O},O,ie))},currentTarget:R}]})}}for(var yg=0;yg<tm.length;yg++){var bg=tm[yg],tL=bg.toLowerCase(),nL=bg[0].toUpperCase()+bg.slice(1);cs(tL,"on"+nL)}cs(Ly,"onAnimationEnd"),cs(Ay,"onAnimationIteration"),cs(Oy,"onAnimationStart"),cs("dblclick","onDoubleClick"),cs("focusin","onFocus"),cs("focusout","onBlur"),cs(_5,"onTransitionRun"),cs(y5,"onTransitionStart"),cs(b5,"onTransitionCancel"),cs(My,"onTransitionEnd"),as("onMouseEnter",["mouseout","mouseover"]),as("onMouseLeave",["mouseout","mouseover"]),as("onPointerEnter",["pointerout","pointerover"]),as("onPointerLeave",["pointerout","pointerover"]),br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),br("onBeforeInput",["compositionend","keypress","textInput","paste"]),br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xc="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(" "),rL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xc));function Jb(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var m=r[l],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,me=Q.currentTarget;if(Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=me;try{O(R)}catch(we){kd(we)}R.currentTarget=null,O=ie}else for(N=0;N<m.length;N++){if(Q=m[N],ie=Q.instance,me=Q.currentTarget,Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=me;try{O(R)}catch(we){kd(we)}R.currentTarget=null,O=ie}}}}function Rt(r,i){var l=i[yr];l===void 0&&(l=i[yr]=new Set);var m=r+"__bubble";l.has(m)||(eS(i,r,2,!1),l.add(m))}function Sg(r,i,l){var m=0;i&&(m|=4),eS(l,r,m,i)}var pf="_reactListening"+Math.random().toString(36).slice(2);function xg(r){if(!r[pf]){r[pf]=!0,er.forEach(function(l){l!=="selectionchange"&&(rL.has(l)||Sg(l,!1,r),Sg(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[pf]||(i[pf]=!0,Sg("selectionchange",!1,i))}}function eS(r,i,l,m){switch(LS(i)){case 2:var R=OL;break;case 8:R=ML;break;default:R=Ng}l=R.bind(null,i,l,r),R=void 0,!Fp||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(R=!0),m?R!==void 0?r.addEventListener(i,l,{capture:!0,passive:R}):r.addEventListener(i,l,!0):R!==void 0?r.addEventListener(i,l,{passive:R}):r.addEventListener(i,l,!1)}function Cg(r,i,l,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=Gs(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}iy(function(){var me=O,we=Hp(l),Te=[];e:{var ge=Dy.get(r);if(ge!==void 0){var ye=wd,Ge=r;switch(r){case"keypress":if(xd(l)===0)break e;case"keydown":case"keyup":ye=XT;break;case"focusin":Ge="focus",ye=Gp;break;case"focusout":Ge="blur",ye=Gp;break;case"beforeblur":case"afterblur":ye=Gp;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=ly;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=BT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=JT;break;case Ly:case Ay:case Oy:ye=VT;break;case My:ye=t5;break;case"scroll":case"scrollend":ye=jT;break;case"wheel":ye=r5;break;case"copy":case"cut":case"paste":ye=UT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=uy;break;case"toggle":case"beforetoggle":ye=i5}var ct=(i&4)!==0,Ut=!ct&&(r==="scroll"||r==="scrollend"),de=ct?ge!==null?ge+"Capture":null:ge;ct=[];for(var le=me,pe;le!==null;){var ke=le;if(pe=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||pe===null||de===null||(ke=_c(le,de),ke!=null&&ct.push(Qc(le,ke,pe))),Ut)break;le=le.return}0<ct.length&&(ge=new ye(ge,Ge,null,l,we),Te.push({event:ge,listeners:ct}))}}if((i&7)===0){e:{if(ge=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",ge&&l!==bd&&(Ge=l.relatedTarget||l.fromElement)&&(Gs(Ge)||Ge[bs]))break e;if((ye||ge)&&(ge=we.window===we?we:(ge=we.ownerDocument)?ge.defaultView||ge.parentWindow:window,ye?(Ge=l.relatedTarget||l.toElement,ye=me,Ge=Ge?Gs(Ge):null,Ge!==null&&(Ut=u(Ge),ct=Ge.tag,Ge!==Ut||ct!==5&&ct!==27&&ct!==6)&&(Ge=null)):(ye=null,Ge=me),ye!==Ge)){if(ct=ly,ke="onMouseLeave",de="onMouseEnter",le="mouse",(r==="pointerout"||r==="pointerover")&&(ct=uy,ke="onPointerLeave",de="onPointerEnter",le="pointer"),Ut=ye==null?ge:Ro(ye),pe=Ge==null?ge:Ro(Ge),ge=new ct(ke,le+"leave",ye,l,we),ge.target=Ut,ge.relatedTarget=pe,ke=null,Gs(we)===me&&(ct=new ct(de,le+"enter",Ge,l,we),ct.target=pe,ct.relatedTarget=Ut,ke=ct),Ut=ke,ye&&Ge)t:{for(ct=sL,de=ye,le=Ge,pe=0,ke=de;ke;ke=ct(ke))pe++;ke=0;for(var ot=le;ot;ot=ct(ot))ke++;for(;0<pe-ke;)de=ct(de),pe--;for(;0<ke-pe;)le=ct(le),ke--;for(;pe--;){if(de===le||le!==null&&de===le.alternate){ct=de;break t}de=ct(de),le=ct(le)}ct=null}else ct=null;ye!==null&&tS(Te,ge,ye,ct,!1),Ge!==null&&Ut!==null&&tS(Te,Ut,Ge,ct,!0)}}e:{if(ge=me?Ro(me):window,ye=ge.nodeName&&ge.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ge.type==="file")var Mt=_y;else if(gy(ge))if(yy)Mt=m5;else{Mt=h5;var Ze=f5}else ye=ge.nodeName,!ye||ye.toLowerCase()!=="input"||ge.type!=="checkbox"&&ge.type!=="radio"?me&&gn(me.elementType)&&(Mt=_y):Mt=p5;if(Mt&&(Mt=Mt(r,me))){vy(Te,Mt,l,we);break e}Ze&&Ze(r,ge,me),r==="focusout"&&me&&ge.type==="number"&&me.memoizedProps.value!=null&&vc(ge,"number",ge.value)}switch(Ze=me?Ro(me):window,r){case"focusin":(gy(Ze)||Ze.contentEditable==="true")&&(Ga=Ze,Zp=me,Rc=null);break;case"focusout":Rc=Zp=Ga=null;break;case"mousedown":Jp=!0;break;case"contextmenu":case"mouseup":case"dragend":Jp=!1,ky(Te,l,we);break;case"selectionchange":if(v5)break;case"keydown":case"keyup":ky(Te,l,we)}var _t;if(Kp)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 qa?py(r,l)&&(Lt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Lt="onCompositionStart");Lt&&(dy&&l.locale!=="ko"&&(qa||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&qa&&(_t=oy()):(Li=we,Up="value"in Li?Li.value:Li.textContent,qa=!0)),Ze=mf(me,Lt),0<Ze.length&&(Lt=new cy(Lt,r,null,l,we),Te.push({event:Lt,listeners:Ze}),_t?Lt.data=_t:(_t=my(l),_t!==null&&(Lt.data=_t)))),(_t=a5?l5(r,l):c5(r,l))&&(Lt=mf(me,"onBeforeInput"),0<Lt.length&&(Ze=new cy("onBeforeInput","beforeinput",null,l,we),Te.push({event:Ze,listeners:Lt}),Ze.data=_t)),eL(Te,r,me,l,we)}Jb(Te,i)})}function Qc(r,i,l){return{instance:r,listener:i,currentTarget:l}}function mf(r,i){for(var l=i+"Capture",m=[];r!==null;){var R=r,O=R.stateNode;if(R=R.tag,R!==5&&R!==26&&R!==27||O===null||(R=_c(r,l),R!=null&&m.unshift(Qc(r,R,O)),R=_c(r,i),R!=null&&m.push(Qc(r,R,O))),r.tag===3)return m;r=r.return}return[]}function sL(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function tS(r,i,l,m,R){for(var O=i._reactName,N=[];l!==null&&l!==m;){var Q=l,ie=Q.alternate,me=Q.stateNode;if(Q=Q.tag,ie!==null&&ie===m)break;Q!==5&&Q!==26&&Q!==27||me===null||(ie=me,R?(me=_c(l,O),me!=null&&N.unshift(Qc(l,me,ie))):R||(me=_c(l,O),me!=null&&N.push(Qc(l,me,ie)))),l=l.return}N.length!==0&&r.push({event:i,listeners:N})}var iL=/\r\n?/g,oL=/\u0000|\uFFFD/g;function nS(r){return(typeof r=="string"?r:""+r).replace(iL,`
10
+ `).replace(oL,"")}function rS(r,i){return i=nS(i),nS(r)===i}function Ft(r,i,l,m,R,O){switch(l){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,l,m);break;case"style":nn(r,m,O);break;case"data":if(i!=="object"){Ri(r,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(l);break}m=Xs(""+m),r.setAttribute(l,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(l,"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"&&(l==="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(l);break}m=Xs(""+m),r.setAttribute(l,m);break;case"onClick":m!=null&&(r.onclick=ls);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(l=m.__html,l!=null){if(R.children!=null)throw Error(s(60));r.innerHTML=l}}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}l=Xs(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);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(l,""+m):r.removeAttribute(l);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(l,""):r.removeAttribute(l);break;case"capture":case"download":m===!0?r.setAttribute(l,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(l,m):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(l,m):r.removeAttribute(l);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(l):r.setAttribute(l,m);break;case"popover":Rt("beforetoggle",r),Rt("toggle",r),$s(r,"popover",m);break;case"xlinkActuate":Sr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Sr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Sr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Sr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Sr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Sr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Sr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Sr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Sr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":$s(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Ks.get(l)||l,$s(r,l,m))}}function wg(r,i,l,m,R,O){switch(l){case"style":nn(r,m,O);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(l=m.__html,l!=null){if(R.children!=null)throw Error(s(60));r.innerHTML=l}}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=ls);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(R=l.endsWith("Capture"),i=l.slice(2,R?l.length-7:void 0),O=r[pn]||null,O=O!=null?O[l]:null,typeof O=="function"&&r.removeEventListener(i,O,R),typeof m=="function")){typeof O!="function"&&O!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,m,R);break e}l in r?r[l]=m:m===!0?r.setAttribute(l,""):$s(r,l,m)}}}function Fn(r,i,l){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 l)if(l.hasOwnProperty(O)){var N=l[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,l,null)}}R&&Ft(r,i,"srcSet",l.srcSet,l,null),m&&Ft(r,i,"src",l.src,l,null);return;case"input":Rt("invalid",r);var Q=O=N=R=null,ie=null,me=null;for(m in l)if(l.hasOwnProperty(m)){var we=l[m];if(we!=null)switch(m){case"name":R=we;break;case"type":N=we;break;case"checked":ie=we;break;case"defaultChecked":me=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,l,null)}}_d(r,O,Q,ie,me,N,R,!1);return;case"select":Rt("invalid",r),m=N=O=null;for(R in l)if(l.hasOwnProperty(R)&&(Q=l[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,l,null)}i=O,l=N,r.multiple=!!m,i!=null?Ti(r,!!m,i,!1):l!=null&&Ti(r,!!m,l,!0);return;case"textarea":Rt("invalid",r),O=R=m=null;for(N in l)if(l.hasOwnProperty(N)&&(Q=l[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,l,null)}Ve(r,m,R,O);return;case"option":for(ie in l)l.hasOwnProperty(ie)&&(m=l[ie],m!=null)&&(ie==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":Ft(r,i,ie,m,l,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<Xc.length;m++)Rt(Xc[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(me in l)if(l.hasOwnProperty(me)&&(m=l[me],m!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,me,m,l,null)}return;default:if(gn(i)){for(we in l)l.hasOwnProperty(we)&&(m=l[we],m!==void 0&&wg(r,i,we,m,l,void 0));return}}for(Q in l)l.hasOwnProperty(Q)&&(m=l[Q],m!=null&&Ft(r,i,Q,m,l,null))}function aL(r,i,l,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,me=null,we=null;for(ye in l){var Te=l[ye];if(l.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=l[ge],m.hasOwnProperty(ge)&&(ye!=null||Te!=null))switch(ge){case"type":O=ye;break;case"name":R=ye;break;case"checked":me=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)}}gc(r,N,Q,ie,me,we,O,R);return;case"select":ye=N=Q=ge=null;for(O in l)if(ie=l[O],l.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=l[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,l=N,m=ye,ge!=null?Ti(r,!!l,ge,!1):!!m!=!!l&&(i!=null?Ti(r,!!l,i,!0):Ti(r,!!l,l?[]:"",!1));return;case"textarea":ye=ge=null;for(Q in l)if(R=l[Q],l.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=l[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)}yd(r,ge,ye);return;case"option":for(var Ge in l)ge=l[Ge],l.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=l[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 ct in l)ge=l[ct],l.hasOwnProperty(ct)&&ge!=null&&!m.hasOwnProperty(ct)&&Ft(r,i,ct,null,m,ge);for(me in m)if(ge=m[me],ye=l[me],m.hasOwnProperty(me)&&ge!==ye&&(ge!=null||ye!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,i));break;default:Ft(r,i,me,ge,m,ye)}return;default:if(gn(i)){for(var Ut in l)ge=l[Ut],l.hasOwnProperty(Ut)&&ge!==void 0&&!m.hasOwnProperty(Ut)&&wg(r,i,Ut,void 0,m,ge);for(we in m)ge=m[we],ye=l[we],!m.hasOwnProperty(we)||ge===ye||ge===void 0&&ye===void 0||wg(r,i,we,ge,m,ye);return}}for(var de in l)ge=l[de],l.hasOwnProperty(de)&&ge!=null&&!m.hasOwnProperty(de)&&Ft(r,i,de,null,m,ge);for(Te in m)ge=m[Te],ye=l[Te],!m.hasOwnProperty(Te)||ge===ye||ge==null&&ye==null||Ft(r,i,Te,ge,m,ye)}function sS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lL(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),m=0;m<l.length;m++){var R=l[m],O=R.transferSize,N=R.initiatorType,Q=R.duration;if(O&&Q&&sS(N)){for(N=0,Q=R.responseEnd,m+=1;m<l.length;m++){var ie=l[m],me=ie.startTime;if(me>Q)break;var we=ie.transferSize,Te=ie.initiatorType;we&&sS(Te)&&(ie=ie.responseEnd,N+=we*(ie<Q?1:(Q-me)/(ie-me)))}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 Eg=null,Rg=null;function gf(r){return r.nodeType===9?r:r.ownerDocument}function iS(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 oS(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 kg(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 Tg=null;function cL(){var r=window.event;return r&&r.type==="popstate"?r===Tg?!1:(Tg=r,!0):(Tg=null,!1)}var aS=typeof setTimeout=="function"?setTimeout:void 0,uL=typeof clearTimeout=="function"?clearTimeout:void 0,lS=typeof Promise=="function"?Promise:void 0,dL=typeof queueMicrotask=="function"?queueMicrotask:typeof lS<"u"?function(r){return lS.resolve(null).then(r).catch(fL)}:aS;function fL(r){setTimeout(function(){throw r})}function Gi(r){return r==="head"}function cS(r,i){var l=i,m=0;do{var R=l.nextSibling;if(r.removeChild(l),R&&R.nodeType===8)if(l=R.data,l==="/$"||l==="/&"){if(m===0){r.removeChild(R),yl(i);return}m--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")m++;else if(l==="html")Zc(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,Zc(l);for(var O=l.firstChild;O;){var N=O.nextSibling,Q=O.nodeName;O[wo]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&O.rel.toLowerCase()==="stylesheet"||l.removeChild(O),O=N}}else l==="body"&&Zc(r.ownerDocument.body);l=R}while(l);yl(i)}function uS(r,i){var l=r;r=0;do{var m=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),m&&m.nodeType===8)if(l=m.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=m}while(l)}function Lg(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Lg(l),Eo(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function hL(r,i,l,m){for(;r.nodeType===1;){var R=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[wo])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=Gr(r.nextSibling),r===null)break}return null}function pL(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=Gr(r.nextSibling),r===null))return null;return r}function dS(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Gr(r.nextSibling),r===null))return null;return r}function Ag(r){return r.data==="$?"||r.data==="$~"}function Og(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function mL(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var m=function(){i(),l.removeEventListener("DOMContentLoaded",m)};l.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function Gr(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 Mg=null;function fS(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return Gr(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function hS(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function pS(r,i,l){switch(i=gf(l),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 Zc(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Eo(r)}var $r=new Map,mS=new Set;function vf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var fi=q.d;q.d={f:gL,r:vL,D:_L,C:yL,L:bL,m:SL,X:CL,S:xL,M:wL};function gL(){var r=fi.f(),i=lf();return r||i}function vL(r){var i=Ss(r);i!==null&&i.tag===5&&i.type==="form"?M1(i):fi.r(r)}var gl=typeof document>"u"?null:document;function gS(r,i,l){var m=gl;if(m&&typeof i=="string"&&i){var R=or(i);R='link[rel="'+r+'"][href="'+R+'"]',typeof l=="string"&&(R+='[crossorigin="'+l+'"]'),mS.has(R)||(mS.add(R),r={rel:r,crossOrigin:l,href:i},m.querySelector(R)===null&&(i=m.createElement("link"),Fn(i,"link",r),mn(i),m.head.appendChild(i)))}}function _L(r){fi.D(r),gS("dns-prefetch",r,null)}function yL(r,i){fi.C(r,i),gS("preconnect",r,i)}function bL(r,i,l){fi.L(r,i,l);var m=gl;if(m&&r&&i){var R='link[rel="preload"][as="'+or(i)+'"]';i==="image"&&l&&l.imageSrcSet?(R+='[imagesrcset="'+or(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(R+='[imagesizes="'+or(l.imageSizes)+'"]')):R+='[href="'+or(r)+'"]';var O=R;switch(i){case"style":O=vl(r);break;case"script":O=_l(r)}$r.has(O)||(r=f({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),$r.set(O,r),m.querySelector(R)!==null||i==="style"&&m.querySelector(Jc(O))||i==="script"&&m.querySelector(eu(O))||(i=m.createElement("link"),Fn(i,"link",r),mn(i),m.head.appendChild(i)))}}function SL(r,i){fi.m(r,i);var l=gl;if(l&&r){var m=i&&typeof i.as=="string"?i.as:"script",R='link[rel="modulepreload"][as="'+or(m)+'"][href="'+or(r)+'"]',O=R;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=_l(r)}if(!$r.has(O)&&(r=f({rel:"modulepreload",href:r},i),$r.set(O,r),l.querySelector(R)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(eu(O)))return}m=l.createElement("link"),Fn(m,"link",r),mn(m),l.head.appendChild(m)}}}function xL(r,i,l){fi.S(r,i,l);var m=gl;if(m&&r){var R=os(m).hoistableStyles,O=vl(r);i=i||"default";var N=R.get(O);if(!N){var Q={loading:0,preload:null};if(N=m.querySelector(Jc(O)))Q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},l),(l=$r.get(O))&&Dg(r,l);var ie=N=m.createElement("link");mn(ie),Fn(ie,"link",r),ie._p=new Promise(function(me,we){ie.onload=me,ie.onerror=we}),ie.addEventListener("load",function(){Q.loading|=1}),ie.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,_f(N,i,m)}N={type:"stylesheet",instance:N,count:1,state:Q},R.set(O,N)}}}function CL(r,i){fi.X(r,i);var l=gl;if(l&&r){var m=os(l).hoistableScripts,R=_l(r),O=m.get(R);O||(O=l.querySelector(eu(R)),O||(r=f({src:r,async:!0},i),(i=$r.get(R))&&Pg(r,i),O=l.createElement("script"),mn(O),Fn(O,"link",r),l.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(R,O))}}function wL(r,i){fi.M(r,i);var l=gl;if(l&&r){var m=os(l).hoistableScripts,R=_l(r),O=m.get(R);O||(O=l.querySelector(eu(R)),O||(r=f({src:r,async:!0,type:"module"},i),(i=$r.get(R))&&Pg(r,i),O=l.createElement("script"),mn(O),Fn(O,"link",r),l.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(R,O))}}function vS(r,i,l,m){var R=(R=ee.current)?vf(R):null;if(!R)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=vl(l.href),l=os(R).hoistableStyles,m=l.get(i),m||(m={type:"style",instance:null,count:0,state:null},l.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=vl(l.href);var O=os(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(Jc(r)))&&!O._p&&(N.instance=O,N.state.loading=5),$r.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},$r.set(r,l),O||EL(R,r,l,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=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=_l(l),l=os(R).hoistableScripts,m=l.get(i),m||(m={type:"script",instance:null,count:0,state:null},l.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function vl(r){return'href="'+or(r)+'"'}function Jc(r){return'link[rel="stylesheet"]['+r+"]"}function _S(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function EL(r,i,l,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}),Fn(i,"link",l),mn(i),r.head.appendChild(i))}function _l(r){return'[src="'+or(r)+'"]'}function eu(r){return"script[async]"+r}function yS(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+or(l.href)+'"]');if(m)return i.instance=m,mn(m),m;var R=f({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),mn(m),Fn(m,"style",R),_f(m,l.precedence,r),i.instance=m;case"stylesheet":R=vl(l.href);var O=r.querySelector(Jc(R));if(O)return i.state.loading|=4,i.instance=O,mn(O),O;m=_S(l),(R=$r.get(R))&&Dg(m,R),O=(r.ownerDocument||r).createElement("link"),mn(O);var N=O;return N._p=new Promise(function(Q,ie){N.onload=Q,N.onerror=ie}),Fn(O,"link",m),i.state.loading|=4,_f(O,l.precedence,r),i.instance=O;case"script":return O=_l(l.src),(R=r.querySelector(eu(O)))?(i.instance=R,mn(R),R):(m=l,(R=$r.get(O))&&(m=f({},l),Pg(m,R)),r=r.ownerDocument||r,R=r.createElement("script"),mn(R),Fn(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,_f(m,l.precedence,r));return i.instance}function _f(r,i,l){for(var m=l.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=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Dg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Pg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var yf=null;function bS(r,i,l){if(yf===null){var m=new Map,R=yf=new Map;R.set(l,m)}else R=yf,m=R.get(l),m||(m=new Map,R.set(l,m));if(m.has(r))return m;for(m.set(r,null),l=l.getElementsByTagName(r),R=0;R<l.length;R++){var O=l[R];if(!(O[wo]||O[hn]||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 SS(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function RL(r,i,l){if(l===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 xS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function kL(r,i,l,m){if(l.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var R=vl(m.href),O=i.querySelector(Jc(R));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=bf.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=O,mn(O);return}O=i.ownerDocument||i,m=_S(m),(R=$r.get(R))&&Dg(m,R),O=O.createElement("link"),mn(O);var N=O;N._p=new Promise(function(Q,ie){N.onload=Q,N.onerror=ie}),Fn(O,"link",m),l.instance=O}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=bf.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var Ig=0;function TL(r,i){return r.stylesheets&&r.count===0&&xf(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){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&&Ig===0&&(Ig=62500*lL());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>Ig?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(R)}}:null}function bf(){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 Sf=null;function xf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Sf=new Map,i.forEach(LL,r),Sf=null,bf.call(r))}function LL(r,i){if(!(i.state.loading&4)){var l=Sf.get(r);if(l)var m=l.get(null);else{l=new Map,Sf.set(r,l);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")&&(l.set(N.dataset.precedence,N),m=N)}m&&l.set(null,m)}R=i.instance,N=R.getAttribute("data-precedence"),O=l.get(N)||m,O===m&&l.set(null,R),l.set(N,R),this.count++,m=bf.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 tu={$$typeof:S,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function AL(r,i,l,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 CS(r,i,l,m,R,O,N,Q,ie,me,we,Te){return r=new AL(r,i,l,N,ie,me,we,Te,Q),i=1,O===!0&&(i|=24),O=Cr(3,null,null,i),r.current=O,O.stateNode=r,i=pm(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:l,cache:i},_m(O),r}function wS(r){return r?(r=Ya,r):Ya}function ES(r,i,l,m,R,O){R=wS(R),m.context===null?m.context=R:m.pendingContext=R,m=Ii(i),m.payload={element:l},O=O===void 0?null:O,O!==null&&(m.callback=O),l=ji(r,m,i),l!==null&&(fr(l,r,i),Dc(l,r,i))}function RS(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function jg(r,i){RS(r,i),(r=r.alternate)&&RS(r,i)}function kS(r){if(r.tag===13||r.tag===31){var i=Ao(r,67108864);i!==null&&fr(i,r,67108864),jg(r,67108864)}}function TS(r){if(r.tag===13||r.tag===31){var i=Tr();i=Kn(i);var l=Ao(r,i);l!==null&&fr(l,r,i),jg(r,i)}}var Cf=!0;function OL(r,i,l,m){var R=V.T;V.T=null;var O=q.p;try{q.p=2,Ng(r,i,l,m)}finally{q.p=O,V.T=R}}function ML(r,i,l,m){var R=V.T;V.T=null;var O=q.p;try{q.p=8,Ng(r,i,l,m)}finally{q.p=O,V.T=R}}function Ng(r,i,l,m){if(Cf){var R=Bg(m);if(R===null)Cg(r,i,m,wf,l),AS(r,m);else if(PL(R,r,i,l,m))m.stopPropagation();else if(AS(r,m),i&4&&-1<DL.indexOf(r)){for(;R!==null;){var O=Ss(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-rt(N);Q.entanglements[1]|=ie,N&=~ie}Es(O),(Pt&6)===0&&(of=xe()+500,Yc(0))}}break;case 31:case 13:Q=Ao(O,2),Q!==null&&fr(Q,O,2),lf(),jg(O,2)}if(O=Bg(m),O===null&&Cg(r,i,m,wf,l),O===R)break;R=O}R!==null&&m.stopPropagation()}else Cg(r,i,m,null,l)}}function Bg(r){return r=Hp(r),zg(r)}var wf=null;function zg(r){if(wf=null,r=Gs(r),r!==null){var i=u(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=h(i),r!==null)return r;r=null}else if(l===31){if(r=a(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return wf=r,null}function LS(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(Re()){case Ue:return 2;case nt:return 8;case He:case st:return 32;case et:return 268435456;default:return 32}default:return 32}}var Hg=!1,$i=null,Ki=null,Yi=null,nu=new Map,ru=new Map,Xi=[],DL="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 AS(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":nu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ru.delete(i.pointerId)}}function su(r,i,l,m,R,O){return r===null||r.nativeEvent!==O?(r={blockedOn:i,domEventName:l,eventSystemFlags:m,nativeEvent:O,targetContainers:[R]},i!==null&&(i=Ss(i),i!==null&&kS(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,R!==null&&i.indexOf(R)===-1&&i.push(R),r)}function PL(r,i,l,m,R){switch(i){case"focusin":return $i=su($i,r,i,l,m,R),!0;case"dragenter":return Ki=su(Ki,r,i,l,m,R),!0;case"mouseover":return Yi=su(Yi,r,i,l,m,R),!0;case"pointerover":var O=R.pointerId;return nu.set(O,su(nu.get(O)||null,r,i,l,m,R)),!0;case"gotpointercapture":return O=R.pointerId,ru.set(O,su(ru.get(O)||null,r,i,l,m,R)),!0}return!1}function OS(r){var i=Gs(r.target);if(i!==null){var l=u(i);if(l!==null){if(i=l.tag,i===13){if(i=h(l),i!==null){r.blockedOn=i,za(r.priority,function(){TS(l)});return}}else if(i===31){if(i=a(l),i!==null){r.blockedOn=i,za(r.priority,function(){TS(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ef(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Bg(r.nativeEvent);if(l===null){l=r.nativeEvent;var m=new l.constructor(l.type,l);bd=m,l.target.dispatchEvent(m),bd=null}else return i=Ss(l),i!==null&&kS(i),r.blockedOn=l,!1;i.shift()}return!0}function MS(r,i,l){Ef(r)&&l.delete(i)}function IL(){Hg=!1,$i!==null&&Ef($i)&&($i=null),Ki!==null&&Ef(Ki)&&(Ki=null),Yi!==null&&Ef(Yi)&&(Yi=null),nu.forEach(MS),ru.forEach(MS)}function Rf(r,i){r.blockedOn===i&&(r.blockedOn=null,Hg||(Hg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,IL)))}var kf=null;function DS(r){kf!==r&&(kf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kf===r&&(kf=null);for(var i=0;i<r.length;i+=3){var l=r[i],m=r[i+1],R=r[i+2];if(typeof m!="function"){if(zg(m||l)===null)continue;break}var O=Ss(l);O!==null&&(r.splice(i,3),i-=3,Bm(O,{pending:!0,data:R,method:l.method,action:m},m,R))}}))}function yl(r){function i(ie){return Rf(ie,r)}$i!==null&&Rf($i,r),Ki!==null&&Rf(Ki,r),Yi!==null&&Rf(Yi,r),nu.forEach(i),ru.forEach(i);for(var l=0;l<Xi.length;l++){var m=Xi[l];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Xi.length&&(l=Xi[0],l.blockedOn===null);)OS(l),l.blockedOn===null&&Xi.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(m=0;m<l.length;m+=3){var R=l[m],O=l[m+1],N=R[pn]||null;if(typeof O=="function")N||DS(l);else if(N){var Q=null;if(O&&O.hasAttribute("formAction")){if(R=O,N=O[pn]||null)Q=N.formAction;else if(zg(R)!==null)continue}else Q=N.action;typeof Q=="function"?l[m+1]=Q:(l.splice(m,3),m-=3),DS(l)}}}function PS(){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(l,20)}function l(){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(l,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),R!==null&&(R(),R=null)}}}function Vg(r){this._internalRoot=r}Tf.prototype.render=Vg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var l=i.current,m=Tr();ES(l,m,r,i,null,null)},Tf.prototype.unmount=Vg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;ES(r.current,2,null,r,null,null),lf(),i[bs]=null}};function Tf(r){this._internalRoot=r}Tf.prototype.unstable_scheduleHydration=function(r){if(r){var i=ys();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Xi.length&&i!==0&&i<Xi[l].priority;l++);Xi.splice(l,0,r),l===0&&OS(r)}};var IS=t.version;if(IS!=="19.2.3")throw Error(s(527,IS,"19.2.3"));q.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 jL={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lf.isDisabled&&Lf.supportsFiber)try{$e=Lf.inject(jL),ue=Lf}catch{}}return ou.createRoot=function(r,i){if(!o(r))throw Error(s(299));var l=!1,m="",R=F1,O=U1,N=W1;return i!=null&&(i.unstable_strictMode===!0&&(l=!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=CS(r,1,!1,null,null,l,m,null,R,O,N,PS),r[bs]=i.current,xg(r),new Vg(i)},ou.hydrateRoot=function(r,i,l){if(!o(r))throw Error(s(299));var m=!1,R="",O=F1,N=U1,Q=W1,ie=null;return l!=null&&(l.unstable_strictMode===!0&&(m=!0),l.identifierPrefix!==void 0&&(R=l.identifierPrefix),l.onUncaughtError!==void 0&&(O=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(Q=l.onRecoverableError),l.formState!==void 0&&(ie=l.formState)),i=CS(r,1,!0,i,l??null,m,R,ie,O,N,Q,PS),i.context=wS(null),l=i.current,m=Tr(),m=Kn(m),R=Ii(m),R.callback=null,ji(l,R,m),l=m,i.current.lanes=l,bt(i,l),Es(i),r[bs]=i.current,xg(r),new Tf(i)},ou.version="19.2.3",ou}var qS;function GL(){if(qS)return Wg.exports;qS=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(),Wg.exports=qL(),Wg.exports}var $L=GL();const Bv=new WeakMap,KL=new WeakMap,vh={current:[]};let Kg=!1,bu=0;const gu=new Set,Af=new Map;function Ow(e){for(const t of e){if(vh.current.includes(t))continue;vh.current.push(t),t.recompute();const n=KL.get(t);if(n)for(const s of n){const o=Bv.get(s);o?.length&&Ow(o)}}}function YL(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function XL(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Mw(e){if(bu>0&&!Af.has(e)&&Af.set(e,e.prevState),gu.add(e),!(bu>0)&&!Kg)try{for(Kg=!0;gu.size>0;){const t=Array.from(gu);gu.clear();for(const n of t){const s=Af.get(n)??n.prevState;n.prevState=s,YL(n)}for(const n of t){const s=Bv.get(n);s&&(vh.current.push(n),Ow(s))}for(const n of t){const s=Bv.get(n);if(s)for(const o of s)XL(o)}}}finally{Kg=!1,vh.current=[],Af.clear()}}function Su(e){bu++;try{e()}finally{if(bu--,bu===0){const t=gu.values().next().value;t&&Mw(t)}}}function QL(e){return typeof e=="function"}let ZL=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):QL(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Mw(this)}};const oo="__TSR_index",GS="popstate",$S="beforeunload";function JL(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,...c})=>{if(a?.ignoreBlocker??!1){h();return}const p=e.getBlockers?.()??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const b=_h(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:b,action:c.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,c)=>{const d=t.state[oo];a=KS(d+1,a),u({task:()=>{e.pushState(h,a),s({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:h,state:a})},replace:(h,a,c)=>{const d=t.state[oo];a=KS(d,a),u({task:()=>{e.replaceState(h,a),s({type:"REPLACE"})},navigateOpts:c,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 c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(d=>d!==h))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function KS(e,t){t||(t={});const n=A_();return{...t,key:n,__TSR_key:n,[oo]:e}}function eA(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),c=(()=>_h(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=A_();t.history.replaceState({[oo]:0,key:L,__TSR_key:L},"")}let d=c(),p,f=!1,g=!1,b=!1,w=!1;const C=()=>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)},S=(L,D,U)=>{const z=a(D);y||(p=d),d=_h(D,U),_={href:z,state:U,isPush:_?.isPush||L==="push"},y||(y=Promise.resolve().then(()=>v()))},E=L=>{d=c(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=c(),D=L.state[oo]-d.state[oo],U=D===1,z=D===-1,W=!U&&!z||f;f=!1;const j=W?"GO":z?"BACK":"FORWARD",Y=W?{type:"GO",index:D}:{type:z?"BACK":"FORWARD"};if(b)b=!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(Y);return}}}d=c(),M.notify(Y)},A=L=>{if(w){w=!1;return}let D=!1;const U=u();if(typeof document<"u"&&U.length)for(const z of U){const W=z.enableBeforeUnload??!0;if(W===!0){D=!0;break}if(typeof W=="function"&&W()===!0){D=!0;break}}if(D)return L.preventDefault(),L.returnValue=""},M=JL({getLocation:C,getLength:()=>t.history.length,pushState:(L,D)=>S("push",L,D),replaceState:(L,D)=>S("replace",L,D),back:L=>(L&&(b=!0),w=!0,t.history.back()),forward:L=>{L&&(b=!0),w=!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($S,A,{capture:!0}),t.removeEventListener(GS,T)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:u,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener($S,A,{capture:!0}),t.addEventListener(GS,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 _h(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=A_();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 A_(){return(Math.random()+1).toString(36).substring(7)}function yh(e){return e[e.length-1]}function tA(e){return typeof e=="function"}function no(e,t){return tA(e)?e(t):e}const nA=Object.prototype.hasOwnProperty;function Xr(e,t){if(e===t)return e;const n=t,s=QS(e)&&QS(n);if(!s&&!(bh(e)&&bh(n)))return n;const o=s?e:YS(e);if(!o)return n;const u=s?n:YS(n);if(!u)return n;const h=o.length,a=u.length,c=s?new Array(a):{};let d=0;for(let p=0;p<a;p++){const f=s?p:u[p],g=e[f],b=n[f];if(g===b){c[f]=g,(s?p<h:nA.call(e,f))&&d++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){c[f]=b;continue}const w=Xr(g,b);c[f]=w,w===g&&d++}return h===a&&d===h?e:c}function YS(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 bh(e){if(!XS(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!XS(n)||!n.hasOwnProperty("isPrototypeOf"))}function XS(e){return Object.prototype.toString.call(e)==="[object Object]"}function QS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aa(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(!aa(e[s],t[s],n))return!1;return!0}if(bh(e)&&bh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const h in t)if((!s||t[h]!==void 0)&&!aa(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||!aa(e[h],t[h],n)))return!1;return o===u}return!1}function Bl(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 ZS(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function JS(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,o="",u;for(;(u=n.exec(e))!==null;)o+=ZS(e.slice(s,u.index))+u[0],s=n.lastIndex;return o+ZS(s?e.slice(s):e)}var rA="Invariant failed";function yi(e,t){if(!e)throw new Error(rA)}function Sh(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 c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===s&&(s=void 0)}const a=t.get(u);if(a)a.value=h,o(a);else{const c={key:u,value:h,prev:s};s&&(s.next=c),s=c,n||(n=c),t.set(u,c)}},clear(){t.clear(),n=void 0,s=void 0}}}const zl=0,_a=1,ya=2,ku=3,sA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,iA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,oA=/^([^{]*)\{\$\}([^}]*)$/;function O_(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]=zl,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]=ya,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=_a,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const h=u.match(oA);if(h){const p=h[1].length;return n[0]=ya,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(iA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=ku,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 c=u.match(sA);if(c){const d=c[1],p=c[2],f=c[3],g=d.length;return n[0]=_a,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]=zl,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 c=n.fullPath??n.from,d=c.length,p=n.options?.caseSensitive??e;for(;a<d;){const f=O_(c,a,t);let g;const b=a,w=f[5];switch(a=w+1,u++,f[0]){case zl:{const _=c.substring(f[2],f[3]);if(p){const y=o.static?.get(_);if(y)g=y;else{o.static??=new Map;const v=Tu(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 S=Tu(n.fullPath??n.from);S.parent=o,S.depth=u,g=S,o.staticInsensitive.set(y,S)}}break}case _a:{const _=c.substring(b,f[1]),y=c.substring(f[4],w),v=p&&!!(_||y),S=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===v&&A.prefix===S&&A.suffix===E);if(T)g=T;else{const A=Xg(_a,n.fullPath??n.from,v,S,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case ku:{const _=c.substring(b,f[1]),y=c.substring(f[4],w),v=p&&!!(_||y),S=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===v&&A.prefix===S&&A.suffix===E);if(T)g=T;else{const A=Xg(ku,n.fullPath??n.from,v,S,E);g=A,A.parent=o,A.depth=u,o.optional??=[],o.optional.push(A)}break}case ya:{const _=c.substring(b,f[1]),y=c.substring(f[4],w),v=p&&!!(_||y),S=_?v?_:_.toLowerCase():void 0,E=y?v?y:y.toLowerCase():void 0,T=Xg(ya,n.fullPath??n.from,v,S,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=c.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 c of n.children)tp(e,t,c,a,o,u,h)}function Yg(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 Xo(e){if(e.static)for(const t of e.static.values())Xo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Xo(t);if(e.dynamic?.length){e.dynamic.sort(Yg);for(const t of e.dynamic)Xo(t)}if(e.optional?.length){e.optional.sort(Yg);for(const t of e.optional)Xo(t)}if(e.wildcard?.length){e.wildcard.sort(Yg);for(const t of e.wildcard)Xo(t)}}function Tu(e){return{kind:zl,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Xg(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 aA(e,t){const n=Tu("/"),s=new Uint16Array(6);for(const o of e)tp(!1,s,o,1,n,0);Xo(n),t.masksTree=n,t.flatCache=Sh(1e3)}function lA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=M_(e,t.masksTree);return t.flatCache.set(e,s),s}function cA(e,t,n,s,o){e||="/",s||="/";const u=t?`case\0${e}`:e;let h=o.singleCache.get(u);if(!h){h=Tu("/");const a=new Uint16Array(6);tp(t,a,{from:e},1,h,0),o.singleCache.set(u,h)}return M_(s,h,n)}function uA(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=M_(e,t.segmentTree,n);return u&&(u.branch=pA(u.route)),t.matchCache.set(s,u),u}function dA(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function fA(e,t=!1,n){const s=Tu(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=dA(d.fullPath);(!h[p]||d.fullPath.endsWith("/"))&&(h[p]=d)}a++}),Xo(s),{processedTree:{segmentTree:s,singleCache:Sh(1e3),matchCache:Sh(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:h}}function M_(e,t,n=!1){const s=e.split("/"),o=gA(e,s,t,n);if(!o)return null;const u=hA(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function hA(e,t,n){const s=mA(n.node);let o=null;const u={};for(let h=0,a=0,c=0;a<s.length;h++,a++,c++){const d=s[a],p=t[h],f=c;if(p&&(c+=p.length),d.kind===_a){o??=n.node.fullPath.split("/");const g=o[a],b=d.prefix?.length??0;if(g.charCodeAt(b)===123){const C=d.suffix?.length??0,_=g.substring(b+2,g.length-C-1),y=p.substring(b,p.length-C);u[_]=decodeURIComponent(y)}else{const C=g.substring(1);u[C]=decodeURIComponent(p)}}else if(d.kind===ku){if(n.skipped&1<<a){h--;continue}o??=n.node.fullPath.split("/");const g=o[a],b=d.prefix?.length??0,w=d.suffix?.length??0,C=g.substring(b+3,g.length-w-1),_=d.suffix||d.prefix?p.substring(b,p.length-w):p;_&&(u[C]=decodeURIComponent(_))}else if(d.kind===ya){const g=d,b=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),w=decodeURIComponent(b);u["*"]=w,u._splat=w;break}}return u}function pA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function mA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function gA(e,t,n,s){const o=!yh(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 c=null,d=null,p=null;for(;a.length;){const f=a.pop();let{node:g,index:b,skipped:w,depth:C,statics:_,dynamics:y,optionals:v}=f;s&&g.notFound&&Of(d,f)&&(d=f);const S=b===h;if(S){if(g.route&&(!u||g.isIndex)&&(Of(p,f)&&(p=f),_===h&&g.isIndex))return p;if(!g.optional&&!g.wildcard)continue}const E=S?void 0:t[b];let T;if(g.wildcard&&Of(c,f))for(const A of g.wildcard){const{prefix:M,suffix:L}=A;if(!(M&&(S||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(S)continue;const D=t.slice(b).join("/").slice(-L.length);if((A.caseSensitive?D:D.toLowerCase())!==L)continue}c={node:A,index:b,skipped:w,depth:C,statics:_,dynamics:y,optionals:v};break}}if(g.optional){const A=w|1<<C,M=C+1;for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L];a.push({node:D,index:b,skipped:A,depth:M,statics:_,dynamics:y,optionals:v})}if(!S)for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L],{prefix:U,suffix:z}=D;if(U||z){const W=D.caseSensitive?E:T??=E.toLowerCase();if(U&&!W.startsWith(U)||z&&!W.endsWith(z))continue}a.push({node:D,index:b+1,skipped:w,depth:M,statics:_,dynamics:y,optionals:v+1})}}if(!S&&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 U=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!U.startsWith(L)||D&&!U.endsWith(D))continue}a.push({node:M,index:b+1,skipped:w,depth:C+1,statics:_,dynamics:y+1,optionals:v})}if(!S&&g.staticInsensitive){const A=g.staticInsensitive.get(T??=E.toLowerCase());A&&a.push({node:A,index:b+1,skipped:w,depth:C+1,statics:_+1,dynamics:y,optionals:v})}if(!S&&g.static){const A=g.static.get(E);A&&a.push({node:A,index:b+1,skipped:w,depth:C+1,statics:_+1,dynamics:y,optionals:v})}}if(p&&c)return Of(c,p)?p:c;if(p)return p;if(c)return c;if(s&&d){let f=d.index;for(let b=0;b<d.index;b++)f+=t[b].length;const g=f===e.length?"/":e.slice(f);return{node:d.node,skipped:d.skipped,"**":decodeURIComponent(g)}}return null}function Of(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 ch(e){return D_(e.filter(t=>t!==void 0).join("/"))}function D_(e){return e.replace(/\/{2,}/g,"/")}function Dw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function la(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Pw(e){return la(Dw(e))}function xh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function vA(e,t,n){return xh(e,n)===xh(t,n)}function _A({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&&yh(a)==="";)a.pop();const f=t.split("/");for(let g=0,b=f.length;g<b;g++){const w=f[g];w===""?g?g===b-1&&a.push(w):a=[w]:w===".."?a.pop():w==="."||a.push(w)}}a.length>1&&(yh(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,d="";for(let f=0;f<a.length;f++){f>0&&(d+="/");const g=a[f];if(!g)continue;c=O_(g,0,c);const b=c[0];if(b===zl){d+=g;continue}const w=c[5],C=g.substring(0,c[1]),_=g.substring(c[4],w),y=g.substring(c[2],c[3]);b===_a?d+=C||_?`${C}{$${y}}${_}`:`$${y}`:b===ya?d+=C||_?`${C}{$}${_}`:"$":d+=`${C}{-$${y}}${_}`}d=D_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function Qg(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):yA(s,n)}function Zg({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,c="";for(;h<u;){const p=h;a=O_(e,p,a);const f=a[5];if(h=f+1,p===f)continue;const g=a[0];if(g===zl){c+="/"+e.substring(p,f);continue}if(g===ya){const b=t._splat;o._splat=b,o["*"]=b;const w=e.substring(p,a[1]),C=e.substring(a[4],f);if(!b){s=!0,(w||C)&&(c+="/"+w+C);continue}const _=Qg("_splat",t,n);c+="/"+w+_+C;continue}if(g===_a){const b=e.substring(a[2],a[3]);!s&&!(b in t)&&(s=!0),o[b]=t[b];const w=e.substring(p,a[1]),C=e.substring(a[4],f),_=Qg(b,t,n)??"undefined";c+="/"+w+_+C;continue}if(g===ku){const b=e.substring(a[2],a[3]),w=t[b];if(w==null)continue;o[b]=w;const C=e.substring(p,a[1]),_=e.substring(a[4],f),y=Qg(b,t,n)??"";c+="/"+C+y+_;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:o,interpolatedPath:c||"/",isMissingParams:s}}function yA(e,t){let n=encodeURIComponent(e);if(t)for(const[s,o]of t)n=n.replaceAll(s,o);return n}function ns(e){return!!e?.isNotFound}function bA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ch="tsr-scroll-restoration-v1_3",SA=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function xA(){const e=bA();if(!e)return null;const t=e.getItem(Ch);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=no(s,n)||n,e.setItem(Ch,JSON.stringify(n)))}}const Mf=xA(),zv=e=>e.state.__TSR_key||e.href;function CA(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 wh=!1;function Iw({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,c=h[a];wh=!0;e:{if(s&&c&&Object.keys(c).length>0){for(const f in c){const g=c[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const b=document.querySelector(f);b&&(b.scrollLeft=g.scrollX,b.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)}}wh=!1}function wA(e,t){if(!Mf&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Mf))return;e.isScrollRestorationSetup=!0,wh=!1;const s=e.options.getScrollRestorationKey||zv;window.history.scrollRestoration="manual";const o=u=>{if(wh||!e.isScrollRestoring)return;let h="";if(u.target===document||u.target===window)h="window";else{const c=u.target.getAttribute("data-scroll-restoration-id");c?h=`[data-scroll-restoration-id="${c}"]`:h=CA(u.target)}const a=s(e.state.location);Mf.set(c=>{const d=c[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 c})};typeof document<"u"&&document.addEventListener("scroll",SA(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})||(Iw({storageKey:Ch,key:h,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Mf.set(a=>(a[h]||={},a)))})}function EA(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 RA(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 Jg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function kA(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=Jg(o):Array.isArray(u)?u.push(Jg(o)):n[s]=[u,Jg(o)]}return n}const TA=AA(JSON.parse),LA=OA(JSON.stringify,JSON.parse);function AA(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=kA(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function OA(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=RA(o,s);return u?`?${u}`:""}}const Ar="__root__";function jw(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 ms(e){return e instanceof Response&&!!e.options}const uh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},np=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),P_=(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},Nw=(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,Nw(e,t))},ro=(e,t,n)=>{if(!(!ms(n)&&!ns(n))){if(ms(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=ms(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,isFetching:!1,error:n})),ns(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ms(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Nw(e,n),n)}},Bw=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},au=(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,ro(e,e.router.getMatch(o),n);try{h.options.onError?.(n)}catch(a){n=a,ro(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}))},MA=(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===Ar;return}if(h?.ssr===!1){o.ssr=!1;return}const a=b=>b===!0&&h?.ssr==="data-only"?"data-only":b,c=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(c);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:d,params:p}=o,f={search:Df(d,o.searchError),params:Df(p,o.paramsError),location:e.location,matches:e.matches.map(b=>({index:b.index,pathname:b.pathname,fullPath:b.fullPath,staticData:b.staticData,id:b.id,routeId:b.routeId,search:Df(b.search,b.searchError),params:Df(b.params,b.paramsError),ssr:b.ssr}))},g=s.options.ssr(f);if(ao(g))return g.then(b=>{o.ssr=a(b??c)});o.ssr=a(g??c)},zw=(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||Fw(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{uh(e)},o);s._nonReactive.pendingTimeout=h}},DA=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;zw(e,t,n,s);const o=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&ro(e,u,u.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},PA=(e,t,n,s)=>{const o=e.router.getMatch(t),u=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Bl(()=>{u?.resolve()});const{paramsError:h,searchError:a}=o;h&&au(e,n,h,"PARSE_PARAMS"),a&&au(e,n,a,"VALIDATE_SEARCH"),zw(e,t,s,o);const c=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:c})))},b=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!s.options.beforeLoad){Su(()=>{g(),b()});return}o._nonReactive.beforeLoadPromise=Bl();const w={...P_(e,n,!1),...o.__routeContext},{search:C,params:_,cause:y}=o,v=np(e,t),S={search:C,abortController:c,params:_,preload:v,context:w,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){Su(()=>{g(),b()});return}(ms(A)||ns(A))&&(g(),au(e,n,A,"BEFORE_LOAD")),Su(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:A})),b()})};let T;try{if(T=s.options.beforeLoad(S),ao(T))return g(),T.catch(A=>{au(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){g(),au(e,n,A,"BEFORE_LOAD")}E(T)},IA=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const c=MA(e,n,t,o);if(ao(c))return c.then(a)}return a()},h=()=>PA(e,n,t,o),a=()=>{if(Bw(e,n))return;const c=DA(e,n,o);return ao(c)?c.then(h):h()};return u()},xu=(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 c=u?.meta,d=u?.links,p=u?.scripts,f=u?.styles;return{meta:c,links:d,headScripts:p,headers:a,scripts:h,styles:f}})},Hw=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:c}=e.router.getMatch(t),d=P_(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":c,route:s,...e.router.options.additionalContext}},ex=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!e.router.isServer||o.ssr===!0)&&Vw(s);const u=s.options.loader?.(Hw(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;ro(e,e.router.getMatch(t),f),f!==void 0&&e.updateMatch(t,g=>({...g,loaderData:f}))}s._lazyPromise&&await s._lazyPromise;const c=xu(e,t,s),d=c?await c: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,ns(u)&&await s.options.notFoundComponent?.preload?.(),ro(e,e.router.getMatch(t),u);try{s.options.onError?.(u)}catch(p){h=p,ro(e,e.router.getMatch(t),p)}const c=xu(e,t,s),d=c?await c: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=xu(e,t,s);if(h){const a=await h;e.updateMatch(t,c=>({...c,...a}))}u._nonReactive.loaderPromise=void 0}ro(e,u,o)}},jA=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:P_(e,t)}))};if(Bw(e,n)){if(e.router.isServer){const p=xu(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&&ro(e,f,g)}else{const f=Date.now()-p.updatedAt,g=np(e,n),b=g?h.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:h.options.staleTime??e.router.options.defaultStaleTime??0,w=h.options.shouldReload,C=typeof w=="function"?w(Hw(e,n,t,h)):w,_=!!g&&!e.router.state.matches.some(E=>E.id===n),y=e.router.getMatch(n);y._nonReactive.loaderPromise=Bl(),_!==y.preload&&e.updateMatch(n,E=>({...E,preload:_}));const{status:v,invalid:S}=y;if(o=v==="success"&&(S||(C??f>b)),!(g&&h.options.preload===!1))if(o&&!e.sync)u=!0,(async()=>{try{await ex(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){ms(E)&&await e.router.navigate(E.options)}})();else if(v!=="success"||o&&e.sync)await ex(e,n,t,h);else{const E=xu(e,n,h);if(E){const T=await E;e.updateMatch(n,A=>({...A,...T}))}}}}const c=e.router.getMatch(n);u||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,u||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0,u||a();const d=u?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:d,invalid:!1})),e.router.getMatch(n)):c};async function tx(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&uh(t);try{for(let o=0;o<t.matches.length;o++){const u=IA(t,o);ao(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(jA(t,o));await Promise.all(t.matchPromises);const s=uh(t);ao(s)&&await s}catch(n){if(ns(n)&&!t.preload){const s=uh(t);throw ao(s)&&await s,n}if(ms(n))throw n}return t.matches}async function Vw(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 Uw){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 Df(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function Fw(e){for(const t of Uw)if(e.options[t]?.preload)return!0;return!1}const Uw=["component","errorComponent","pendingComponent","notFoundComponent"];function NA(e){return{input:({url:t})=>{for(const n of e)t=Ww(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=qw(e[n],t);return t}}}function BA(e){const t=Pw(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=ch(["/",t,h.pathname]),h)}}function Ww(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 qw(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 ca(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 zA{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=eA())),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 ZL(VA(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),wA(this));let a=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==c||h!==d){this.basepath=c;const g=[];Pw(c)!==""&&g.push(BA({basepath:c})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:NA(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}=fA(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&aA(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:c,state:d})=>{const p=new URL(c,this.origin),f=Ww(this.rewrite,p),g=this.options.parseSearch(f.search),b=this.options.stringifySearch(g);return f.search=b,{href:f.href.replace(f.origin,""),publicHref:c,url:f,pathname:JS(f.pathname),searchStr:b,search:Xr(s?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:Xr(s?.state,d)}},u=o(n),{__tempLocation:h,__tempKey:a}=u.state;if(h&&(!a||a===this.tempLocationKey)){const c=o(h);return c.state.key=u.state.key,c.state.__TSR_key=u.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:u}}return u},this.resolvePathCache=Sh(1e3),this.resolvePathWithBase=(n,s)=>_A({base:n,to:D_(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=>FA({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}),c=yh(a);u.from;const d=u.unsafeRelative==="path"?h.pathname:u.from??c.fullPath,p=this.resolvePathWithBase(d,"."),f=c.search,g={...c.params},b=u.to?this.resolvePathWithBase(p,`${u.to}`):this.resolvePathWithBase(p,"."),w=u.params===!1||u.params===null?{}:(u.params??!0)===!0?g:Object.assign(g,no(u.params,g)),C=Zg({path:b,params:w}).interpolatedPath,_=this.matchRoutes(C,void 0,{_buildLocation:!0}).map(U=>this.looseRoutesById[U.routeId]);if(Object.keys(w).length>0)for(const U of _){const z=U.options.params?.stringify??U.options.stringifyParams;z&&Object.assign(w,z(w))}const y=n.leaveParams?b:JS(Zg({path:b,params:w,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const U={};_.forEach(z=>{if(z.options.validateSearch)try{Object.assign(U,Hv(z.options.validateSearch,{...U,...v}))}catch{}}),v=U}v=UA({search:v,dest:u,destRoutes:_,_includeValidateSearch:n._includeValidateSearch}),v=Xr(f,v);const S=this.options.stringifySearch(v),E=u.hash===!0?h.hash:u.hash?no(u.hash,h.hash):void 0,T=E?`#${E}`:"";let A=u.state===!0?h.state:u.state?no(u.state,h.state):{};A=Xr(h.state,A);const M=`${y}${S}${T}`,L=new URL(M,this.origin),D=qw(this.rewrite,L);return{publicHref:D.pathname+D.search+D.hash,href:M,url:D,pathname:y,search:v,searchStr:S,state:A,hash:E??"",unmaskOnReload:u.unmaskOnReload}},o=(u={},h)=>{const a=s(u);let c=h?s(h):void 0;if(!c){const d={};if(this.options.routeMasks){const p=lA(a.pathname,this.processedTree);if(p){Object.assign(d,p.params);const{from:f,params:g,...b}=p.route,w=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,no(g,d));h={from:n.from,...b,params:w},c=s(h)}}}return c&&(a.maskedLocation=c),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:s,...o})=>{const u=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const d=aa(o.state,this.latestLocation.state);return c.forEach(p=>{delete o.state[p]}),d},h=la(this.latestLocation.href)===la(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Bl(()=>{a?.resolve()}),h&&u())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,url:p,...f}=o;c&&(f={...c,state:{...c.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,...c}={})=>{if(a){const f=this.history.location.state.__TSR_index,g=_h(a,{__TSR_index:n?f:f+1});c.to=g.pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const d=this.buildLocation({...c,_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 c of a)if(c?.blockerFn&&await c.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 jw({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 c=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ca({resolvedLocation:d,location:c})}),this.emit({type:"onBeforeLoad",...ca({resolvedLocation:d,location:c})}),await tx({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];Su(()=>{this.__store.setState(b=>{const w=b.matches,C=b.pendingMatches||b.matches;return p=w.filter(_=>!C.some(y=>y.id===_.id)),f=C.filter(_=>!w.some(y=>y.id===_.id)),g=C.filter(_=>w.some(y=>y.id===_.id)),{...b,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...b.cachedMatches,...p.filter(_=>_.status!=="error"&&_.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([b,w])=>{b.forEach(C=>{this.looseRoutesById[C.routeId].options[w]?.(C)})})})})}})}catch(c){ms(c)?(s=c,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):ns(c)&&(o=c),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(ca({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=Vw,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)]);Su(()=>{o.forEach(a=>{h.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return o=await tx({router:this,matches:o,location:s,preload:!0,updateMatch:(a,c)=>{u.has(a)?o=o.map(d=>d.id===a?c(d):d):this.updateMatch(a,c)}}),o}catch(a){if(ms(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});ns(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,c=cA(u.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!aa(c.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?aa(a.search,u.search,{partial:!0})?c.params:!1:c.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??LA,parseSearch:t.parseSearch??TA}),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["**"]:la(t.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:a=!0);const c=(()=>{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 Ar}})(),d=[],p=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((f,g)=>{const b=d[g-1],[w,C,_]=(()=>{const j=b?.search??t.search,Y=b?._strictSearch??void 0;try{const $=Hv(f.options.validateSearch,{...j})??void 0;return[{...j,...$},{...Y,...$},void 0]}catch($){let V=$;if($ instanceof Eh||(V=new Eh($.message,{cause:$})),n?.throwOnError)throw V;return[j,{},V]}})(),y=f.options.loaderDeps?.({search:w})??"",v=y?JSON.stringify(y):"",{interpolatedPath:S,usedParams:E}=Zg({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+S+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(Y){if(ns(Y)||ms(Y)?D=Y:D=new HA(Y.message,{cause:Y}),n?.throwOnError)throw D}}Object.assign(u,L);const U=M?"stay":"enter";let z;if(A)z={...A,cause:U,params:M?Xr(M.params,u):u,_strictParams:L,search:Xr(M?M.search:A.search,w),_strictSearch:C};else{const j=f.options.loader||f.options.beforeLoad||f.lazyFn||Fw(f)?"pending":"success";z={id:T,ssr:this.isServer?void 0:f.options.ssr,index:g,routeId:f.id,params:M?Xr(M.params,u):u,_strictParams:L,pathname:S,updatedAt:Date.now(),search:M?Xr(M.search,w):w,_strictSearch:C,searchError:void 0,status:j,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Bl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:M?Xr(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=c===f.id),z.searchError=_;const W=p(b);z.context={...W,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((f,g)=>{const b=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)&&n?._buildLocation!==!0){const C=d[g-1],_=p(C);if(b.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=b.options.context(y)??void 0}f.context={..._,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class Eh extends Error{}class HA extends Error{}function VA(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Hv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Eh("Async validation not supported");if(n.issues)throw new Eh(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 FA({pathname:e,routesById:t,processedTree:n}){const s={},o=la(e);let u;const h=uA(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Ar]],routeParams:s,foundRoute:u}}function UA({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){const o=n.reduce((a,c)=>{const d=[];if("search"in c.options)c.options.search?.middlewares&&d.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const p=({search:f,next:g})=>{let b=f;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(b=c.options.preSearchFilters.reduce((C,_)=>_(C),f));const w=g(b);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((C,_)=>_(C),w):w};d.push(p)}if(s&&c.options.validateSearch){const p=({search:f,next:g})=>{const b=g(f);try{return{...b,...Hv(c.options.validateSearch,b)??void 0}}catch{return b}};d.push(p)}return a.concat(d)},[])??[],u=({search:a})=>t.search?t.search===!0?a:no(t.search,a):{};o.push(u);const h=(a,c)=>{if(a>=o.length)return c;const d=o[a];return d({search:c,next:f=>h(a+1,f)})};return h(0,e)}const WA="Error preloading route! ☝️";class Gw{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=Ar:this.parentRoute||yi(!1);let u=o?Ar:s?.path;u&&u!=="/"&&(u=Dw(u));const h=s?.id||u;let a=o?Ar:ch([this.parentRoute.id===Ar?"":this.parentRoute.id,h]);u===Ar&&(u="/"),a!==Ar&&(a=ch(["/",a]));const c=a===Ar?"/":ch([this.parentRoute.fullPath,u]);this._path=u,this._id=a,this._fullPath=c,this._to=c},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 qA extends Gw{constructor(t){super(t)}}function I_(e){const t=e.errorComponent??rp;return x.jsx(GA,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?k.createElement(t,{error:n,reset:s}):e.children})}class GA 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 x.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[x.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[x.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),x.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"})]}),x.jsx("div",{style:{height:".25rem"}}),t?x.jsx("div",{children:x.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?x.jsx("code",{children:e.message}):null})}):null]})}function $A({children:e,fallback:t=null}){return KA()?x.jsx(Ie.Fragment,{children:e}):x.jsx(Ie.Fragment,{children:t})}function KA(){return Ie.useSyncExternalStore(YA,()=>!0,()=>!1)}function YA(){return()=>{}}var ev={exports:{}},tv={},nv={exports:{}},rv={};var nx;function XA(){if(nx)return rv;nx=1;var e=Wu();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 b=g(),w=s({inst:{value:b,getSnapshot:g}}),C=w[0].inst,_=w[1];return u(function(){C.value=b,C.getSnapshot=g,c(C)&&_({inst:C})},[f,b,g]),o(function(){return c(C)&&_({inst:C}),f(function(){c(C)&&_({inst:C})})},[f]),h(b),b}function c(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}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 rv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,rv}var rx;function $w(){return rx||(rx=1,nv.exports=XA()),nv.exports}var sx;function QA(){if(sx)return tv;sx=1;var e=Wu(),t=$w();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,c=e.useDebugValue;return tv.useSyncExternalStoreWithSelector=function(d,p,f,g,b){var w=u(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=a(function(){function y(A){if(!v){if(v=!0,S=A,A=g(A),b!==void 0&&C.hasValue){var M=C.value;if(b(M,A))return E=M}return E=A}if(M=E,s(S,A))return M;var L=g(A);return b!==void 0&&b(M,L)?(S=A,M):(S=A,E=L)}var v=!1,S,E,T=f===void 0?null:f;return[function(){return y(p())},T===null?void 0:function(){return y(T())}]},[p,f,g,b]);var _=o(d,w[0],w[1]);return h(function(){C.hasValue=!0,C.value=_},[_]),c(_),_},tv}var ix;function ZA(){return ix||(ix=1,ev.exports=QA()),ev.exports}var Kw=ZA();function JA(e,t=s=>s,n={}){const s=n.equal??e3;return Kw.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function e3(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=ox(e);if(n.length!==ox(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 ox(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const sv=k.createContext(null);function Yw(){return typeof document>"u"?sv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=sv,sv)}function Nr(e){const t=k.useContext(Yw());return e?.warn,t}function Zn(e){const t=Nr({warn:e?.router===void 0}),n=e?.router||t,s=k.useRef(void 0);return JA(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const u=Xr(s.current,e.select(o));return s.current=u,u}return e.select(o)}return o})}const sp=k.createContext(void 0),t3=k.createContext(void 0);function Ns(e){const t=k.useContext(e.from?t3:sp);return Zn({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 j_(e){return Ns({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function N_(e){const{select:t,...n}=e;return Ns({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function B_(e){return Ns({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 z_(e){return Ns({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const Pf=typeof window<"u"?k.useLayoutEffect:k.useEffect;function iv(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 n3(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 r3(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}function vo(e){const t=Nr();return k.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Jn=Aw();const s3=Tw(Jn);function i3(e,t){const n=Nr(),[s,o]=k.useState(!1),u=k.useRef(!1),h=r3(t),{activeProps:a,inactiveProps:c,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:b,replace:w,startTransition:C,resetScroll:_,viewTransition:y,children:v,target:S,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:D,onMouseLeave:U,onTouchStart:z,ignoreBlocker:W,params:j,search:Y,hash:$,state:V,mask:q,reloadDocument:H,unsafeRelative:P,from:B,_fromLocation:I,...G}=e,K=Zn({select:ae=>ae.location.search,structuralSharing:!0}),J=e.from,Z=k.useMemo(()=>({...e,from:J}),[n,K,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 ae=ee.maskedLocation?ee.maskedLocation.url.href:ee.url.href,xe=!1;return n.origin&&(ae.startsWith(n.origin)?ae=n.history.createHref(ae.replace(n.origin,""))||"/":xe=!0),{href:ae,external:xe}},[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,re=g??n.options.defaultPreloadDelay??0,ne=Zn({select:ae=>{if(F)return!1;if(d?.exact){if(!vA(ae.location.pathname,ee.pathname,n.basepath))return!1}else{const xe=xh(ae.location.pathname,n.basepath),Re=xh(ee.pathname,n.basepath);if(!(xe.startsWith(Re)&&(xe.length===Re.length||xe[Re.length]==="/")))return!1}return(d?.includeSearch??!0)&&!aa(ae.location.search,ee.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?ae.location.hash===ee.hash:!0}}),oe=k.useCallback(()=>{n.preloadRoute({...Z}).catch(ae=>{console.warn(ae),console.warn(WA)})},[n,Z]),ce=k.useCallback(ae=>{ae?.isIntersecting&&oe()},[oe]);n3(h,ce,u3,{disabled:!!E||se!=="viewport"}),k.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const _e=ae=>{const xe=ae.currentTarget.getAttribute("target"),Re=S!==void 0?S:xe;if(!E&&!d3(ae)&&!ae.defaultPrevented&&(!Re||Re==="_self")&&ae.button===0){ae.preventDefault(),Jn.flushSync(()=>{o(!0)});const Ue=n.subscribe("onResolved",()=>{Ue(),o(!1)});n.navigate({...Z,replace:w,resetScroll:_,hashScrollIntoView:b,startTransition:C,viewTransition:y,ignoreBlocker:W})}};if(F)return{...G,ref:h,href:F,...v&&{children:v},...S&&{target:S},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...D&&{onMouseEnter:D},...U&&{onMouseLeave:U},...z&&{onTouchStart:z}};const ve=ae=>{E||se&&oe()},he=ve,fe=ae=>{if(!(E||!se))if(!re)oe();else{const xe=ae.target;if(lu.has(xe))return;const Re=setTimeout(()=>{lu.delete(xe),oe()},re);lu.set(xe,Re)}},De=ae=>{if(E||!se||!re)return;const xe=ae.target,Re=lu.get(xe);Re&&(clearTimeout(Re),lu.delete(xe))},Ae=ne?no(a,{})??o3:ov,Pe=ne?ov:no(c,{})??ov,Se=[A,Ae.className,Pe.className].filter(Boolean).join(" "),be=(T||Ae.style||Pe.style)&&{...T,...Ae.style,...Pe.style};return{...G,...Ae,...Pe,href:X?.href,ref:h,onClick:cu([M,_e]),onFocus:cu([L,ve]),onMouseEnter:cu([D,fe]),onMouseLeave:cu([U,De]),onTouchStart:cu([z,he]),disabled:!!E,target:S,...be&&{style:be},...Se&&{className:Se},...E&&a3,...ne&&l3,...s&&c3}}const ov={},o3={className:"active"},a3={role:"link","aria-disabled":!0},l3={"data-status":"active","aria-current":"page"},c3={"data-transitioning":"transitioning"},lu=new WeakMap,u3={rootMargin:"100px"},cu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},Wn=k.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,ref:u,...h}=i3(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 d3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let f3=class extends Gw{constructor(t){super(t),this.useMatch=n=>Ns({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ns({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>B_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>N_({...n,from:this.id}),this.useLoaderData=n=>j_({...n,from:this.id}),this.useNavigate=()=>vo({from:this.fullPath}),this.Link=Ie.forwardRef((n,s)=>x.jsx(Wn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function h3(e){return new f3(e)}class p3 extends qA{constructor(t){super(t),this.useMatch=n=>Ns({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ns({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>B_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>N_({...n,from:this.id}),this.useLoaderData=n=>j_({...n,from:this.id}),this.useNavigate=()=>vo({from:this.fullPath}),this.Link=Ie.forwardRef((n,s)=>x.jsx(Wn,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function m3(e){return new p3(e)}function vs(e){return typeof e=="object"?new ax(e,{silent:!0}).createRoute(e):new ax(e,{silent:!0}).createRoute}class ax{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=h3(s);return o.isRoot=!1,o},this.silent=n?.silent}}class lx{constructor(t){this.useMatch=n=>Ns({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ns({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>z_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>B_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>N_({...n,from:this.options.id}),this.useLoaderData=n=>j_({...n,from:this.options.id}),this.useNavigate=()=>{const n=Nr();return vo({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function cx(e){return typeof e=="object"?new lx(e):t=>new lx({id:e,...t})}function g3(){const e=Nr(),t=k.useRef({router:e,mounted:!1}),[n,s]=k.useState(!1),{hasPendingMatches:o,isLoading:u}=Zn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),h=iv(u),a=u||n||o,c=iv(a),d=u||o,p=iv(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 la(e.latestLocation.href)!==la(g.href)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),Pf(()=>{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]),Pf(()=>{h&&!u&&e.emit({type:"onLoad",...ca(e.state)})},[h,e,u]),Pf(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ca(e.state)})},[d,p,e]),Pf(()=>{if(c&&!a){const f=ca(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&EA(e)}},[a,c,e]),null}function v3(e){const t=Zn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return x.jsx(I_,{getResetKey:()=>t,onCatch:(n,s)=>{if(ns(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(ns(n))return e.fallback?.(n);throw n},children:e.children})}function _3(){return x.jsx("p",{children:"Not Found"})}function xl(e){return x.jsx(x.Fragment,{children:e.children})}function Xw(e,t,n){return t.options.notFoundComponent?x.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?x.jsx(e.options.defaultNotFoundComponent,{...n}):x.jsx(_3,{})}function y3({children:e}){const t=Nr();return t.isServer?x.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function b3(){const e=Nr();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||zv)(e.latestLocation),s=n!==zv(e.latestLocation)?n:void 0,o={storageKey:Ch,shouldScrollRestoration:!0};return s&&(o.key=s),x.jsx(y3,{children:`(${Iw.toString()})(${JSON.stringify(o)})`})}const Qw=k.memo(function({matchId:t}){const n=Nr(),s=Zn({select:y=>{const v=y.matches.find(S=>S.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?x.jsx(u,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,c=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:xl,g=a?I_:xl,b=d?v3:xl,w=Zn({select:y=>y.loadedAt}),C=Zn({select:y=>{const v=y.matches.findIndex(S=>S.id===t);return y.matches[v-1]?.routeId}}),_=o.isRoot?o.options.shellComponent??xl:xl;return x.jsxs(_,{children:[x.jsx(sp.Provider,{value:t,children:x.jsx(f,{fallback:h,children:x.jsx(g,{getResetKey:()=>w,errorComponent:a||rp,onCatch:(y,v)=>{if(ns(y))throw y;c?.(y,v)},children:x.jsx(b,{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?x.jsx($A,{fallback:h,children:x.jsx(ux,{matchId:t})}):x.jsx(ux,{matchId:t})})})})}),C===Ar&&n.options.scrollRestoration?x.jsxs(x.Fragment,{children:[x.jsx(S3,{}),x.jsx(b3,{})]}):null]})});function S3(){const e=Nr(),t=k.useRef(void 0);return x.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ca(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ux=k.memo(function({matchId:t}){const n=Nr(),{match:s,key:o,routeId:u}=Zn({select:c=>{const d=c.matches.find(w=>w.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 c=h.options.component??n.options.defaultComponent;return c?x.jsx(c,{},o):x.jsx(Zw,{})},[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 c=h.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const d=n.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise&&!n.isServer){const p=Bl();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return yi(ns(s.error)),Xw(n,h,s.error);if(s.status==="redirected")throw yi(ms(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const c=(h.options.errorComponent??n.options.defaultErrorComponent)||rp;return x.jsx(c,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),Zw=k.memo(function(){const t=Nr(),n=k.useContext(sp),s=Zn({select:d=>d.matches.find(p=>p.id===n)?.routeId}),o=t.routesById[s],u=Zn({select:d=>{const f=d.matches.find(g=>g.id===n);return yi(f),f.globalNotFound}}),h=Zn({select:d=>{const p=d.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),a=t.options.defaultPendingComponent?x.jsx(t.options.defaultPendingComponent,{}):null;if(u)return Xw(t,o,void 0);if(!h)return null;const c=x.jsx(Qw,{matchId:h});return s===Ar?x.jsx(k.Suspense,{fallback:a,children:c}):c});function x3(){const e=Nr(),n=e.routesById[Ar].options.pendingComponent??e.options.defaultPendingComponent,s=n?x.jsx(n,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?xl:k.Suspense,u=x.jsxs(o,{fallback:s,children:[!e.isServer&&x.jsx(g3,{}),x.jsx(C3,{})]});return e.options.InnerWrap?x.jsx(e.options.InnerWrap,{children:u}):u}function C3(){const e=Nr(),t=Zn({select:o=>o.matches[0]?.id}),n=Zn({select:o=>o.loadedAt}),s=t?x.jsx(Qw,{matchId:t}):null;return x.jsx(sp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:x.jsx(I_,{getResetKey:()=>n,errorComponent:rp,onCatch:o=>{o.message||o.toString()},children:s})})}const w3=e=>new E3(e);class E3 extends zA{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=vs,globalThis.createLazyFileRoute=cx):typeof window<"u"&&(window.createFileRoute=vs,window.createLazyFileRoute=cx);function R3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=Yw(),o=x.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?x.jsx(e.options.Wrap,{children:o}):o}function k3({router:e,...t}){return x.jsx(R3,{router:e,...t,children:x.jsx(x3,{})})}function T3(e){return Zn({select:t=>t.location})}var Yl=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(){}},L3={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},A3=class{#e=L3;#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)}},Jo=new A3;function O3(e){setTimeout(e,0)}var ba=typeof window>"u"||"Deno"in globalThis;function rr(){}function M3(e,t){return typeof e=="function"?e(t):e}function Vv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Jw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lo(e,t){return typeof e=="function"?e(t):e}function Zr(e,t){return typeof e=="function"?e(t):e}function dx(e,t){const{type:n="all",exact:s,fetchStatus:o,predicate:u,queryKey:h,stale:a}=e;if(h){if(s){if(t.queryHash!==H_(h,t.options))return!1}else if(!Lu(t.queryKey,h))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||u&&!u(t))}function fx(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(!Lu(t.options.mutationKey,u))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function H_(e,t){return(t?.queryKeyHashFn||Sa)(e)}function Sa(e){return JSON.stringify(e,(t,n)=>Fv(n)?Object.keys(n).sort().reduce((s,o)=>(s[o]=n[o],s),{}):n)}function Lu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Lu(e[n],t[n])):!1}var D3=Object.prototype.hasOwnProperty;function e2(e,t){if(e===t)return e;const n=hx(e)&&hx(t);if(!n&&!(Fv(e)&&Fv(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 c=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:D3.call(e,p))&&c++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const b=e2(f,g);a[p]=b,b===f&&c++}return o===h&&c===o?e:a}function Rh(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 hx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fv(e){if(!px(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!px(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function px(e){return Object.prototype.toString.call(e)==="[object Object]"}function P3(e){return new Promise(t=>{Jo.setTimeout(t,e)})}function Uv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?e2(e,t):t}function I3(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function j3(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var V_=Symbol();function t2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===V_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function n2(e,t){return typeof e=="function"?e(...t):!!e}var N3=class extends Yl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ba&&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"}},F_=new N3;function Wv(){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 B3=O3;function z3(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=B3;const u=a=>{t?e.push(a):o(()=>{n(a)})},h=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||h()}return c},batchCalls:a=>(...c)=>{u(()=>{a(...c)})},schedule:u,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var Ln=z3(),H3=class extends Yl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ba&&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}},kh=new H3;function V3(e){return Math.min(1e3*2**e,3e4)}function r2(e){return(e??"online")==="online"?kh.isOnline():!0}var qv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function s2(e){let t=!1,n=0,s;const o=Wv(),u=()=>o.status!=="pending",h=C=>{if(!u()){const _=new qv(C);g(_),e.onCancel?.(_)}},a=()=>{t=!0},c=()=>{t=!1},d=()=>F_.isFocused()&&(e.networkMode==="always"||kh.isOnline())&&e.canRun(),p=()=>r2(e.networkMode)&&e.canRun(),f=C=>{u()||(s?.(),o.resolve(C))},g=C=>{u()||(s?.(),o.reject(C))},b=()=>new Promise(C=>{s=_=>{(u()||d())&&C(_)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),w=()=>{if(u())return;let C;const _=n===0?e.initialPromise:void 0;try{C=_??e.fn()}catch(y){C=Promise.reject(y)}Promise.resolve(C).then(f).catch(y=>{if(u())return;const v=e.retry??(ba?0:3),S=e.retryDelay??V3,E=typeof S=="function"?S(n,y):S,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),P3(E).then(()=>d()?void 0:b()).then(()=>{t?g(y):w()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:c,canStart:p,start:()=>(p()?w():b().then(w),o)}}var i2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vv(this.gcTime)&&(this.#e=Jo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ba?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Jo.clearTimeout(this.#e),this.#e=void 0)}},F3=class extends i2{#e;#t;#n;#s;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=gx(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=gx(this.options);t.data!==void 0&&(this.setState(mx(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Uv(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(rr).catch(rr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V_||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:!Jw(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(c=>c.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=t2(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=s2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof qv&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#i({type:"failed",failureCount:a,error:c})},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 qv){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,...o2(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...mx(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),Ln.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function o2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:r2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gx(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 U3=class extends Yl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Wv(),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),vx(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),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 Zr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!Rh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&_x(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||Zr(this.options.enabled,this.#t)!==Zr(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||Zr(this.options.enabled,this.#t)!==Zr(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 q3(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.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(rr)),t}#g(){this.#b();const e=lo(this.options.staleTime,this.#t);if(ba||this.#s.isStale||!Vv(e))return;const n=Jw(this.#s.dataUpdatedAt,e)+1;this.#c=Jo.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.#S(),this.#l=e,!(ba||Zr(this.options.enabled,this.#t)===!1||!Vv(this.#l)||this.#l===0)&&(this.#u=Jo.setInterval(()=>{(this.options.refetchIntervalInBackground||F_.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(Jo.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(Jo.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,c=e!==n?e.state:this.#n,{state:d}=e;let p={...d},f=!1,g;if(t._optimisticResults){const L=this.hasListeners(),D=!L&&vx(e,t),U=L&&_x(e,n,t,s);(D||U)&&(p={...p,...o2(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:C}=p;g=p.data;let _=!1;if(t.placeholderData!==void 0&&g===void 0&&C==="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&&(C="success",g=Uv(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=Uv(o?.data,g,t),this.#f=g,this.#i=null}catch(L){this.#i=L}this.#i&&(b=this.#i,g=this.#f,w=Date.now(),C="error");const y=p.fetchStatus==="fetching",v=C==="pending",S=C==="error",E=v&&y,T=g!==void 0,M={status:C,fetchStatus:p.fetchStatus,isPending:v,isSuccess:C==="success",isError:S,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:S&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&T,isStale:U_(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Zr(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=Wv();L(z)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&L(U);break;case"fulfilled":(M.status==="error"||M.data!==U.value)&&D();break;case"rejected":(M.status!=="error"||M.error!==U.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),Rh(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()})}#x(){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){Ln.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function W3(e,t){return Zr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vx(e,t){return W3(e,t)||e.state.data!==void 0&&Gv(e,t,t.refetchOnMount)}function Gv(e,t,n){if(Zr(t.enabled,e)!==!1&&lo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&U_(e,t)}return!1}function _x(e,t,n,s){return(e!==t||Zr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&U_(e,n)}function U_(e,t){return Zr(t.enabled,e)!==!1&&e.isStaleByTime(lo(t.staleTime,e))}function q3(e,t){return!Rh(e.getCurrentResult(),t)}function yx(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:[]},c=0;const d=async()=>{let p=!1;const f=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=t2(t.options,t.fetchOptions),b=async(w,C,_)=>{if(p)return Promise.reject();if(C==null&&w.pages.length)return Promise.resolve(w);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};return f(A),A})(),S=await g(v),{maxPages:E}=t.options,T=_?j3:I3;return{pages:T(w.pages,S,E),pageParams:T(w.pageParams,C,E)}};if(o&&u.length){const w=o==="backward",C=w?G3:bx,_={pages:u,pageParams:h},y=C(s,_);a=await b(_,y,w)}else{const w=e??u.length;do{const C=c===0?h[0]??s.initialPageParam:bx(s,a);if(c>0&&C==null)break;a=await b(a,C),c++}while(c<w)}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 bx(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 G3(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $3=class extends i2{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||a2(),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=s2({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),Ln.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function a2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K3=class extends Yl{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 $3({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=If(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=If(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=If(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=If(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ln.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=>fx(t,n))}findAll(e={}){return this.getAll().filter(t=>fx(e,t))}notify(e){Ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ln.batch(()=>Promise.all(e.map(t=>t.continue().catch(rr))))}};function If(e){return e.options.scope?.id}var Y3=class extends Yl{#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),Rh(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??a2();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){Ln.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)})})}},X3=class extends Yl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,o=t.queryHash??H_(s,t);let u=this.get(o);return u||(u=new F3({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(){Ln.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=>dx(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>dx(e,n)):t}notify(e){Ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Q3=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new X3,this.#t=e.mutationCache||new K3,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=F_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=kh.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=M3(t,u);if(h!==void 0)return this.#e.build(this,s).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return Ln.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;Ln.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ln.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ln.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(s).then(rr).catch(rr)}invalidateQueries(e,t={}){return Ln.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=Ln.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(rr)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(rr)}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(rr).catch(rr)}fetchInfiniteQuery(e){return e.behavior=yx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rr).catch(rr)}ensureInfiniteQueryData(e){return e.behavior=yx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return kh.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=>{Lu(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=>{Lu(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=H_(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===V_&&(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()}},l2=k.createContext(void 0),Gn=e=>{const t=k.useContext(l2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z3=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(l2.Provider,{value:e,children:t})),c2=k.createContext(!1),J3=()=>k.useContext(c2);c2.Provider;function eO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tO=k.createContext(eO()),nO=()=>k.useContext(tO),rO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},sO=e=>{k.useEffect(()=>{e.clearReset()},[e])},iO=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||n2(n,[e.error,s])),oO=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))}},aO=(e,t)=>e.isLoading&&e.isFetching&&!t,lO=(e,t)=>e?.suspense&&t.isPending,Sx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function cO(e,t,n){const s=J3(),o=nO(),u=Gn(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",oO(h),rO(h,o),sO(o);const a=!u.getQueryCache().get(h.queryHash),[c]=k.useState(()=>new t(u,h)),d=c.getOptimisticResult(h),p=!s&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(f=>{const g=p?c.subscribe(Ln.batchCalls(f)):rr;return c.updateResult(),g},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),k.useEffect(()=>{c.setOptions(h)},[h,c]),lO(h,d))throw Sx(h,c,o);if(iO({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&&!ba&&aO(d,s)&&(a?Sx(h,c,o):u.getQueryCache().get(h.queryHash)?.promise)?.catch(rr).finally(()=>{c.updateResult()}),h.notifyOnChangeProps?d:c.trackResult(d)}function $n(e,t){return cO(e,U3)}function Nn(e,t){const n=Gn(),[s]=k.useState(()=>new Y3(n,e));k.useEffect(()=>{s.setOptions(e)},[s,e]);const o=k.useSyncExternalStore(k.useCallback(h=>s.subscribe(Ln.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=k.useCallback((h,a)=>{s.mutate(h,a).catch(rr)},[s]);if(o.error&&n2(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function ip(){return typeof window<"u"}function _o(e){return W_(e)?(e.nodeName||"").toLowerCase():"#document"}function Cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Hs(e){var t;return(t=(W_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function W_(e){return ip()?e instanceof Node||e instanceof Cn(e).Node:!1}function Nt(e){return ip()?e instanceof Element||e instanceof Cn(e).Element:!1}function Jt(e){return ip()?e instanceof HTMLElement||e instanceof Cn(e).HTMLElement:!1}function $v(e){return!ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Cn(e).ShadowRoot}const uO=new Set(["inline","contents"]);function Ra(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!uO.has(o)}const dO=new Set(["table","td","th"]);function fO(e){return dO.has(_o(e))}const hO=[":popover-open",":modal"];function op(e){return hO.some(t=>{try{return e.matches(t)}catch{return!1}})}const pO=["transform","translate","scale","rotate","perspective"],mO=["transform","translate","scale","rotate","perspective","filter"],gO=["paint","layout","strict","content"];function q_(e){const t=ap(),n=Nt(e)?Ir(e):e;return pO.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)||mO.some(s=>(n.willChange||"").includes(s))||gO.some(s=>(n.contain||"").includes(s))}function vO(e){let t=Bs(e);for(;Jt(t)&&!Ps(t);){if(q_(t))return t;if(op(t))return null;t=Bs(t)}return null}function ap(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _O=new Set(["html","body","#document"]);function Ps(e){return _O.has(_o(e))}function Ir(e){return Cn(e).getComputedStyle(e)}function lp(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bs(e){if(_o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$v(e)&&e.host||Hs(e);return $v(t)?t.host:t}function u2(e){const t=Bs(e);return Ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jt(t)&&Ra(t)?t:u2(t)}function co(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=u2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=Cn(o);if(u){const a=Kv(h);return t.concat(h,h.visualViewport||[],Ra(o)?o:[],a&&n?co(a):[])}return t.concat(o,co(o,[],n))}function Kv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const xx={};function qn(e,t){const n=k.useRef(xx);return n.current===xx&&(n.current=e(t)),n}const av=Lw[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],yO=av&&av!==k.useLayoutEffect?av:e=>e();function Oe(e){const t=qn(bO).current;return t.next=e,yO(t.effect),t.trampoline}function bO(){const e={next:void 0,callback:SO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function SO(){}const xO=()=>{},Ne=typeof document<"u"?k.useLayoutEffect:xO;function Yv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Cu={};function zs(e,t,n,s,o){let u={...Xv(e,Cu)};return t&&(u=vu(u,t)),n&&(u=vu(u,n)),s&&(u=vu(u,s)),o&&(u=vu(u,o)),u}function CO(e){if(e.length===0)return Cu;if(e.length===1)return Xv(e[0],Cu);let t={...Xv(e[0],Cu)};for(let n=1;n<e.length;n+=1)t=vu(t,e[n]);return t}function vu(e,t){return d2(t)?t(e):wO(e,t)}function wO(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Yv(e.style,s);break}case"className":{e[n]=f2(e.className,s);break}default:EO(n,s)?e[n]=RO(e[n],s):e[n]=s}}return e}function EO(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 d2(e){return typeof e=="function"}function Xv(e,t){return d2(e)?e(t):e??Cu}function RO(e,t){return t?e?n=>{if(kO(n)){const o=n;Qv(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function Qv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function f2(e,t){return t?e?t+" "+e:t:e}function kO(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function It(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 h2=k.createContext(void 0);function G_(e=!1){const t=k.useContext(h2);if(t===void 0&&!e)throw new Error(It(16));return t}function TO(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 Br(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=k.useRef(null),h=G_(!0)!==void 0,a=Oe(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:c}=TO({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=k.useCallback(()=>{const g=u.current;LO(g)&&h&&t&&c.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,c.disabled,h]);Ne(d,[d]);const p=k.useCallback((g={})=>{const{onClick:b,onMouseDown:w,onKeyUp:C,onKeyDown:_,onPointerDown:y,...v}=g;return zs({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}b?.(E)},onMouseDown(E){t||w?.(E)},onKeyDown(E){if(t||(Qv(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&&b?.(E))},onKeyUp(E){t||(Qv(E),C?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&b?.(E)},onPointerDown(E){if(t){E.preventDefault();return}y?.(E)}},o?void 0:{role:"button"},c,v)},[t,c,o,a]),f=Oe(g=>{u.current=g,d()});return{getButtonProps:p,buttonRef:f}}function LO(e){return Jt(e)&&e.tagName==="BUTTON"}function ss(e,t,n,s){const o=qn(p2).current;return OO(o,e,t,n,s)&&m2(o,[e,t,n,s]),o.callback}function AO(e){const t=qn(p2).current;return MO(t,e)&&m2(t,e),t.callback}function p2(){return{callback:null,cleanup:null,refs:[]}}function OO(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function MO(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function m2(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 DO=parseInt(k.version,10);function $_(e){return DO>=e}function Cx(e){if(!k.isValidElement(e))return null;const t=e,n=t.props;return($_(19)?n?.ref:t.ref)??null}function PO(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 IO(e,t){return typeof e=="function"?e(t):e}function jO(e,t){return typeof e=="function"?e(t):e}function rn(){}const mr=Object.freeze([]),en=Object.freeze({}),NO=500,BO=500,zO={style:{transition:"none"}},g2="data-base-ui-click-trigger",K_={fallbackAxisSide:"none"},HO={fallbackAxisSide:"end"},VO={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ut(e,t,n={}){const s=t.render,o=FO(t,n);if(n.enabled===!1)return null;const u=n.state??en;return UO(e,s,o,u)}function FO(e,t={}){const{className:n,style:s,render:o}=e,{state:u=en,ref:h,props:a,stateAttributesMapping:c,enabled:d=!0}=t,p=d?IO(n,u):void 0,f=d?jO(s,u):void 0,g=d?PO(u,c):en,b=d?Yv(g,Array.isArray(a)?CO(a):a)??en:en;return typeof document<"u"&&(d?Array.isArray(h)?b.ref=AO([b.ref,Cx(o),...h]):b.ref=ss(b.ref,Cx(o),h):ss(null,null)),d?(p!==void 0&&(b.className=f2(b.className,p)),f!==void 0&&(b.style=Yv(b.style,f)),b):en}function UO(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const o=zs(n,t.props);return o.ref=n.ref,k.cloneElement(t,o)}if(e&&typeof e=="string")return WO(e,n);throw new Error(It(8))}function WO(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 qO=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,focusableWhenDisabled:h=!1,nativeButton:a=!0,...c}=t,d=!!u,{getButtonProps:p,buttonRef:f}=Br({disabled:d,focusableWhenDisabled:h,native:a}),g=k.useMemo(()=>({disabled:d}),[d]);return ut("button",t,{state:g,ref:[n,f],props:[c,p]})});function v2(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=v2(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function _2(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=v2(e))&&(s&&(s+=" "),s+=t);return s}const wx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ex=_2,Xl=(e,t)=>n=>{var s;if(t?.variants==null)return Ex(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=wx(p)||wx(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},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,p)=>{let{class:f,className:g,...b}=p;return Object.entries(b).every(w=>{let[C,_]=w;return Array.isArray(_)?_.includes({...u,...a}[C]):{...u,...a}[C]===_})?[...d,f,g]:d},[]);return Ex(e,h,c,n?.class,n?.className)},GO=(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},$O=(e,t)=>({classGroupId:e,validator:t}),y2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Th="-",Rx=[],KO="arbitrary..",YO=e=>{const t=QO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return XO(h);const a=h.split(Th),c=a[0]===""&&a.length>1?1:0;return b2(a,c,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const c=s[h],d=n[h];return c?d?GO(d,c):c:d||Rx}return n[h]||Rx}}},b2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=b2(e,t+1,u);if(d)return d}const h=n.validators;if(h===null)return;const a=t===0?e.join(Th):e.slice(t).join(Th),c=h.length;for(let d=0;d<c;d++){const p=h[d];if(p.validator(a))return p.classGroupId}},XO=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?KO+s:void 0})(),QO=e=>{const{theme:t,classGroups:n}=e;return ZO(n,t)},ZO=(e,t)=>{const n=y2();for(const s in e){const o=e[s];Y_(o,n,s,t)}return n},Y_=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];JO(h,t,n,s)}},JO=(e,t,n,s)=>{if(typeof e=="string"){eM(e,t,n);return}if(typeof e=="function"){tM(e,t,n,s);return}nM(e,t,n,s)},eM=(e,t,n)=>{const s=e===""?t:S2(t,e);s.classGroupId=n},tM=(e,t,n,s)=>{if(rM(e)){Y_(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push($O(n,e))},nM=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,c]=o[h];Y_(c,S2(t,a),n,s)}},S2=(e,t)=>{let n=e;const s=t.split(Th),o=s.length;for(let u=0;u<o;u++){const h=s[u];let a=n.nextPart.get(h);a||(a=y2(),n.nextPart.set(h,a)),n=a}return n},rM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,sM=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)}}},Zv="!",kx=":",iM=[],Tx=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),oM=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const u=[];let h=0,a=0,c=0,d;const p=o.length;for(let C=0;C<p;C++){const _=o[C];if(h===0&&a===0){if(_===kx){u.push(o.slice(c,C)),c=C+1;continue}if(_==="/"){d=C;continue}}_==="["?h++:_==="]"?h--:_==="("?a++:_===")"&&a--}const f=u.length===0?o:o.slice(c);let g=f,b=!1;f.endsWith(Zv)?(g=f.slice(0,-1),b=!0):f.startsWith(Zv)&&(g=f.slice(1),b=!0);const w=d&&d>c?d-c:void 0;return Tx(u,b,g,w)};if(t){const o=t+kx,u=s;s=h=>h.startsWith(o)?u(h.slice(o.length)):Tx(iM,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},aM=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]==="[",c=t.has(h);a||c?(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}},lM=e=>({cache:sM(e.cacheSize),parseClassName:oM(e),sortModifiers:aM(e),...YO(e)}),cM=/\s+/,uM=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(cM);let c="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:f,modifiers:g,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(p);if(f){c=p+(c.length>0?" "+c:c);continue}let _=!!C,y=s(_?w.substring(0,C):w);if(!y){if(!_){c=p+(c.length>0?" "+c:c);continue}if(y=s(w),!y){c=p+(c.length>0?" "+c:c);continue}_=!1}const v=g.length===0?"":g.length===1?g[0]:u(g).join(":"),S=b?v+Zv:v,E=S+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(S+M)}c=p+(c.length>0?" "+c:c)}return c},dM=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=x2(n))&&(o&&(o+=" "),o+=s);return o},x2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=x2(e[s]))&&(n&&(n+=" "),n+=t);return n},fM=(e,...t)=>{let n,s,o,u;const h=c=>{const d=t.reduce((p,f)=>f(p),e());return n=lM(d),s=n.cache.get,o=n.cache.set,u=a,a(c)},a=c=>{const d=s(c);if(d)return d;const p=uM(c,n);return o(c,p),p};return u=h,(...c)=>u(dM(...c))},hM=[],Rn=e=>{const t=n=>n[e]||hM;return t.isThemeGetter=!0,t},C2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,w2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pM=/^\d+\/\d+$/,mM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gM=/\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$/,vM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_M=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bl=e=>pM.test(e),xt=e=>!!e&&!Number.isNaN(Number(e)),Zi=e=>!!e&&Number.isInteger(Number(e)),lv=e=>e.endsWith("%")&&xt(e.slice(0,-1)),hi=e=>mM.test(e),bM=()=>!0,SM=e=>gM.test(e)&&!vM.test(e),E2=()=>!1,xM=e=>_M.test(e),CM=e=>yM.test(e),wM=e=>!Ke(e)&&!Ye(e),EM=e=>Ql(e,T2,E2),Ke=e=>C2.test(e),Uo=e=>Ql(e,L2,SM),cv=e=>Ql(e,AM,xt),Lx=e=>Ql(e,R2,E2),RM=e=>Ql(e,k2,CM),jf=e=>Ql(e,A2,xM),Ye=e=>w2.test(e),uu=e=>Zl(e,L2),kM=e=>Zl(e,OM),Ax=e=>Zl(e,R2),TM=e=>Zl(e,T2),LM=e=>Zl(e,k2),Nf=e=>Zl(e,A2,!0),Ql=(e,t,n)=>{const s=C2.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Zl=(e,t,n=!1)=>{const s=w2.exec(e);return s?s[1]?t(s[1]):n:!1},R2=e=>e==="position"||e==="percentage",k2=e=>e==="image"||e==="url",T2=e=>e==="length"||e==="size"||e==="bg-size",L2=e=>e==="length",AM=e=>e==="number",OM=e=>e==="family-name",A2=e=>e==="shadow",MM=()=>{const e=Rn("color"),t=Rn("font"),n=Rn("text"),s=Rn("font-weight"),o=Rn("tracking"),u=Rn("leading"),h=Rn("breakpoint"),a=Rn("container"),c=Rn("spacing"),d=Rn("radius"),p=Rn("shadow"),f=Rn("inset-shadow"),g=Rn("text-shadow"),b=Rn("drop-shadow"),w=Rn("blur"),C=Rn("perspective"),_=Rn("aspect"),y=Rn("ease"),v=Rn("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Ye,Ke],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[Ye,Ke,c],D=()=>[bl,"full","auto",...L()],U=()=>[Zi,"none","subgrid",Ye,Ke],z=()=>["auto",{span:["full",Zi,Ye,Ke]},Zi,Ye,Ke],W=()=>[Zi,"auto",Ye,Ke],j=()=>["auto","min","max","fr",Ye,Ke],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...L()],q=()=>[bl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,Ye,Ke],P=()=>[...E(),Ax,Lx,{position:[Ye,Ke]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",TM,EM,{size:[Ye,Ke]}],G=()=>[lv,uu,Uo],K=()=>["","none","full",d,Ye,Ke],J=()=>["",xt,uu,Uo],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=()=>[xt,lv,Ax,Lx],F=()=>["","none",w,Ye,Ke],se=()=>["none",xt,Ye,Ke],re=()=>["none",xt,Ye,Ke],ne=()=>[xt,Ye,Ke],oe=()=>[bl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hi],breakpoint:[hi],color:[bM],container:[hi],"drop-shadow":[hi],ease:["in","out","in-out"],font:[wM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hi],shadow:[hi],spacing:["px",xt],text:[hi],"text-shadow":[hi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bl,Ke,Ye,_]}],container:["container"],columns:[{columns:[xt,Ke,Ye,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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",Ye,Ke]}],basis:[{basis:[bl,"full","auto",a,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,bl,"auto","initial","none",Ke]}],grow:[{grow:["",xt,Ye,Ke]}],shrink:[{shrink:["",xt,Ye,Ke]}],order:[{order:[Zi,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"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:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"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:q()}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,uu,Uo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ye,cv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lv,Ke]}],"font-family":[{font:[kM,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ye,Ke]}],"line-clamp":[{"line-clamp":[xt,"none",Ye,cv]}],leading:[{leading:[u,...L()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",Ye,Uo]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[xt,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zi,Ye,Ke],radial:["",Ye,Ke],conic:[Zi,Ye,Ke]},LM,RM]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"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:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,Ye,Ke]}],"outline-w":[{outline:["",xt,uu,Uo]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,Nf,jf]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",f,Nf,jf]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[xt,Uo]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,Nf,jf]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[xt,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xt]}],"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":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"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":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"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":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"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":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"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":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"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":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"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":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"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":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":[xt]}],"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":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"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",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:F()}],brightness:[{brightness:[xt,Ye,Ke]}],contrast:[{contrast:[xt,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",b,Nf,jf]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",xt,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[xt,Ye,Ke]}],invert:[{invert:["",xt,Ye,Ke]}],saturate:[{saturate:[xt,Ye,Ke]}],sepia:[{sepia:["",xt,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[xt,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[xt,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",xt,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[xt,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[xt,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",y,Ye,Ke]}],delay:[{delay:[xt,Ye,Ke]}],animate:[{animate:["none",v,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Ye,Ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[xt,uu,Uo,cv]}],stroke:[{stroke:["none",...H()]}],"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"]}},DM=fM(MM);function Be(...e){return DM(_2(e))}const PM=Xl("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 ze({className:e,variant:t="default",size:n="default",...s}){return x.jsx(qO,{"data-slot":"button",className:Be(PM({variant:t,size:n,className:e})),...s})}const IM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},Ce=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:o="",altIcon:u,showAlt:h=!1,icon:a,primaryColor:c,secondaryColor:d,disableSecondaryOpacity:p=!1,...f},g)=>{const b=n!==void 0?s?Number(n)*24/Number(t):n:void 0,w=b!==void 0?{strokeWidth:b,stroke:"currentColor"}:{},C={ref:g,...IM,width:t,height:t,color:c||e,className:o,...w,...f},y=[...h&&u?u:a].sort(([,v],[,S])=>{const E=v.opacity!==void 0;return S.opacity!==void 0?1:E?-1:0}).map(([v,S])=>{const E=S.opacity!==void 0,T=E&&!p?S.opacity:void 0,A=d?{...S.stroke!==void 0?{stroke:E?d:c||e}:{fill:E?d:c||e}}:{};return k.createElement(v,{...S,...w,...A,opacity:T,key:S.key})});return k.createElement("svg",C,y)});Ce.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"}]],O2=[["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"}]],M2=[["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"}]],D2=[["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"}]],jM=[["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"}]],Ox=[["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"}]],P2=[["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"}]],I2=[["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"}]],j2=[["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"}]],NM=[["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"}]],BM=[["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"}]],go=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],zM=[["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"}]],HM=[["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"}]],VM=[["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"}]],X_=[["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"}]],FM=[["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"}]],N2=[["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"}]],qu=[["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"}]],UM=[["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"}]],WM=[["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"}]],B2=[["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"}]],_s=[["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"}]],z2=[["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"}]],H2=[["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"}]],Jv=[["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"}]],Q_=[["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"}]],Lh=[["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"}]],qM=[["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"}]],GM=[["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"}]],$M=[["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"}]],KM=[["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"}]],YM=[["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"}]],XM=[["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"}]],QM=[["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"}]],Jr=[["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"}]],ZM=[["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"}]],JM=[["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"}]],V2=[["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"}]],e4=[["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"}]],Wo=[["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"}]],t4=[["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"}]],F2=[["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"}]],U2=[["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"}]],Z_=[["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"}]],Bf=[["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"}]],n4=[["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"}]],ka=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],r4=[["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"}]],s4=[["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"}]],J_=k.createContext(void 0);function xi(e){const t=k.useContext(J_);if(e===!1&&t===void 0)throw new Error(It(27));return t}let Ah=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const i4={[Ah.startingStyle]:""},o4={[Ah.endingStyle]:""},Vs={transitionStatus(e){return e==="starting"?i4:e==="ending"?o4:null}};let ea=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ah.startingStyle]="startingStyle",e[e.endingStyle=Ah.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),e_=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const a4={[e_.popupOpen]:""},l4={[e_.popupOpen]:"",[e_.pressed]:""},c4={[ea.open]:""},u4={[ea.closed]:""},d4={[ea.anchorHidden]:""},e0={open(e){return e?a4:null}},Au={open(e){return e?l4:null}},yo={open(e){return e?c4:u4},anchorHidden(e){return e?d4:null}},f4={...yo,...Vs},W2=k.forwardRef(function(t,n){const{render:s,className:o,forceRender:u=!1,...h}=t,{store:a}=xi(),c=a.useState("open"),d=a.useState("nested"),p=a.useState("mounted"),f=a.useState("transitionStatus"),g=k.useMemo(()=>({open:c,transitionStatus:f}),[c,f]);return ut("div",t,{state:g,ref:[a.context.backdropRef,n],stateAttributesMapping:f4,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},h],enabled:u||!d})}),Pn="none",ua="trigger-press",Dr="trigger-hover",Oh="trigger-focus",t0="outside-press",da="item-press",h4="close-press",Mx="clear-press",ta="input-change",eo="input-clear",xa="focus-out",cp="escape-key",wu="list-navigation",q2="cancel-open",_u="sibling-open",G2="imperative-action",p4="window-resize";function Fe(e,t,n,s){let o=!1,u=!1;const h=s??en;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 du(e,t,n){const s=n??en;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:c}=xi(),d=c.useState("open");function p(w){d&&c.setOpen(!1,Fe(h4,w.nativeEvent))}const{getButtonProps:f,buttonRef:g}=Br({disabled:u,native:h}),b=k.useMemo(()=>({disabled:u}),[u]);return ut("button",t,{state:b,ref:[n,g],props:[{onClick:p},a,f]})}),m4={...Lw};let Dx=0;function g4(e,t="mui"){const[n,s]=k.useState(e),o=e||n;return k.useEffect(()=>{n==null&&(Dx+=1,s(`${t}-${Dx}`))},[n,t]),o}const Px=m4.useId;function Ta(e,t){if(Px!==void 0){const n=Px();return e??(t?`${t}-${n}`:n)}return g4(e,t)}function jr(e){return Ta(e,"base-ui")}const $2=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=xi(),c=jr(u);return a.useSyncedValueWithCleanup("descriptionElementId",c),ut("p",t,{ref:n,props:[{id:c},h]})}),v4=[];function K2(e){k.useEffect(e,v4)}const fu=0;class Ca{static create(){return new Ca}currentId=fu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fu,n()},t)}isStarted(){return this.currentId!==fu}clear=()=>{this.currentId!==fu&&(clearTimeout(this.currentId),this.currentId=fu)};disposeEffect=()=>this.clear}function Qt(){const e=qn(Ca.create).current;return K2(e.disposeEffect),e}function fn(e){const t=qn(_4,e).current;return t.next=e,Ne(t.effect),t}function _4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const La=typeof navigator<"u",uv=S4(),Y2=C4(),n0=x4(),r0=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),y4=uv.platform==="MacIntel"&&uv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(uv.platform),Ix=La&&/firefox/i.test(n0),X2=La&&/apple/i.test(navigator.vendor),Mh=La&&/android/i.test(Y2)||/android/i.test(n0),b4=La&&Y2.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Q2=n0.includes("jsdom/");function S4(){if(!La)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 x4(){if(!La)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function C4(){if(!La)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const t_="data-base-ui-focusable",Z2="active",J2="selected",eE="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",uo="ArrowLeft",fo="ArrowRight",s0="ArrowUp",Gu="ArrowDown";function hs(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function dt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&$v(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function An(e){return"composedPath"in e?e.composedPath()[0]:e.target}function fs(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 w4(e){return e.matches("html,body")}function un(e){return e?.ownerDocument||document}function i0(e){return Jt(e)&&e.matches(eE)}function n_(e){return e?e.getAttribute("role")==="combobox"&&i0(e):!1}function E4(e){if(!e||Q2)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ou(e){return e?e.hasAttribute(t_)?e:e.querySelector(`[${t_}]`)||e:null}function fa(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...fa(e,o.id,n)])}function jx(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 dn(e){e.preventDefault(),e.stopPropagation()}function R4(e){return"nativeEvent"in e}function tE(e){return e.mozInputSource===0&&e.isTrusted?!0:Mh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function nE(e){return Q2?!1:!Mh&&e.width===0&&e.height===0||Mh&&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 Hl(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function rE(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const k4=["top","right","bottom","left"],Vl=Math.min,Or=Math.max,Dh=Math.round,Cl=Math.floor,Is=e=>({x:e,y:e}),T4={left:"right",right:"left",bottom:"top",top:"bottom"},L4={start:"end",end:"start"};function r_(e,t,n){return Or(e,Vl(t,n))}function bi(e,t){return typeof e=="function"?e(t):e}function Pr(e){return e.split("-")[0]}function bo(e){return e.split("-")[1]}function o0(e){return e==="x"?"y":"x"}function a0(e){return e==="y"?"height":"width"}const A4=new Set(["top","bottom"]);function es(e){return A4.has(Pr(e))?"y":"x"}function l0(e){return o0(es(e))}function O4(e,t,n){n===void 0&&(n=!1);const s=bo(e),o=l0(e),u=a0(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=Ph(h)),[h,Ph(h)]}function M4(e){const t=Ph(e);return[s_(e),t,s_(t)]}function s_(e){return e.replace(/start|end/g,t=>L4[t])}const Nx=["left","right"],Bx=["right","left"],D4=["top","bottom"],P4=["bottom","top"];function I4(e,t,n){switch(e){case"top":case"bottom":return n?t?Bx:Nx:t?Nx:Bx;case"left":case"right":return t?D4:P4;default:return[]}}function j4(e,t,n,s){const o=bo(e);let u=I4(Pr(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(s_)))),u}function Ph(e){return e.replace(/left|right|bottom|top/g,t=>T4[t])}function N4(e){return{top:0,right:0,bottom:0,left:0,...e}}function sE(e){return typeof e!="number"?N4(e):{top:e,right:e,bottom:e,left:e}}function Ih(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 zf(e,t,n){return Math.floor(e/t)!==n}function Rl(e,t){return t<0||t>=e.current.length}function dh(e,t){return Un(e,{disabledIndices:t})}function i_(e,t){return Un(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Un(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 iE(e,{event:t,orientation:n,loopFocus:s,rtl:o,cols:u,disabledIndices:h,minIndex:a,maxIndex:c,prevIndex:d,stopEvent:p=!1}){let f=d;const g=[],b={};let w=!1;{let y=null,v=-1;e.current.forEach((S,E)=>{if(S==null)return;const T=S.closest('[role="row"]');T&&(w=!0),(T!==y||v===-1)&&(y=T,v+=1,g[v]=[]),g[v].push(E),b[E]=v})}const C=w&&g.length>0&&g.some(y=>y.length!==u);function _(y){if(!C||d===-1)return;const v=b[d];if(v==null)return;const S=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(S,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===s0){const y=_("up");if(y!==void 0)p&&dn(t),f=y;else{if(p&&dn(t),d===-1)f=c;else if(f=Un(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:h}),s&&(d-u<a||f<0)){const v=d%u,S=c%u,E=c-(S-v);S===v?f=c:f=S>v?E:E-u}Rl(e,f)&&(f=d)}}if(t.key===Gu){const y=_("down");y!==void 0?(p&&dn(t),f=y):(p&&dn(t),d===-1?f=a:(f=Un(e,{startingIndex:d,amount:u,disabledIndices:h}),s&&d+u>c&&(f=Un(e,{startingIndex:d%u-u,amount:u,disabledIndices:h}))),Rl(e,f)&&(f=d))}if(n==="both"){const y=Cl(d/u);t.key===(o?uo:fo)&&(p&&dn(t),d%u!==u-1?(f=Un(e,{startingIndex:d,disabledIndices:h}),s&&zf(f,u,y)&&(f=Un(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Un(e,{startingIndex:d-d%u-1,disabledIndices:h})),zf(f,u,y)&&(f=d)),t.key===(o?fo:uo)&&(p&&dn(t),d%u!==0?(f=Un(e,{startingIndex:d,decrement:!0,disabledIndices:h}),s&&zf(f,u,y)&&(f=Un(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h}))):s&&(f=Un(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h})),zf(f,u,y)&&(f=d));const v=Cl(c/u)===y;Rl(e,f)&&(s&&v?f=t.key===(o?fo:uo)?c:Un(e,{startingIndex:d-d%u-1,disabledIndices:h}):f=d)}return f}function oE(e,t,n){const s=[];let o=0;return e.forEach(({width:u,height:h},a)=>{let c=!1;for(n&&(o=0);!c;){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}),c=!0):o+=1}}),[...s]}function aE(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 lE(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 B4=["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])"],jh=B4.join(","),cE=typeof Element>"u",Fl=cE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Nh=!cE&&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},Mu=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&&Mu(t.parentNode);return h},z4=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},uE=function(t,n,s){if(Mu(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(jh));return n&&Fl.call(t,jh)&&o.unshift(t),o=o.filter(s),o},Bh=function(t,n,s){for(var o=[],u=Array.from(t);u.length;){var h=u.shift();if(!Mu(h,!1))if(h.tagName==="SLOT"){var a=h.assignedElements(),c=a.length?a:h.children,d=Bh(c,!0,s);s.flatten?o.push.apply(o,d):o.push({scopeParent:h,candidates:d})}else{var p=Fl.call(h,jh);p&&s.filter(h)&&(n||!t.includes(h))&&o.push(h);var f=h.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(h),g=!Mu(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(h));if(f&&g){var b=Bh(f===!0?h.children:f.children,!0,s);s.flatten?o.push.apply(o,b):o.push({scopeParent:h,candidates:b})}else u.unshift.apply(u,h.children)}}return o},dE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||z4(t))&&!dE(t)?0:t.tabIndex},H4=function(t,n){var s=fE(t);return s<0&&n&&!dE(t)?0:s},V4=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},hE=function(t){return t.tagName==="INPUT"},F4=function(t){return hE(t)&&t.type==="hidden"},U4=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},W4=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||Nh(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=W4(o,t.form);return!u||u===t},G4=function(t){return hE(t)&&t.type==="radio"},$4=function(t){return G4(t)&&!q4(t)},K4=function(t){var n,s=t&&Nh(t),o=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var h,a,c;for(u=!!((h=o)!==null&&h!==void 0&&(a=h.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!u&&o;){var d,p,f;s=Nh(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},zx=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},Y4=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=Fl.call(t,"details>summary:first-of-type"),a=h?t.parentElement:t;if(Fl.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var d=t.parentElement,p=Nh(t);if(d&&!d.shadowRoot&&o(d)===!0)return zx(t);t.assignedSlot?t=t.assignedSlot:!d&&p!==t.ownerDocument?t=p.host:t=d}t=c}if(K4(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return zx(t);return!1},X4=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 Fl.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},o_=function(t,n){return!(n.disabled||Mu(n)||F4(n)||Y4(n,t)||U4(n)||X4(n))},a_=function(t,n){return!($4(n)||fE(n)<0||!o_(t,n))},Q4=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pE=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,c=H4(a,h),d=h?pE(o.candidates):a;c===0?h?n.push.apply(n,d):n.push(a):s.push({documentOrder:u,tabIndex:c,item:o,isScope:h,content:d})}),s.sort(V4).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},$u=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Bh([t],n.includeContainer,{filter:a_.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Q4}):s=uE(t,n.includeContainer,a_.bind(null,n)),pE(s)},Z4=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Bh([t],n.includeContainer,{filter:o_.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=uE(t,n.includeContainer,o_.bind(null,n)),s},mE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Fl.call(t,jh)===!1?!1:a_(n,t)};const tc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gE(e,t){const n=$u(e,tc()),s=n.length;if(s===0)return;const o=hs(un(e)),u=n.indexOf(o),h=u===-1?t===1?0:s-1:u+t;return n[h]}function c0(e){return gE(un(e).body,1)||e}function vE(e){return gE(un(e).body,-1)||e}function _E(e,t){if(!e)return null;const n=$u(un(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 J4(e){return _E(e,1)}function eD(e){return _E(e,-1)}function kl(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!dt(n,s)}function tD(e){$u(e,tc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Hx(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 yE(){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 u0{nodesRef={current:[]};events=yE();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 bE=k.createContext(null),SE=k.createContext(null),Ci=()=>k.useContext(bE)?.id||null,So=e=>{const t=k.useContext(SE);return e??t};function xE(e){const t=Ta(),n=So(e),s=Ci();return Ne(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function nD(e){const{children:t,id:n}=e,s=Ci();return x.jsx(bE.Provider,{value:k.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function rD(e){const{children:t,externalTree:n}=e,s=qn(()=>n??new u0).current;return x.jsx(SE.Provider,{value:s,children:t})}function Ul(e){return`data-base-ui-${e}`}function dv(e,t,n){if(n&&!Hl(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},Hf=null;class sD{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 Vf=new sD;class Os{static create(){return new Os}static request(t){return Vf.request(t)}static cancel(t){return Vf.cancel(t)}currentId=Hf;request(t){this.cancel(),this.currentId=Vf.request(()=>{this.currentId=Hf,t()})}cancel=()=>{this.currentId!==Hf&&(Vf.cancel(this.currentId),this.currentId=Hf)};disposeEffect=()=>this.cancel}function Ku(){const e=qn(Os.create).current;return K2(e.disposeEffect),e}function gr(e){return e?.ownerDocument||document}const Wl=k.forwardRef(function(t,n){const[s,o]=k.useState();Ne(()=>{X2&&o("button")},[]);const u={tabIndex:0,role:s};return x.jsx("span",{...t,ref:n,style:nc,"aria-hidden":s?void 0:!0,...u,"data-base-ui-focus-guard":""})});let Vx=0;function fh(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(Vx);const u=()=>e?.focus({preventScroll:n});o?u():Vx=requestAnimationFrame(u)}const Tl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Fx(e){return e==="inert"?Tl.inert:e==="aria-hidden"?Tl["aria-hidden"]:Tl.none}let Ff=new WeakSet,Uf={},fv=0;const CE=e=>e&&(e.host||CE(e.parentNode)),iD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=CE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function oD(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=iD(t,e),a=new Set,c=new Set(h),d=[];Uf[o]||(Uf[o]=new WeakMap);const p=Uf[o];h.forEach(f),g(t),a.clear();function f(b){!b||a.has(b)||(a.add(b),b.parentNode&&f(b.parentNode))}function g(b){!b||c.has(b)||[].forEach.call(b.children,w=>{if(_o(w)!=="script")if(a.has(w))g(w);else{const C=u?w.getAttribute(u):null,_=C!==null&&C!=="false",y=Fx(u),v=(y.get(w)||0)+1,S=(p.get(w)||0)+1;y.set(w,v),p.set(w,S),d.push(w),v===1&&_&&Ff.add(w),S===1&&w.setAttribute(o,""),!_&&u&&w.setAttribute(u,u==="inert"?"":"true")}})}return fv+=1,()=>{d.forEach(b=>{const w=Fx(u),_=(w.get(b)||0)-1,y=(p.get(b)||0)-1;w.set(b,_),p.set(b,y),_||(!Ff.has(b)&&u&&b.removeAttribute(u),Ff.delete(b)),y||b.removeAttribute(o)}),fv-=1,fv||(Tl.inert=new WeakMap,Tl["aria-hidden"]=new WeakMap,Tl.none=new WeakMap,Ff=new WeakSet,Uf={})}}function aD(e,t=!1,n=!1){const s=un(e[0]).body;return oD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const wE=k.createContext(null),EE=()=>k.useContext(wE),lD=Ul("portal");function cD(e={}){const{ref:t,container:n,componentProps:s=en,elementProps:o,elementState:u}=e,h=Ta(),c=EE()?.portalNode,[d,p]=k.useState(null),[f,g]=k.useState(null),b=k.useRef(null);Ne(()=>{if(n===null){b.current&&(b.current=null,g(null),p(null));return}if(h==null)return;const _=(n&&(W_(n)?n:n.current))??c??document.body;if(_==null){b.current&&(b.current=null,g(null),p(null));return}b.current!==_&&(b.current=_,g(null),p(_))},[n,c,h]);const w=ut("div",s,{ref:[t,g],state:u,props:[{id:h,[lD]:""},o]});return{portalNode:f,portalSubtree:d&&w?Jn.createPortal(w,d):null}}const dp=k.forwardRef(function(t,n){const{children:s,container:o,className:u,render:h,renderGuards:a,...c}=t,{portalNode:d,portalSubtree:p}=cD({container:o,ref:n,componentProps:t,elementProps:c}),f=k.useRef(null),g=k.useRef(null),b=k.useRef(null),w=k.useRef(null),[C,_]=k.useState(null),y=C?.modal,v=C?.open,S=typeof a=="boolean"?a:!!C&&!C.modal&&C.open&&!!d;k.useEffect(()=>{if(!d||y)return;function T(A){d&&kl(A)&&(A.type==="focusin"?Hx:tD)(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||Hx(d)},[v,d]);const E=k.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:b,afterInsideRef:w,portalNode:d,setFocusManagerState:_}),[d]);return x.jsxs(k.Fragment,{children:[p,x.jsxs(wE.Provider,{value:E,children:[S&&d&&x.jsx(Wl,{"data-type":"outside",ref:f,onFocus:T=>{if(kl(T,d))b.current?.focus();else{const A=C?C.domReference:null;vE(A)?.focus()}}}),S&&d&&x.jsx("span",{"aria-owns":d.id,style:VO}),d&&Jn.createPortal(s,d),S&&d&&x.jsx(Wl,{"data-type":"outside",ref:g,onFocus:T=>{if(kl(T,d))w.current?.focus();else{const A=C?C.domReference:null;c0(A)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,Fe(xa,T.nativeEvent))}}})]})]})});function Ko(e){return e==null?e:"current"in e?e.current:e}function uD(e,t){const n=Cn(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 Ux=20;let so=[];function d0(){so=so.filter(e=>e.isConnected)}function dD(e){d0(),e&&_o(e)!=="body"&&(so.push(e),so.length>Ux&&(so=so.slice(-Ux)))}function hv(){return d0(),so[so.length-1]}function fD(e){if(!e)return null;const t=tc();return mE(e,t)?e:$u(e,t)[0]||e}function hD(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ir(e).display!=="none"}function Wx(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=tc(),o=Z4(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return mE(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:c=!0,closeOnFocusOut:d=!0,openInteractionType:p="",getInsideElements:f=()=>[],nextFocusableElement:g,previousFocusableElement:b,beforeContentFocusGuardRef:w,externalTree:C}=e,_="rootStore"in t?t.rootStore:t,y=_.useState("open"),v=_.useState("domReferenceElement"),S=_.useState("floatingElement"),{events:E,dataRef:T}=_.context,A=Oe(()=>T.current.floatingContext?.nodeId),M=Oe(f),L=u===!1,D=n_(v)&&L,U=fn(o),z=fn(u),W=fn(h),j=fn(p),Y=So(C),$=EE(),V=k.useRef(null),q=k.useRef(null),H=k.useRef(!1),P=k.useRef(!1),B=k.useRef(!1),I=k.useRef(-1),G=k.useRef(""),K=k.useRef(""),J=Qt(),Z=Qt(),ee=Ku(),X=$!=null,F=Ou(S),se=Oe((he=F)=>he?$u(he,tc()):[]),re=Oe(he=>{const fe=se(he);return U.current.map(()=>fe).filter(Boolean).flat()});k.useEffect(()=>{if(s||!c)return;function he(De){De.key==="Tab"&&dt(F,hs(un(F)))&&se().length===0&&!D&&dn(De)}const fe=un(F);return fe.addEventListener("keydown",he),()=>{fe.removeEventListener("keydown",he)}},[s,v,F,c,U,D,se,re]),k.useEffect(()=>{if(s||!S)return;function he(fe){const De=An(fe),Pe=se().indexOf(De);Pe!==-1&&(I.current=Pe)}return S.addEventListener("focusin",he),()=>{S.removeEventListener("focusin",he)}},[s,S,se]),k.useEffect(()=>{if(s||!y)return;const he=un(F);function fe(){B.current=!1}function De(Pe){const Se=An(Pe),be=dt(S,Se)||dt(v,Se)||dt($?.portalNode,Se);B.current=!be,K.current=Pe.pointerType||"keyboard"}function Ae(){K.current="keyboard"}return he.addEventListener("pointerdown",De,!0),he.addEventListener("pointerup",fe,!0),he.addEventListener("pointercancel",fe,!0),he.addEventListener("keydown",Ae,!0),()=>{he.removeEventListener("pointerdown",De,!0),he.removeEventListener("pointerup",fe,!0),he.removeEventListener("pointercancel",fe,!0),he.removeEventListener("keydown",Ae,!0)}},[s,S,v,F,y,$]),k.useEffect(()=>{if(s||!d)return;function he(){P.current=!0,Z.start(0,()=>{P.current=!1})}function fe(Se){const be=Se.relatedTarget,ae=Se.currentTarget,xe=An(Se);queueMicrotask(()=>{const Re=A(),Ue=_.context.triggerElements,nt=!(dt(v,be)||dt(S,be)||dt(be,S)||dt($?.portalNode,be)||be!=null&&Ue.hasElement(be)||Ue.hasMatchingElement(He=>dt(He,be))||be?.hasAttribute(Ul("focus-guard"))||Y&&(fa(Y.nodesRef.current,Re).find(He=>dt(He.context?.elements.floating,be)||dt(He.context?.elements.domReference,be))||jx(Y.nodesRef.current,Re).find(He=>[He.context?.elements.floating,Ou(He.context?.elements.floating)].includes(be)||He.context?.elements.domReference===be)));if(ae===v&&F&&Wx(F,U),a&&ae!==v&&!hD(xe)&&hs(un(F))===un(F).body){if(Jt(F)&&(F.focus(),a==="popup")){ee.request(()=>{F.focus()});return}const He=I.current,st=se(),et=st[He]||st[st.length-1]||F;Jt(et)&&et.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(D||!c)&&be&&nt&&!P.current&&(D||be!==hv())&&(H.current=!0,_.setOpen(!1,Fe(xa,Se)))})}function De(){B.current||(T.current.insideReactTree=!0,J.start(0,()=>{T.current.insideReactTree=!1}))}const Ae=Jt(v)?v:null,Pe=[];if(!(!S&&!Ae))return Ae&&(Ae.addEventListener("focusout",fe),Ae.addEventListener("pointerdown",he),Pe.push(()=>{Ae.removeEventListener("focusout",fe),Ae.removeEventListener("pointerdown",he)})),S&&(S.addEventListener("focusout",fe),$&&(S.addEventListener("focusout",De,!0),Pe.push(()=>{S.removeEventListener("focusout",De,!0)})),Pe.push(()=>{S.removeEventListener("focusout",fe)})),()=>{Pe.forEach(Se=>{Se()})}},[s,v,S,F,c,Y,$,_,d,a,se,D,A,U,T,J,Z,ee]);const ne=k.useRef(null),oe=k.useRef(null),ce=ss(ne,w,$?.beforeInsideRef),_e=ss(oe,$?.afterInsideRef);k.useEffect(()=>{if(s||!S||!y)return;const he=Array.from($?.portalNode?.querySelectorAll(`[${Ul("portal")}]`)||[]),De=(Y?jx(Y.nodesRef.current,A()):[]).find(Se=>n_(Se.context?.elements.domReference||null))?.context?.elements.domReference,Ae=[S,De,...he,...M(),V.current,q.current,ne.current,oe.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Ko(b),Ko(g),D?v:null].filter(Se=>Se!=null),Pe=aD(Ae,c||D);return()=>{Pe()}},[y,s,v,S,c,U,$,D,Y,A,M,g,b]),Ne(()=>{if(!y||s||!Jt(F))return;const he=un(F),fe=hs(he);queueMicrotask(()=>{const De=re(F),Ae=z.current,Pe=typeof Ae=="function"?Ae(j.current||""):Ae;if(Pe===void 0||Pe===!1)return;let Se;Pe===!0||Pe===null?Se=De[0]||F:Se=Ko(Pe),Se=Se||De[0]||F,!dt(F,fe)&&fh(Se,{preventScroll:Se===F})})},[s,y,F,L,re,z,j]),Ne(()=>{if(s||!F)return;const he=un(F),fe=hs(he);dD(fe);function De(Se){if(Se.open||(G.current=uD(Se.nativeEvent,K.current)),Se.reason===Dr&&Se.nativeEvent.type==="mouseleave"&&(H.current=!0),Se.reason===t0)if(Se.nested)H.current=!1;else if(tE(Se.nativeEvent)||nE(Se.nativeEvent))H.current=!1;else{let be=!1;document.createElement("div").focus({get preventScroll(){return be=!0,!1}}),be?H.current=!1:H.current=!0}}E.on("openchange",De);const Ae=he.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,nc),X&&v&&v.insertAdjacentElement("afterend",Ae);function Pe(){const Se=W.current;let be=typeof Se=="function"?Se(G.current):Se;if(be===void 0||be===!1)return null;if(be===null&&(be=!0),typeof be=="boolean"){const xe=v||hv();return xe&&xe.isConnected?xe:Ae}const ae=v||hv()||Ae;return Ko(be)||ae}return()=>{E.off("openchange",De);const Se=hs(he),be=dt(S,Se)||Y&&fa(Y.nodesRef.current,A(),!1).some(xe=>dt(xe.context?.elements.floating,Se)),ae=Pe();queueMicrotask(()=>{const xe=fD(ae),Re=typeof W.current!="boolean";W.current&&!H.current&&Jt(xe)&&(!(!Re&&xe!==Se&&Se!==he.body)||be)&&xe.focus({preventScroll:!0}),Ae.remove()})}},[s,S,F,W,T,E,Y,X,v,A]),k.useEffect(()=>{queueMicrotask(()=>{H.current=!1})},[s]),k.useEffect(()=>{if(s||!y)return;function he(De){An(De)?.closest(`[${g2}]`)&&(P.current=!0)}const fe=un(F);return fe.addEventListener("pointerdown",he,!0),()=>{fe.removeEventListener("pointerdown",he,!0)}},[s,y,F]),Ne(()=>{if(!s&&$)return $.setFocusManagerState({modal:c,closeOnFocusOut:d,open:y,onOpenChange:_.setOpen,domReference:v}),()=>{$.setFocusManagerState(null)}},[s,$,c,y,_,d,v]),Ne(()=>{if(!(s||!F))return Wx(F,U),()=>{queueMicrotask(d0)}},[s,F,U]);const ve=!s&&(c?!D:!0)&&(X||c);return x.jsxs(k.Fragment,{children:[ve&&x.jsx(Wl,{"data-type":"inside",ref:ce,onFocus:he=>{if(c){const fe=re();fh(fe[fe.length-1])}else $?.portalNode&&(H.current=!1,kl(he,$.portalNode)?c0(v)?.focus():Ko(b??$.beforeOutsideRef)?.focus())}}),n,ve&&x.jsx(Wl,{"data-type":"inside",ref:_e,onFocus:he=>{c?fh(re()[0]):$?.portalNode&&(d&&(H.current=!0),kl(he,$.portalNode)?vE(v)?.focus():Ko(g??$.afterOutsideRef)?.focus())}})]})}function Yu(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:c=!0,touchOpenDelay:d=0}=t,p=k.useRef(void 0),f=Ku(),g=Qt(),b=k.useMemo(()=>({onPointerDown(w){p.current=w.pointerType},onMouseDown(w){const C=p.current,_=w.nativeEvent,y=n.select("open");if(w.button!==0||u==="click"||Hl(C,!0)&&a)return;const v=s.current.openEvent,S=v?.type,E=n.select("domReferenceElement")!==w.currentTarget,T=y&&E||!(y&&h&&(!(v&&c)||S==="click"||S==="mousedown"));if(i0(_.target)){const M=Fe(ua,_,_.target);T&&C==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M);return}const A=w.currentTarget;f.request(()=>{const M=Fe(ua,_,A);T&&C==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M)})},onClick(w){if(u==="mousedown-only")return;const C=p.current;if(u==="mousedown"&&C){p.current=void 0;return}if(Hl(C,!0)&&a)return;const _=n.select("open"),y=s.current.openEvent,v=n.select("domReferenceElement")!==w.currentTarget,S=_&&v||!(_&&h&&(!(y&&c)||rE(y))),E=Fe(ua,w.nativeEvent,w.currentTarget);S&&C==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(S,E)},onKeyDown(){p.current=void 0}}),[s,u,a,n,c,h,f,g,d]);return k.useMemo(()=>o?{reference:b}:en,[o,b])}function qx(e,t,n){let{reference:s,floating:o}=e;const u=es(t),h=l0(t),a=a0(h),c=Pr(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 b;switch(c){case"top":b={x:p,y:s.y-o.height};break;case"bottom":b={x:p,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:f};break;case"left":b={x:s.x-o.width,y:f};break;default:b={x:s.x,y:s.y}}switch(bo(t)){case"start":b[h]-=g*(n&&d?-1:1);break;case"end":b[h]+=g*(n&&d?-1:1);break}return b}const pD=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:h}=n,a=u.filter(Boolean),c=await(h.isRTL==null?void 0:h.isRTL(t));let d=await h.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=qx(d,s,c),g=s,b={},w=0;for(let C=0;C<a.length;C++){const{name:_,fn:y}=a[C],{x:v,y:S,data:E,reset:T}=await y({x:p,y:f,initialPlacement:s,placement:g,strategy:o,middlewareData:b,rects:d,platform:h,elements:{reference:e,floating:t}});p=v??p,f=S??f,b={...b,[_]:{...b[_],...E}},T&&w<=50&&(w++,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}=qx(d,g,c)),C=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:b}};async function Du(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:h,elements:a,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:b=0}=bi(t,e),w=sE(b),_=a[g?f==="floating"?"reference":"floating":f],y=Ih(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:c})),v=f==="floating"?{x:s,y:o,width:h.floating.width,height:h.floating.height}:h.reference,S=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(S))?await(u.getScale==null?void 0:u.getScale(S))||{x:1,y:1}:{x:1,y:1},T=Ih(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:S,strategy:c}):v);return{top:(y.top-T.top+w.top)/E.y,bottom:(T.bottom-y.bottom+w.bottom)/E.y,left:(y.left-T.left+w.left)/E.x,right:(T.right-y.right+w.right)/E.x}}const mD=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:c,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,..._}=bi(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const y=Pr(o),v=es(a),S=Pr(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),T=g||(S||!C?[Ph(a)]:M4(a)),A=w!=="none";!g&&A&&T.push(...j4(a,C,w,E));const M=[a,...T],L=await Du(t,_),D=[];let U=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&D.push(L[y]),f){const Y=O4(o,h,E);D.push(L[Y[0]],L[Y[1]])}if(U=[...U,{placement:o,overflows:D}],!D.every(Y=>Y<=0)){var z,W;const Y=(((z=u.flip)==null?void 0:z.index)||0)+1,$=M[Y];if($&&(!(f==="alignment"?v!==es($):!1)||U.every(H=>es(H.placement)===v?H.overflows[0]>0:!0)))return{data:{index:Y,overflows:U},reset:{placement:$}};let V=(W=U.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:W.placement;if(!V)switch(b){case"bestFit":{var j;const q=(j=U.filter(H=>{if(A){const P=es(H.placement);return P===v||P==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(P=>P>0).reduce((P,B)=>P+B,0)]).sort((H,P)=>H[1]-P[1])[0])==null?void 0:j[0];q&&(V=q);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Gx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $x(e){return k4.some(t=>e[t]>=0)}const gD=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 Du(t,{...o,elementContext:"reference"}),h=Gx(u,n.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:$x(h)}}}case"escaped":{const u=await Du(t,{...o,altBoundary:!0}),h=Gx(u,n.floating);return{data:{escapedOffsets:h,escaped:$x(h)}}}default:return{}}}}},RE=new Set(["left","top"]);async function vD(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),h=Pr(n),a=bo(n),c=es(n)==="y",d=RE.has(h)?-1:1,p=u&&c?-1:1,f=bi(t,e);let{mainAxis:g,crossAxis:b,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(b=a==="end"?w*-1:w),c?{x:b*p,y:g*d}:{x:g*d,y:b*p}}const _D=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,c=await vD(t,e);return h===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:h}}}}},yD=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}}},...c}=bi(e,t),d={x:n,y:s},p=await Du(t,c),f=es(Pr(o)),g=o0(f);let b=d[g],w=d[f];if(u){const _=g==="y"?"top":"left",y=g==="y"?"bottom":"right",v=b+p[_],S=b-p[y];b=r_(v,b,S)}if(h){const _=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=w+p[_],S=w-p[y];w=r_(v,w,S)}const C=a.fn({...t,[g]:b,[f]:w});return{...C,data:{x:C.x-n,y:C.y-s,enabled:{[g]:u,[f]:h}}}}}},bD=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:c=!0,crossAxis:d=!0}=bi(e,t),p={x:n,y:s},f=es(o),g=o0(f);let b=p[g],w=p[f];const C=bi(a,t),_=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(c){const S=g==="y"?"height":"width",E=u.reference[g]-u.floating[S]+_.mainAxis,T=u.reference[g]+u.reference[S]-_.mainAxis;b<E?b=E:b>T&&(b=T)}if(d){var y,v;const S=g==="y"?"width":"height",E=RE.has(Pr(o)),T=u.reference[f]-u.floating[S]+(E&&((y=h.offset)==null?void 0:y[f])||0)+(E?0:_.crossAxis),A=u.reference[f]+u.reference[S]+(E?0:((v=h.offset)==null?void 0:v[f])||0)-(E?_.crossAxis:0);w<T?w=T:w>A&&(w=A)}return{[g]:b,[f]:w}}}},SD=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:c=()=>{},...d}=bi(e,t),p=await Du(t,d),f=Pr(o),g=bo(o),b=es(o)==="y",{width:w,height:C}=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=C-p.top-p.bottom,S=w-p.left-p.right,E=Vl(C-p[_],v),T=Vl(w-p[y],S),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=S),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=v),A&&!g){const U=Or(p.left,0),z=Or(p.right,0),W=Or(p.top,0),j=Or(p.bottom,0);b?L=w-2*(U!==0||z!==0?U+z:Or(p.left,p.right)):M=C-2*(W!==0||j!==0?W+j:Or(p.top,p.bottom))}await c({...t,availableWidth:L,availableHeight:M});const D=await h.getDimensions(a.floating);return w!==D.width||C!==D.height?{reset:{rects:!0}}:{}}}};function kE(e){const t=Ir(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Jt(e),u=o?e.offsetWidth:n,h=o?e.offsetHeight:s,a=Dh(n)!==u||Dh(s)!==h;return a&&(n=u,s=h),{width:n,height:s,$:a}}function f0(e){return Nt(e)?e:e.contextElement}function Ll(e){const t=f0(e);if(!Jt(t))return Is(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=kE(t);let h=(u?Dh(n.width):n.width)/s,a=(u?Dh(n.height):n.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!a||!Number.isFinite(a))&&(a=1),{x:h,y:a}}const xD=Is(0);function TE(e){const t=Cn(e);return!ap()||!t.visualViewport?xD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Cn(e)?!1:t}function wa(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=f0(e);let h=Is(1);t&&(s?Nt(s)&&(h=Ll(s)):h=Ll(e));const a=CD(u,n,s)?TE(u):Is(0);let c=(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=Cn(u),b=s&&Nt(s)?Cn(s):s;let w=g,C=Kv(w);for(;C&&s&&b!==w;){const _=Ll(C),y=C.getBoundingClientRect(),v=Ir(C),S=y.left+(C.clientLeft+parseFloat(v.paddingLeft))*_.x,E=y.top+(C.clientTop+parseFloat(v.paddingTop))*_.y;c*=_.x,d*=_.y,p*=_.x,f*=_.y,c+=S,d+=E,w=Cn(C),C=Kv(w)}}return Ih({width:p,height:f,x:c,y:d})}function hp(e,t){const n=lp(e).scrollLeft;return t?t.left+n:wa(Hs(e)).left+n}function LE(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 wD(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",h=Hs(s),a=t?op(t.floating):!1;if(s===h||a&&u)return n;let c={scrollLeft:0,scrollTop:0},d=Is(1);const p=Is(0),f=Jt(s);if((f||!f&&!u)&&((_o(s)!=="body"||Ra(h))&&(c=lp(s)),Jt(s))){const b=wa(s);d=Ll(s),p.x=b.x+s.clientLeft,p.y=b.y+s.clientTop}const g=h&&!f&&!u?LE(h,c):Is(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-c.scrollTop*d.y+p.y+g.y}}function ED(e){return Array.from(e.getClientRects())}function RD(e){const t=Hs(e),n=lp(e),s=e.ownerDocument.body,o=Or(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=Or(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+hp(e);const a=-n.scrollTop;return Ir(s).direction==="rtl"&&(h+=Or(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const Kx=25;function kD(e,t){const n=Cn(e),s=Hs(e),o=n.visualViewport;let u=s.clientWidth,h=s.clientHeight,a=0,c=0;if(o){u=o.width,h=o.height;const p=ap();(!p||p&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const d=hp(s);if(d<=0){const p=s.ownerDocument,f=p.body,g=getComputedStyle(f),b=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-b);w<=Kx&&(u-=w)}else d<=Kx&&(u+=d);return{width:u,height:h,x:a,y:c}}const TD=new Set(["absolute","fixed"]);function LD(e,t){const n=wa(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=Jt(e)?Ll(e):Is(1),h=e.clientWidth*u.x,a=e.clientHeight*u.y,c=o*u.x,d=s*u.y;return{width:h,height:a,x:c,y:d}}function Yx(e,t,n){let s;if(t==="viewport")s=kD(e,n);else if(t==="document")s=RD(Hs(e));else if(Nt(t))s=LD(t,n);else{const o=TE(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ih(s)}function AE(e,t){const n=Bs(e);return n===t||!Nt(n)||Ps(n)?!1:Ir(n).position==="fixed"||AE(n,t)}function AD(e,t){const n=t.get(e);if(n)return n;let s=co(e,[],!1).filter(a=>Nt(a)&&_o(a)!=="body"),o=null;const u=Ir(e).position==="fixed";let h=u?Bs(e):e;for(;Nt(h)&&!Ps(h);){const a=Ir(h),c=q_(h);!c&&a.position==="fixed"&&(o=null),(u?!c&&!o:!c&&a.position==="static"&&!!o&&TD.has(o.position)||Ra(h)&&!c&&AE(e,h))?s=s.filter(p=>p!==h):o=a,h=Bs(h)}return t.set(e,s),s}function OD(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?op(t)?[]:AD(t,this._c):[].concat(n),s],a=h[0],c=h.reduce((d,p)=>{const f=Yx(t,p,o);return d.top=Or(f.top,d.top),d.right=Vl(f.right,d.right),d.bottom=Vl(f.bottom,d.bottom),d.left=Or(f.left,d.left),d},Yx(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function MD(e){const{width:t,height:n}=kE(e);return{width:t,height:n}}function DD(e,t,n){const s=Jt(t),o=Hs(t),u=n==="fixed",h=wa(e,!0,u,t);let a={scrollLeft:0,scrollTop:0};const c=Is(0);function d(){c.x=hp(o)}if(s||!s&&!u)if((_o(t)!=="body"||Ra(o))&&(a=lp(t)),s){const b=wa(t,!0,u,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else o&&d();u&&!s&&o&&d();const p=o&&!s&&!u?LE(o,a):Is(0),f=h.left+a.scrollLeft-c.x-p.x,g=h.top+a.scrollTop-c.y-p.y;return{x:f,y:g,width:h.width,height:h.height}}function pv(e){return Ir(e).position==="static"}function Xx(e,t){if(!Jt(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Hs(e)===n&&(n=n.ownerDocument.body),n}function OE(e,t){const n=Cn(e);if(op(e))return n;if(!Jt(e)){let o=Bs(e);for(;o&&!Ps(o);){if(Nt(o)&&!pv(o))return o;o=Bs(o)}return n}let s=Xx(e,t);for(;s&&fO(s)&&pv(s);)s=Xx(s,t);return s&&Ps(s)&&pv(s)&&!q_(s)?n:s||vO(e)||n}const PD=async function(e){const t=this.getOffsetParent||OE,n=this.getDimensions,s=await n(e.floating);return{reference:DD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ID(e){return Ir(e).direction==="rtl"}const jD={convertOffsetParentRelativeRectToViewportRelativeRect:wD,getDocumentElement:Hs,getClippingRect:OD,getOffsetParent:OE,getElementRects:PD,getClientRects:ED,getDimensions:MD,getScale:Ll,isElement:Nt,isRTL:ID};function ME(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ND(e,t){let n=null,s;const o=Hs(e);function u(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function h(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),u();const d=e.getBoundingClientRect(),{left:p,top:f,width:g,height:b}=d;if(a||t(),!g||!b)return;const w=Cl(f),C=Cl(o.clientWidth-(p+g)),_=Cl(o.clientHeight-(f+b)),y=Cl(p),S={rootMargin:-w+"px "+-C+"px "+-_+"px "+-y+"px",threshold:Or(0,Vl(1,c))||1};let E=!0;function T(A){const M=A[0].intersectionRatio;if(M!==c){if(!E)return h();M?h(!1,M):s=setTimeout(()=>{h(!1,1e-7)},1e3)}M===1&&!ME(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,S)}n.observe(e)}return h(!0),u}function Qx(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:c=!1}=s,d=f0(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?ND(d,n):null;let g=-1,b=null;h&&(b=new ResizeObserver(y=>{let[v]=y;v&&v.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),n()}),d&&!c&&b.observe(d),b.observe(t));let w,C=c?wa(e):null;c&&_();function _(){const y=wa(e);C&&!ME(C,y)&&n(),C=y,w=requestAnimationFrame(_)}return n(),()=>{var y;p.forEach(v=>{o&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),f?.(),(y=b)==null||y.disconnect(),b=null,c&&cancelAnimationFrame(w)}}const BD=_D,zD=yD,HD=mD,VD=SD,FD=gD,UD=bD,WD=(e,t,n)=>{const s=new Map,o={platform:jD,...n},u={...o.platform,_c:s};return pD(e,t,{...o,platform:u})};var qD=typeof document<"u",GD=function(){},hh=qD?k.useLayoutEffect:GD;function zh(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(!zh(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)&&!zh(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function DE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zx(e,t){const n=DE(e);return Math.round(t*n)/n}function mv(e){const t=k.useRef(e);return hh(()=>{t.current=e}),t}function $D(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:c,open:d}=e,[p,f]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=k.useState(s);zh(g,s)||b(s);const[w,C]=k.useState(null),[_,y]=k.useState(null),v=k.useCallback(H=>{H!==A.current&&(A.current=H,C(H))},[]),S=k.useCallback(H=>{H!==M.current&&(M.current=H,y(H))},[]),E=u||w,T=h||_,A=k.useRef(null),M=k.useRef(null),L=k.useRef(p),D=c!=null,U=mv(c),z=mv(o),W=mv(d),j=k.useCallback(()=>{if(!A.current||!M.current)return;const H={placement:t,strategy:n,middleware:g};z.current&&(H.platform=z.current),WD(A.current,M.current,H).then(P=>{const B={...P,isPositioned:W.current!==!1};Y.current&&!zh(L.current,B)&&(L.current=B,Jn.flushSync(()=>{f(B)}))})},[g,t,n,z,W]);hh(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[d]);const Y=k.useRef(!1);hh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),hh(()=>{if(E&&(A.current=E),T&&(M.current=T),E&&T){if(U.current)return U.current(E,T,j);j()}},[E,T,j,U,D]);const $=k.useMemo(()=>({reference:A,floating:M,setReference:v,setFloating:S}),[v,S]),V=k.useMemo(()=>({reference:E,floating:T}),[E,T]),q=k.useMemo(()=>{const H={position:n,left:0,top:0};if(!V.floating)return H;const P=Zx(V.floating,p.x),B=Zx(V.floating,p.y);return a?{...H,transform:"translate("+P+"px, "+B+"px)",...DE(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:q}),[p,j,$,V,q])}const KD=(e,t)=>({...BD(e),options:[e,t]}),YD=(e,t)=>({...zD(e),options:[e,t]}),XD=(e,t)=>({...UD(e),options:[e,t]}),QD=(e,t)=>({...HD(e),options:[e,t]}),ZD=(e,t)=>({...VD(e),options:[e,t]}),JD=(e,t)=>({...FD(e),options:[e,t]}),e6={intentional:"onClick",sloppy:"onPointerDown"};function t6(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:c}=n.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:b=!1,referencePressEvent:w="sloppy",ancestorScroll:C=!1,bubbles:_,externalTree:y}=t,v=So(y),S=Oe(typeof f=="function"?f:()=>!1),E=typeof f=="function"?S:f,T=k.useRef(!1),{escapeKey:A,outsidePress:M}=t6(_),L=k.useRef(null),D=Qt(),U=Qt(),z=Oe(()=>{U.clear(),c.current.insideReactTree=!1}),W=k.useRef(!1),j=k.useRef(""),Y=Oe(ne=>{j.current=ne.pointerType}),$=Oe(()=>{const ne=j.current,oe=ne==="pen"||!ne?"mouse":ne,ce=typeof g=="function"?g():g;return typeof ce=="string"?ce:ce[oe]}),V=Oe(ne=>{if(!s||!d||!p||ne.key!=="Escape"||W.current)return;const oe=c.current.floatingContext?.nodeId,ce=v?fa(v.nodesRef.current,oe):[];if(!A&&ce.length>0){let he=!0;if(ce.forEach(fe=>{fe.context?.open&&!fe.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const _e=R4(ne)?ne.nativeEvent:ne,ve=Fe(cp,_e);n.setOpen(!1,ve),!A&&!ve.isPropagationAllowed&&ne.stopPropagation()}),q=Oe(ne=>{const oe=$();return oe==="intentional"&&ne.type!=="click"||oe==="sloppy"&&ne.type==="click"}),H=Oe(()=>{c.current.insideReactTree=!0,U.start(0,z)}),P=Oe((ne,oe=!1)=>{if(q(ne)){z();return}if(c.current.insideReactTree){z();return}if($()==="intentional"&&oe||typeof E=="function"&&!E(ne))return;const ce=An(ne),_e=`[${Ul("inert")}]`,ve=un(n.select("floatingElement")).querySelectorAll(_e),he=n.context.triggerElements;if(ce&&(he.hasElement(ce)||he.hasMatchingElement(Se=>dt(Se,ce))))return;let fe=Nt(ce)?ce:null;for(;fe&&!Ps(fe);){const Se=Bs(fe);if(Ps(Se)||!Nt(Se))break;fe=Se}if(ve.length&&Nt(ce)&&!w4(ce)&&!dt(ce,n.select("floatingElement"))&&Array.from(ve).every(Se=>!dt(fe,Se)))return;if(Jt(ce)&&!("touches"in ne)){const Se=Ps(ce),be=Ir(ce),ae=/auto|scroll/,xe=Se||ae.test(be.overflowX),Re=Se||ae.test(be.overflowY),Ue=xe&&ce.clientWidth>0&&ce.scrollWidth>ce.clientWidth,nt=Re&&ce.clientHeight>0&&ce.scrollHeight>ce.clientHeight,He=be.direction==="rtl",st=nt&&(He?ne.offsetX<=ce.offsetWidth-ce.clientWidth:ne.offsetX>ce.clientWidth),et=Ue&&ne.offsetY>ce.clientHeight;if(st||et)return}const De=c.current.floatingContext?.nodeId,Ae=v&&fa(v.nodesRef.current,De).some(Se=>fs(ne,Se.context?.elements.floating));if(fs(ne,n.select("floatingElement"))||fs(ne,n.select("domReferenceElement"))||Ae)return;const Pe=v?fa(v.nodesRef.current,De):[];if(Pe.length>0){let Se=!0;if(Pe.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__outsidePressBubbles&&(Se=!1)}),!Se)return}n.setOpen(!1,Fe(t0,ne)),z()}),B=Oe(ne=>{$()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!d||fs(ne,n.select("floatingElement"))||fs(ne,n.select("domReferenceElement"))||P(ne)}),I=Oe(ne=>{if($()!=="sloppy"||!n.select("open")||!d||fs(ne,n.select("floatingElement"))||fs(ne,n.select("domReferenceElement")))return;const oe=ne.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)}))}),G=Oe(ne=>{const oe=An(ne);function ce(){I(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)}),K=Oe(ne=>{const oe=T.current;if(T.current=!1,D.clear(),ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ce=An(ne);function _e(){ne.type==="pointerdown"?B(ne):P(ne,oe),ce?.removeEventListener(ne.type,_e)}ce?.addEventListener(ne.type,_e)}),J=Oe(ne=>{if($()!=="sloppy"||!L.current||fs(ne,n.select("floatingElement"))||fs(ne,n.select("domReferenceElement")))return;const oe=ne.touches[0];if(!oe)return;const ce=Math.abs(oe.clientX-L.current.startX),_e=Math.abs(oe.clientY-L.current.startY),ve=Math.sqrt(ce*ce+_e*_e);ve>5&&(L.current.dismissOnTouchEnd=!0),ve>10&&(P(ne),D.clear(),L.current=null)}),Z=Oe(ne=>{const oe=An(ne);function ce(){J(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)}),ee=Oe(ne=>{$()!=="sloppy"||!L.current||fs(ne,n.select("floatingElement"))||fs(ne,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&P(ne),D.clear(),L.current=null)}),X=Oe(ne=>{const oe=An(ne);function ce(){ee(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)});k.useEffect(()=>{if(!s||!d)return;c.current.__escapeKeyBubbles=A,c.current.__outsidePressBubbles=M;const ne=new Ca;function oe(fe){n.setOpen(!1,Fe(Pn,fe))}function ce(){ne.clear(),W.current=!0}function _e(){ne.start(ap()?5:0,()=>{W.current=!1})}const ve=un(o);ve.addEventListener("pointerdown",Y,!0),p&&(ve.addEventListener("keydown",V),ve.addEventListener("compositionstart",ce),ve.addEventListener("compositionend",_e)),E&&(ve.addEventListener("click",K,!0),ve.addEventListener("pointerdown",K,!0),ve.addEventListener("touchstart",G,!0),ve.addEventListener("touchmove",Z,!0),ve.addEventListener("touchend",X,!0),ve.addEventListener("mousedown",K,!0));let he=[];return C&&(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(fe=>fe!==ve.defaultView?.visualViewport),he.forEach(fe=>{fe.addEventListener("scroll",oe,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),p&&(ve.removeEventListener("keydown",V),ve.removeEventListener("compositionstart",ce),ve.removeEventListener("compositionend",_e)),E&&(ve.removeEventListener("click",K,!0),ve.removeEventListener("pointerdown",K,!0),ve.removeEventListener("touchstart",G,!0),ve.removeEventListener("touchmove",Z,!0),ve.removeEventListener("touchend",X,!0),ve.removeEventListener("mousedown",K,!0)),he.forEach(fe=>{fe.removeEventListener("scroll",oe)}),ne.clear()}},[c,o,u,h,p,E,s,a,C,d,A,M,V,P,K,B,G,Z,X,Y,n]),k.useEffect(z,[E,z]);const F=k.useMemo(()=>({onKeyDown:V,...b&&{[e6[w]]:ne=>{n.setOpen(!1,Fe(ua,ne.nativeEvent))},...w!=="intentional"&&{onClick(ne){n.setOpen(!1,Fe(ua,ne.nativeEvent))}}}}),[V,n,b,w]),se=Oe(ne=>{const oe=An(ne.nativeEvent);!dt(n.select("floatingElement"),oe)||ne.button!==0||(T.current=!0)}),re=k.useMemo(()=>({onKeyDown:V,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:H,onMouseDownCapture:H,onPointerDownCapture:H,onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,se,H]);return k.useMemo(()=>d?{reference:F,floating:re,trigger:F}:{},[d,F,re])}var Hh=Symbol("NOT_FOUND");function n6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function r6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function s6(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 Jx=e=>Array.isArray(e)?e:[e];function i6(e){const t=Array.isArray(e[0])?e[0]:e;return s6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function o6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function a6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Hh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function l6(e,t){let n=[];function s(a){const c=n.findIndex(d=>t(a,d.key));if(c>-1){const d=n[c];return c>0&&(n.splice(c,1),n.unshift(d)),d.value}return Hh}function o(a,c){s(a)===Hh&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function u(){return n}function h(){n=[]}return{get:s,put:o,getEntries:u,clear:h}}var c6=(e,t)=>e===t;function u6(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 d6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=c6,maxSize:o=1,resultEqualityCheck:u}=n,h=u6(s);let a=0;const c=o<=1?a6(h):l6(o,h);function d(){let p=c.get(arguments);if(p===Hh){if(p=e.apply(null,arguments),a++,u){const g=c.getEntries().find(b=>u(b.value,p));g&&(p=g.value,a!==0&&a--)}c.put(arguments,p)}return p}return d.clearCache=()=>{c.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var f6=class{constructor(e){this.value=e}deref(){return this.value}},h6=typeof WeakRef<"u"?WeakRef:f6,p6=0,eC=1;function Wf(){return{s:p6,v:void 0,o:null,p:null}}function PE(e,t={}){let n=Wf();const{resultEqualityCheck:s}=t;let o,u=0;function h(){let a=n;const{length:c}=arguments;for(let f=0,g=c;f<g;f++){const b=arguments[f];if(typeof b=="function"||typeof b=="object"&&b!==null){let w=a.o;w===null&&(a.o=w=new WeakMap);const C=w.get(b);C===void 0?(a=Wf(),w.set(b,a)):a=C}else{let w=a.p;w===null&&(a.p=w=new Map);const C=w.get(b);C===void 0?(a=Wf(),w.set(b,a)):a=C}}const d=a;let p;if(a.s===eC)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 h6(p):p}return d.s=eC,d.v=p,p}return h.clearCache=()=>{n=Wf(),h.resetResultsCount()},h.resultsCount=()=>u,h.resetResultsCount=()=>{u=0},h}function IE(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...o)=>{let u=0,h=0,a,c={},d=o.pop();typeof d=="object"&&(c=d,d=o.pop()),n6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...c},{memoize:f,memoizeOptions:g=[],argsMemoize:b=PE,argsMemoizeOptions:w=[]}=p,C=Jx(g),_=Jx(w),y=i6(o),v=f(function(){return u++,d.apply(null,arguments)},...C),S=b(function(){h++;const T=o6(y,arguments);return a=v.apply(null,T),a},..._);return Object.assign(S,{resultFunc:d,memoizedResultFunc:v,dependencies:y,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:b})};return Object.assign(s,{withTypes:()=>s}),s}var m6=IE(PE),g6=Object.assign((e,t=m6)=>{r6(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,c)=>(h[n[c]]=a,h),{}))},{withTypes:()=>g6});IE({memoize:d6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ee=(e,t,n,s,o,u,...h)=>{if(h.length>0)throw new Error(It(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var v6=$w();const _6=$_(19),y6=_6?b6:S6;function Le(e,t,n,s,o){return y6(e,t,n,s,o)}function b6(e,t,n,s,o){const u=k.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return v6.useSyncExternalStore(e.subscribe,u,u)}function S6(e,t,n,s,o){return Kw.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>t(u,n,s,o))}class ha{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])){ha.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||ha.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};ha.prototype.setState.call(this,t)}}class h0 extends ha{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){k.useDebugValue(t),Ne(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){Ne(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);Ne(()=>{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})),Ne(()=>{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=Oe(n??rn);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 x6={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 p0 extends h0{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:yE(),nested:n,noEmit:s,triggerElements:u},x6)}setOpen=(t,n)=>{if((!t||!this.state.open||rE(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),Ne(()=>{if(!e&&u&&s!=="ending"&&n){const a=Os.request(()=>{o("ending")});return()=>{Os.cancel(a)}}},[e,u,s,n]),Ne(()=>{if(!e||t)return;const a=Os.request(()=>{o(void 0)});return()=>{Os.cancel(a)}},[t,e]),Ne(()=>{if(!e||!t)return;e&&u&&s!=="idle"&&o("starting");const a=Os.request(()=>{o("idle")});return()=>{Os.cancel(a)}},[t,e,u,o,s]),k.useMemo(()=>({mounted:u,setMounted:h,transitionStatus:s}),[u,s])}function C6(e,t=!1,n=!0){const s=Ku();return Oe((o,u=null)=>{s.cancel();const h=Ko(e);h!=null&&(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():s.request(()=>{function a(){h&&Promise.all(h.getAnimations().map(c=>c.finished)).then(()=>{u!=null&&u.aborted||Jn.flushSync(o)}).catch(()=>{if(n){if(u!=null&&u.aborted)return;Jn.flushSync(o)}else h.getAnimations().length>0&&h.getAnimations().some(c=>c.pending||c.playState!=="finished")&&a()})}t?s.request(a):a()}))})}function zr(e){const{enabled:t=!0,open:n,ref:s,onComplete:o}=e,u=fn(n),h=Oe(o),a=C6(s,n);k.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function w6(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 jE(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=w6(e,n),h=Oe(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return Ne(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function NE(e){const t=e.useState("open");Ne(()=>{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 BE(e,t,n){const{mounted:s,setMounted:o,transitionStatus:u}=wi(e);t.useSyncedValues({mounted:s,transitionStatus:u});const h=Oe(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return zr({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 E6(){return new p0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new mp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function zE(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:E6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:en,inactiveTriggerProps:en,popupProps:en}}const HE={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 m0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Ta(),u=Ci()!=null,h=qn(()=>new p0({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 Ne(()=>{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 R6(e={}){const{nodeId:t,externalTree:n}=e,s=m0(e),o=e.rootContext||s,u={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[h,a]=k.useState(null),c=k.useRef(null),d=So(n);Ne(()=>{u.domReference&&(c.current=u.domReference)},[u.domReference]);const p=$D({...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,b]=k.useState(null),[w,C]=k.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",Nt(g)?g:null),o.useSyncedValue("floatingElement",w);const _=k.useCallback(M=>{(Nt(M)||M===null)&&(c.current=M,b(M)),(Nt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!Nt(M))&&p.refs.setReference(M)},[p.refs,b]),y=k.useCallback(M=>{C(M),p.refs.setFloating(M)},[p.refs]),v=k.useMemo(()=>({...p.refs,setReference:_,setFloating:y,setPositionReference:f,domReference:c}),[p.refs,_,y,f]),S=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:S,nodeId:t,rootStore:o}),[p,v,S,t,o,E,T]);return Ne(()=>{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:S,rootStore:o}),[p,v,S,A,o])}function VE(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:o}=e,u=Ta(),h=Ci()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),d=t.useState(s?"popupElement":"positionerElement"),p=t.context.triggerElements,f=qn(()=>new p0({open:a,referenceElement:c,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return Ne(()=>{const g={open:a,floatingId:u,referenceElement:c,floatingElement:d};Nt(c)&&(g.domReferenceElement=c),f.update(g)},[a,u,c,d,f]),f.context.onOpenChange=o,f.context.nested=h,f.context.noEmit=n,f}const gv=b4&&X2;function k6(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),c=Qt(),d=k.useRef(!0);k.useEffect(()=>{const f=n.select("domReferenceElement");if(!u)return;const g=Cn(f);function b(){!n.select("open")&&Jt(f)&&f===hs(un(f))&&(a.current=!0)}function w(){d.current=!0}function C(){d.current=!1}return g.addEventListener("blur",b),gv&&(g.addEventListener("keydown",w,!0),g.addEventListener("pointerdown",C,!0)),()=>{g.removeEventListener("blur",b),gv&&(g.removeEventListener("keydown",w,!0),g.removeEventListener("pointerdown",C,!0))}},[n,u]),k.useEffect(()=>{if(!u)return;function f(g){(g.reason===ua||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=An(f.nativeEvent);if(h&&Nt(g)){if(gv&&!f.relatedTarget){if(!d.current&&!i0(g))return}else if(!E4(g))return}n.setOpen(!0,Fe(Oh,f.nativeEvent,f.currentTarget))},onBlur(f){a.current=!1;const g=f.relatedTarget,b=f.nativeEvent,w=Nt(g)&&g.hasAttribute(Ul("focus-guard"))&&g.getAttribute("data-type")==="outside";c.start(0,()=>{const C=n.select("domReferenceElement"),_=hs(C?C.ownerDocument:document);!g&&_===C||dt(o.current.floatingContext?.refs.floating.current,_)||dt(C,_)||w||n.context.triggerElements.hasElement(f.relatedTarget)||n.setOpen(!1,Fe(Oh,b))})}}),[o,n,h,c]);return k.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const l_=Ul("safe-polygon"),T6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${eE}`;function L6(e){return e?!!e.closest(T6):!1}function FE(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),c=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:c,restTimeout:d,handleCloseOptionsRef:p}),f.hoverInteractionState},[e,t,n,s,o,u,h,a,c,d,p])}const A6=new Set(["click","mousedown"]);function O6(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:c=0,externalTree:d}=t,{pointerTypeRef:p,interactedInsideRef:f,handlerRef:g,performedPointerEventsMutationRef:b,unbindMouseMoveRef:w,restTimeoutPendingRef:C,openChangeTimeout:_,handleCloseOptionsRef:y}=FE(n),v=So(d),S=Ci(),E=Oe(()=>f.current?!0:h.current.openEvent?A6.has(h.current.openEvent.type):!1),T=Oe(()=>{const U=h.current.openEvent?.type;return U?.includes("mouse")&&U!=="mousedown"}),A=k.useCallback((U,z=!0)=>{const W=M6(c,p.current);W&&!g.current?_.start(W,()=>n.setOpen(!1,Fe(Dr,U))):z&&(_.clear(),n.setOpen(!1,Fe(Dr,U)))},[c,g,n,p,_]),M=Oe(()=>{w.current(),g.current=void 0}),L=Oe(()=>{if(b.current){const U=un(o).body;U.style.pointerEvents="",U.removeAttribute(l_),b.current=!1}}),D=Oe(U=>{const z=An(U);if(!L6(z)){f.current=!1;return}f.current=!0});Ne(()=>{s||(p.current=void 0,C.current=!1,f.current=!1,M(),L())},[s,p,C,f,M,L]),k.useEffect(()=>()=>{M()},[M]),k.useEffect(()=>L,[L]),Ne(()=>{if(a&&s&&y.current?.blockPointerEvents&&T()&&Nt(u)&&o){b.current=!0;const U=un(o).body;U.setAttribute(l_,"");const z=u,W=o,j=v?.nodesRef.current.find(Y=>Y.id===S)?.context?.elements.floating;return j&&(j.style.pointerEvents=""),U.style.pointerEvents="none",z.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{U.style.pointerEvents="",z.style.pointerEvents="",W.style.pointerEvents=""}}},[a,s,u,o,y,T,v,S,b]),k.useEffect(()=>{if(!a)return;function U(Y){if(E()||!h.current.floatingContext||!n.select("open"))return;const $=n.context.triggerElements;Y.relatedTarget&&$.hasElement(Y.relatedTarget)||(L(),M(),E()||A(Y))}function z(Y){_.clear(),L(),g.current?.(Y),M()}function W(Y){E()||A(Y,!1)}const j=o;return j&&(j.addEventListener("mouseleave",U),j.addEventListener("mouseenter",z),j.addEventListener("mouseleave",W),j.addEventListener("pointerdown",D,!0)),()=>{j&&(j.removeEventListener("mouseleave",U),j.removeEventListener("mouseenter",z),j.removeEventListener("mouseleave",W),j.removeEventListener("pointerdown",D,!0))}})}function M6(e,t){return t&&!Hl(t)?0:typeof e=="function"?e():e}function vv(e){return typeof e=="function"?e():e}const D6={current:null};function P6(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:c=!1,restMs:d=0,move:p=!0,triggerElementRef:f=D6,externalTree:g,isActiveTrigger:b=!0}=t,w=So(g),{pointerTypeRef:C,interactedInsideRef:_,handlerRef:y,blockMouseMoveRef:v,performedPointerEventsMutationRef:S,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=FE(n),D=fn(a),U=fn(h),z=fn(d);b&&(L.current=D.current?.__options);const W=Oe(()=>_.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),j=k.useCallback((q,H=!0)=>{const P=dv(U.current,"close",C.current);P&&!y.current?A.start(P,()=>n.setOpen(!1,Fe(Dr,q))):H&&(A.clear(),n.setOpen(!1,Fe(Dr,q)))},[U,y,n,C,A]),Y=Oe(()=>{E.current(),y.current=void 0}),$=Oe(()=>{if(S.current){const q=un(n.select("domReferenceElement")).body;q.style.pointerEvents="",q.removeAttribute(l_),S.current=!1}});k.useEffect(()=>{if(!u)return;function q(H){H.open||(A.clear(),M.clear(),v.current=!0,T.current=!1)}return o.on("openchange",q),()=>{o.off("openchange",q)}},[u,o,A,M,v,T]);const V=Oe(q=>{if(W()||!s.current.floatingContext)return;const H=n.context.triggerElements;if(q.relatedTarget&&H.hasElement(q.relatedTarget))return;const P=f.current;D.current?.({...s.current.floatingContext,tree:w,x:q.clientX,y:q.clientY,onClose(){$(),Y(),!W()&&P===n.select("domReferenceElement")&&j(q)}})(q)});return k.useEffect(()=>{if(!u)return;const q=f.current??(b?n.select("domReferenceElement"):null);if(!Nt(q))return;function H(I){if(A.clear(),v.current=!1,c&&!Hl(C.current)||vv(z.current)>0&&!dv(U.current,"open"))return;const G=dv(U.current,"open",C.current),K=n.select("domReferenceElement"),J=n.context.triggerElements,Z=(J.hasElement(I.target)||J.hasMatchingElement(F=>dt(F,I.target)))&&(!K||!dt(K,I.target)),ee=I.currentTarget??null,X=!n.select("open")||Z;G?A.start(G,()=>{X&&n.setOpen(!0,Fe(Dr,I,ee))}):X&&n.setOpen(!0,Fe(Dr,I,ee))}function P(I){if(W()){$();return}E.current();const G=n.select("domReferenceElement"),K=un(G);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:w,x:I.clientX,y:I.clientY,onClose(){$(),Y(),!W()&&ee===n.select("domReferenceElement")&&j(I,!0)}});const X=y.current;X(I),K.addEventListener("mousemove",X),E.current=()=>{K.removeEventListener("mousemove",X)};return}(C.current!=="touch"||!dt(n.select("floatingElement"),I.relatedTarget))&&j(I)}function B(I){V(I)}return n.select("open")&&q.addEventListener("mouseleave",B),p&&q.addEventListener("mousemove",H,{once:!0}),q.addEventListener("mouseenter",H),q.addEventListener("mouseleave",P),()=>{q.removeEventListener("mouseleave",B),p&&q.removeEventListener("mousemove",H),q.removeEventListener("mouseenter",H),q.removeEventListener("mouseleave",P)}},[Y,$,v,s,U,j,n,u,D,V,b,W,c,p,C,z,M,T,A,f,w,E,y]),k.useMemo(()=>{function q(H){C.current=H.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(H){const{nativeEvent:P}=H,B=H.currentTarget,I=n.select("domReferenceElement"),G=n.context.triggerElements,K=n.select("open"),J=(G.hasElement(H.target)||G.hasMatchingElement(ee=>dt(ee,H.target)))&&(!I||!dt(I,H.target));if(c&&!Hl(C.current)||K&&!J||vv(z.current)===0||!J&&T.current&&H.movementX**2+H.movementY**2<2)return;M.clear();function Z(){!v.current&&(!K||J)&&n.setOpen(!0,Fe(Dr,P,B))}C.current==="touch"?Jn.flushSync(()=>{Z()}):J&&K?Z():(T.current=!0,M.start(vv(z.current),Z))}}},[v,c,n,C,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=>qf(d,e,"reference"),t),h=k.useCallback(d=>qf(d,e,"floating"),n),a=k.useCallback(d=>qf(d,e,"item"),s),c=k.useCallback(d=>qf(d,e,"trigger"),o);return k.useMemo(()=>({getReferenceProps:u,getFloatingProps:h,getItemProps:a,getTriggerProps:c}),[u,h,a,c])}function qf(e,t,n){const s=new Map,o=n==="item",u={};n==="floating"&&(u.tabIndex=-1,u[t_]="");for(const h in e)o&&e&&(h===Z2||h===J2)||(u[h]=e[h]);for(let h=0;h<t.length;h+=1){let a;const c=t[h]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&tC(u,a,o,s)}return tC(u,e,o,s),u}function tC(e,t,n,s){for(const o in t){const u=t[o];n&&(o===Z2||o===J2)||(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 I6="Escape";function gp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Gf(e,t){return gp(t,e===s0||e===Gu,e===uo||e===fo)}function _v(e,t,n){return gp(t,e===Gu,n?e===uo:e===fo)||e==="Enter"||e===" "||e===""}function j6(e,t,n){return gp(t,n?e===uo:e===fo,e===Gu)}function N6(e,t,n,s){const o=n?e===fo:e===uo,u=e===s0;return t==="both"||t==="horizontal"&&s&&s>1?e===I6:gp(t,o,u)}function g0(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:c,onNavigate:d=()=>{},enabled:p=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:b=!1,nested:w=!1,rtl:C=!1,virtual:_=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:S=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:D,dense:U=!1,id:z,resetOnPointerLeave:W=!0,externalTree:j}=t,Y=Ou(o),$=fn(Y),V=Ci(),q=So(j);Ne(()=>{h.current.orientation=T},[h,T]);const H=n_(u),P=k.useRef(y),B=k.useRef(f??-1),I=k.useRef(null),G=k.useRef(!0),K=Oe(ae=>{d(B.current===-1?null:B.current,ae)}),J=k.useRef(K),Z=k.useRef(!!o),ee=k.useRef(s),X=k.useRef(!1),F=k.useRef(!1),se=fn(E),re=fn(s),ne=fn(L),oe=fn(f),ce=fn(W),_e=Oe(()=>{function ae(nt){_?q?.events.emit("virtualfocus",nt):fh(nt,{sync:X.current,preventScroll:!0})}const xe=a.current[B.current],Re=F.current;xe&&ae(xe),(X.current?nt=>nt():requestAnimationFrame)(()=>{const nt=a.current[B.current]||xe;if(!nt)return;xe||ae(nt);const He=ne.current;He&&he&&(Re||!G.current)&&nt.scrollIntoView?.(typeof He=="boolean"?{block:"nearest",inline:"nearest"}:He)})});Ne(()=>{p&&(s&&o?(B.current=f??-1,P.current&&f!=null&&(F.current=!0,K())):Z.current&&(B.current=-1,J.current()))},[p,s,o,f,K]),Ne(()=>{if(p){if(!s){X.current=!1;return}if(o)if(c==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 ae=0;const xe=()=>{a.current[0]==null?(ae<2&&(ae?requestAnimationFrame:queueMicrotask)(xe),ae+=1):(B.current=I.current==null||_v(I.current,T,C)||w?dh(a):i_(a),I.current=null,K())};xe()}}else Rl(a,c)||(B.current=c,_e(),F.current=!1)}},[p,s,o,c,oe,w,a,T,C,K,_e,se]),Ne(()=>{if(!p||o||!q||_||!Z.current)return;const ae=q.nodesRef.current,xe=ae.find(nt=>nt.id===V)?.context?.elements.floating,Re=hs(un(o)),Ue=ae.some(nt=>nt.context&&dt(nt.context.elements.floating,Re));xe&&!Ue&&G.current&&xe.focus({preventScroll:!0})},[p,o,q,V,_]),Ne(()=>{J.current=K,ee.current=s,Z.current=!!o}),Ne(()=>{s||(I.current=null,P.current=y)},[s,y]);const ve=c!=null,he=k.useMemo(()=>{function ae(Re){if(!re.current)return;const Ue=a.current.indexOf(Re.currentTarget);Ue!==-1&&B.current!==Ue&&(B.current=Ue,K(Re))}return{onFocus(Re){X.current=!0,ae(Re)},onClick:({currentTarget:Re})=>Re.focus({preventScroll:!0}),onMouseMove(Re){X.current=!0,F.current=!1,v&&ae(Re)},onPointerLeave(Re){if(!re.current||!G.current||Re.pointerType==="touch")return;X.current=!0;const Ue=Re.relatedTarget;!v||a.current.includes(Ue)||ce.current&&(B.current=-1,K(Re),_||$.current?.focus({preventScroll:!0}))}}},[re,$,v,a,K,ce,_]),fe=k.useCallback(()=>A??q?.nodesRef.current.find(ae=>ae.id===V)?.context?.dataRef?.current.orientation,[V,q,A]),De=Oe(ae=>{if(G.current=!1,X.current=!0,ae.which===229||!re.current&&ae.currentTarget===$.current)return;if(w&&N6(ae.key,T,C,M)){Gf(ae.key,fe())||dn(ae),n.setOpen(!1,Fe(wu,ae.nativeEvent)),Jt(u)&&(_?q?.events.emit("virtualfocus",u):u.focus());return}const xe=B.current,Re=dh(a,E),Ue=i_(a,E);if(H||(ae.key==="Home"&&(dn(ae),B.current=Re,K(ae)),ae.key==="End"&&(dn(ae),B.current=Ue,K(ae))),M>1){const nt=D||Array.from({length:a.current.length},()=>({width:1,height:1})),He=oE(nt,M,U),st=He.findIndex(qe=>qe!=null&&!ho(a,qe,E)),et=He.reduce((qe,$e,ue)=>$e!=null&&!ho(a,$e,E)?ue:qe,-1),ht=He[iE({current:He.map(qe=>qe!=null?a.current[qe]:null)},{event:ae,orientation:T,loopFocus:b,rtl:C,cols:M,disabledIndices:lE([...(typeof E!="function"?E:null)||a.current.map((qe,$e)=>ho(a,$e,E)?$e:void 0),void 0],He),minIndex:st,maxIndex:et,prevIndex:aE(B.current>Ue?Re:B.current,nt,He,M,ae.key===Gu?"bl":ae.key===(C?uo:fo)?"tr":"tl"),stopEvent:!0})];if(ht!=null&&(B.current=ht,K(ae)),T==="both")return}if(Gf(ae.key,T)){if(dn(ae),s&&!_&&hs(ae.currentTarget.ownerDocument)===ae.currentTarget){B.current=_v(ae.key,T,C)?Re:Ue,K(ae);return}_v(ae.key,T,C)?b?xe>=Ue?g&&xe!==a.current.length?B.current=-1:(X.current=!1,B.current=Re):B.current=Un(a,{startingIndex:xe,disabledIndices:E}):B.current=Math.min(Ue,Un(a,{startingIndex:xe,disabledIndices:E})):b?xe<=Re?g&&xe!==-1?B.current=a.current.length:(X.current=!1,B.current=Ue):B.current=Un(a,{startingIndex:xe,decrement:!0,disabledIndices:E}):B.current=Math.max(Re,Un(a,{startingIndex:xe,decrement:!0,disabledIndices:E})),Rl(a,B.current)&&(B.current=-1),K(ae)}}),Ae=k.useMemo(()=>_&&s&&ve&&{"aria-activedescendant":`${z}-${c}`},[_,s,ve,z,c]),Pe=k.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...H?{}:Ae,onKeyDown(ae){if(ae.key==="Tab"&&ae.shiftKey&&s&&!_){const xe=An(ae.nativeEvent);if(xe&&!dt($.current,xe))return;dn(ae),n.setOpen(!1,Fe(xa,ae.nativeEvent)),Jt(u)&&u.focus();return}De(ae)},onPointerMove(){G.current=!0}}),[Ae,De,$,T,H,n,s,_,u]),Se=k.useMemo(()=>{function ae(Re){y==="auto"&&tE(Re.nativeEvent)&&(P.current=!_)}function xe(Re){P.current=y,y==="auto"&&nE(Re.nativeEvent)&&(P.current=!0)}return{onKeyDown(Re){const Ue=n.select("open");G.current=!1;const nt=Re.key.startsWith("Arrow"),He=j6(Re.key,fe(),C),st=Gf(Re.key,T),et=(w?He:st)||Re.key==="Enter"||Re.key.trim()==="";if(_&&Ue)return De(Re);if(!(!Ue&&!S&&nt)){if(et){const ht=Gf(Re.key,fe());I.current=w&&ht?null:Re.key}if(w){He&&(dn(Re),Ue?(B.current=dh(a,se.current),K(Re)):n.setOpen(!0,Fe(wu,Re.nativeEvent,Re.currentTarget)));return}st&&(oe.current!=null&&(B.current=oe.current),dn(Re),!Ue&&S?n.setOpen(!0,Fe(wu,Re.nativeEvent,Re.currentTarget)):De(Re),Ue&&K(Re))}},onFocus(Re){n.select("open")&&!_&&(B.current=-1,K(Re))},onPointerDown:xe,onPointerEnter:xe,onMouseDown:ae,onClick:ae}},[De,se,y,a,w,K,n,S,T,fe,C,oe,_]),be=k.useMemo(()=>({...Ae,...Se}),[Ae,Se]);return k.useMemo(()=>p?{reference:be,floating:Pe,item:he,trigger:Se}:{},[p,be,Pe,Se,he])}const B6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function UE(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:c="dialog"}=t,d=Ta(),p=u?.id||d,f=k.useMemo(()=>Ou(h)?.id||o,[h,o]),g=B6.get(c)??c,w=Ci()!=null,C=k.useMemo(()=>g==="tooltip"||c==="label"?en:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&w&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[g,w,c]),_=k.useMemo(()=>g==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:s?f:void 0}:{...C,"aria-expanded":s?"true":"false","aria-controls":s?f:void 0,...g==="menu"&&{id:p}},[g,f,s,p,c,C]),y=k.useMemo(()=>{const S={id:f,...g&&{role:g}};return g==="tooltip"||c==="label"?S:{...S,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,c]),v=k.useCallback(({active:S,selected:E})=>{const T={role:"option",...S&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[f,c]);return k.useMemo(()=>a?{reference:_,floating:y,item:v,trigger:C}:{},[a,_,y,C,v])}function v0(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:c,enabled:d=!0,findMatch:p=null,resetMs:f=750,ignoreKeys:g=mr,selectedIndex:b=null}=t,w=Qt(),C=k.useRef(""),_=k.useRef(b??h??-1),y=k.useRef(null);Ne(()=>{s&&(w.clear(),y.current=null,C.current="")},[s,w]),Ne(()=>{s&&C.current===""&&(_.current=b??h??-1)},[s,b,h]);const v=Oe(A=>{A?o.current.typing||(o.current.typing=A,c?.(A)):o.current.typing&&(o.current.typing=A,c?.(A))}),S=Oe(A=>{function M(W,j,Y){const $=p?p(j,Y):j.find(V=>V?.toLocaleLowerCase().indexOf(Y.toLocaleLowerCase())===0);return $?W.indexOf($):-1}const L=u.current;if(C.current.length>0&&C.current[0]!==" "&&(M(L,L,C.current)===-1?v(!1):A.key===" "&&dn(A)),L==null||g.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(dn(A),v(!0)),L.every(W=>W?W[0]?.toLocaleLowerCase()!==W[1]?.toLocaleLowerCase():!0)&&C.current===A.key&&(C.current="",_.current=y.current),C.current+=A.key,w.start(f,()=>{C.current="",_.current=y.current,v(!1)});const U=_.current,z=M(L,[...L.slice((U||0)+1),...L.slice(0,(U||0)+1)],C.current);z!==-1?(a?.(z),y.current=z):A.key!==" "&&(C.current="",v(!1))}),E=k.useMemo(()=>({onKeyDown:S}),[S]),T=k.useMemo(()=>({onKeyDown:S,onKeyUp(A){A.key===" "&&v(!1)}}),[S,v]);return k.useMemo(()=>d?{reference:E,floating:T}:{},[d,E,T])}function nC(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[c,d]=t[h]||[0,0],[p,f]=t[a]||[0,0];d>=s!=f>=s&&n<=(p-c)*(s-d)/(f-d)+c&&(o=!o)}return o}function z6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function H6(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,o=new Ca;let u=!1,h=null,a=null,c=typeof performance<"u"?performance.now():0;function d(f,g){const b=performance.now(),w=b-c;if(h===null||a===null||w===0)return h=f,a=g,c=b,null;const C=f-h,_=g-a,v=Math.sqrt(C*C+_*_)/w;return h=f,a=g,c=b,v}const p=({x:f,y:g,placement:b,elements:w,onClose:C,nodeId:_,tree:y})=>function(S){function E(){o.clear(),C()}if(o.clear(),!w.domReference||!w.floating||b==null||f==null||g==null)return;const{clientX:T,clientY:A}=S,M=[T,A],L=An(S),D=S.type==="mouseleave",U=dt(w.floating,L),z=dt(w.domReference,L),W=w.domReference.getBoundingClientRect(),j=w.floating.getBoundingClientRect(),Y=b.split("-")[0],$=f>j.right-j.width/2,V=g>j.bottom-j.height/2,q=z6(M,W),H=j.width>W.width,P=j.height>W.height,B=(H?W:j).left,I=(H?W:j).right,G=(P?W:j).top,K=(P?W:j).bottom;if(U&&(u=!0,!D))return;if(z&&(u=!1),z&&!D){u=!0;return}if(D&&Nt(S.relatedTarget)&&dt(w.floating,S.relatedTarget)||y&&fa(y.nodesRef.current,_).some(({context:ee})=>ee?.open))return;if(Y==="top"&&g>=W.bottom-1||Y==="bottom"&&g<=W.top+1||Y==="left"&&f>=W.right-1||Y==="right"&&f<=W.left+1)return E();let J=[];switch(Y){case"top":J=[[B,W.top+1],[B,j.bottom-1],[I,j.bottom-1],[I,W.top+1]];break;case"bottom":J=[[B,j.top+1],[B,W.bottom-1],[I,W.bottom-1],[I,j.top+1]];break;case"left":J=[[j.right-1,K],[j.right-1,G],[W.left+1,G],[W.left+1,K]];break;case"right":J=[[W.right-1,K],[W.right-1,G],[j.left+1,G],[j.left+1,K]];break}function Z([ee,X]){switch(Y){case"top":{const F=[H?ee+t/2:$?ee+t*4:ee-t*4,X+t+1],se=[H?ee-t/2:$?ee+t*4:ee-t*4,X+t+1],re=[[j.left,$||H?j.bottom-t:j.top],[j.right,$?H?j.bottom-t:j.top:j.bottom-t]];return[F,se,...re]}case"bottom":{const F=[H?ee+t/2:$?ee+t*4:ee-t*4,X-t],se=[H?ee-t/2:$?ee+t*4:ee-t*4,X-t],re=[[j.left,$||H?j.top+t:j.bottom],[j.right,$?H?j.top+t:j.bottom:j.top+t]];return[F,se,...re]}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],re=[[V||P?j.left+t:j.right,j.top],[V?P?j.left+t:j.right:j.left+t,j.bottom]];return[F,se,...re]}default:return[]}}if(!nC([T,A],J)){if(u&&!q)return E();if(!D&&s){const ee=d(S.clientX,S.clientY);if(ee!==null&&ee<.1)return E()}nC([T,A],Z([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let V6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),F6=(function(e){return e[e.open=ea.open]="open",e[e.closed=ea.closed]="closed",e[e.startingStyle=ea.startingStyle]="startingStyle",e[e.endingStyle=ea.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const WE=k.createContext(void 0);function U6(){const e=k.useContext(WE);if(e===void 0)throw new Error(It(26));return e}const Al="ArrowUp",na="ArrowDown",Pu="ArrowLeft",Ol="ArrowRight",Xu="Home",Qu="End",qE=new Set([Pu,Ol]),W6=new Set([Pu,Ol,Xu,Qu]),GE=new Set([Al,na]),q6=new Set([Al,na,Xu,Qu]),$E=new Set([...qE,...GE]),G6=new Set([...$E,Xu,Qu]),_0=new Set([Al,na,Pu,Ol,Xu,Qu]),$6="Shift",K6="Control",Y6="Alt",X6="Meta",Q6=new Set([$6,K6,Y6,X6]);function Z6(e){return Jt(e)&&e.tagName==="INPUT"}function rC(e){return!!(Z6(e)&&e.selectionStart!=null||Jt(e)&&e.tagName==="TEXTAREA")}function sC(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 c=iC(e,t,"left"),d=$f(e),p=$f(t);n==="ltr"&&(c+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?o=c+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:c-p.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(o=c-p.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(c-p.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?o=c-p.scrollMarginLeft-d.scrollPaddingLeft:c+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(o=c+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(a&&s!=="horizontal"){const c=iC(e,t,"top"),d=$f(e),p=$f(t);c-p.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?u=c-p.scrollMarginTop-d.scrollPaddingTop:c+t.offsetHeight+p.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(u=c+t.offsetHeight+p.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:o,top:u,behavior:"auto"})}function iC(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 $f(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 J6={...yo,...Vs,nestedDialogOpen(e){return e?{[F6.nestedDialogOpen]:""}:null}},KE=k.forwardRef(function(t,n){const{className:s,finalFocus:o,initialFocus:u,render:h,...a}=t,{store:c}=xi(),d=c.useState("descriptionElementId"),p=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),g=c.useState("popupProps"),b=c.useState("modal"),w=c.useState("mounted"),C=c.useState("nested"),_=c.useState("nestedOpenDialogCount"),y=c.useState("open"),v=c.useState("openMethod"),S=c.useState("titleElementId"),E=c.useState("transitionStatus"),T=c.useState("role");U6(),zr({open:y,ref:c.context.popupRef,onComplete(){y&&c.context.onOpenChangeComplete?.(!0)}});function A(z){return z==="touch"?c.context.popupRef.current:!0}const M=u===void 0?A:u,L=_>0,D=k.useMemo(()=>({open:y,nested:C,transitionStatus:E,nestedDialogOpen:L}),[y,C,E,L]),U=ut("div",t,{state:D,props:[g,{"aria-labelledby":S??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!w,onKeyDown(z){_0.has(z.key)&&z.stopPropagation()},style:{[V6.nestedDialogs]:_}},a],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:J6});return x.jsx(fp,{context:f,openInteractionType:v,disabled:!w,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:b!==!1,restoreFocus:"popup",children:U})});function vp(e){return $_(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 x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),YE=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=xi(),h=u.useState("mounted"),a=u.useState("modal");return h||s?x.jsx(WE.Provider,{value:s,children:x.jsxs(dp,{ref:n,...o,children:[h&&a===!0&&x.jsx(_p,{ref:u.context.internalBackdropRef,inert:vp(!open)}),t.children]})}):null});let oC={},aC={},lC="";function e8(e){if(typeof document>"u")return!1;const t=gr(e);return Cn(t).innerWidth-t.documentElement.clientWidth>0}function t8(e){const t=gr(e),n=t.documentElement,s=t.body,o=Ra(n)?n:s,u=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=u}}function n8(e){const t=gr(e),n=t.documentElement,s=t.body,o=Cn(n);let u=0,h=0;const a=Os.create(),c=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(r0&&(o.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),b=o.getComputedStyle(s),_=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,h=n.scrollLeft,oC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},lC=n.style.scrollBehavior,aC={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,S=g.overflowY==="scroll"||b.overflowY==="scroll",E=g.overflowX==="scroll"||b.overflowX==="scroll",T=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),M=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),D=Ra(n)?n:s;if(c){n.style.scrollbarGutter=_,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:_,overflowY:"hidden",overflowX:"hidden"}),(y||S)&&(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,oC),Object.assign(s.style,aC),c||(n.scrollTop=u,n.scrollLeft=h,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=lC)}function f(){p(),a.request(d)}return d(),o.addEventListener("resize",f),()=>{a.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class r8{lockCount=0;restore=null;timeoutLock=Ca.create();timeoutUnlock=Ca.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=gr(t).documentElement,o=Cn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=rn;return}const u=y4||!e8(t);this.restore=u?t8(t):n8(t)}}const s8=new r8;function yp(e=!0,t=null){Ne(()=>{if(e)return s8.acquire(t)},[e,t])}function i8(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=Oe((a,c)=>{e||n(c)}),o=k.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:h}=i8(s);return k.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function XE(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:c,triggerProps:d,reset:p}=bp(o);NE(t);const{forceUnmount:f}=BE(o,t,()=>{p()}),g=Oe(U=>{const z=Fe(U);return z.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},z}),b=k.useCallback(()=>{t.setOpen(!1,g(G2))},[t,g]);k.useImperativeHandle(s,()=>({unmount:f,close:b}),[f,b]);const w=VE({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,_]=k.useState(0),y=C===0,v=UE(w),S=pp(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(U){if("button"in U&&U.button!==0||"touches"in U&&U.touches.length!==1)return!1;const z=An(U);if(y&&!u){const W=z;return h&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===W||t.context.backdropRef.current===W||dt(W,a)&&!W?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});yp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=rc([v,S]);t.useContextCallback("onNestedDialogOpen",U=>{_(U+1)}),t.useContextCallback("onNestedDialogClose",()=>{_(0)}),k.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(C),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,C]);const M=k.useMemo(()=>E(d),[E,d]),L=k.useMemo(()=>A(d),[A,d]),D=k.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:c,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:D,floatingRootContext:w,nestedOpenDialogCount:C})}const o8={...HE,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 QE extends h0{constructor(t){super(a8(t),{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),triggerElements:new mp,onOpenChange:void 0,onOpenChangeComplete:void 0},o8)}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 a8(e={}){return{...zE(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function l8(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,disablePointerDismissal:h=!1,modal:a=!0,actionsRef:c,handle:d,triggerId:p,defaultTriggerId:f=null}=e,g=xi(!0),b=!!g,w=qn(()=>d?.store??new QE({open:n??s,activeTriggerId:p!==void 0?p:f,modal:a,disablePointerDismissal:h,nested:b})).current;w.useControlledProp("open",n,s),w.useControlledProp("activeTriggerId",p,f),w.useSyncedValues({disablePointerDismissal:h,nested:b,modal:a}),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",u);const C=w.useState("payload");XE({store:w,actionsRef:c,parentContext:g?.store.context});const _=k.useMemo(()=>({store:w}),[w]);return x.jsx(J_.Provider,{value:_,children:typeof t=="function"?t({payload:C}):t})}const ZE=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=xi(),c=jr(u);return a.useSyncedValueWithCleanup("titleElementId",c),ut("h2",t,{ref:n,props:[{id:c},h]})}),JE=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,payload:c,handle:d,...p}=t,f=xi(!0),g=d?.store??f?.store;if(!g)throw new Error(It(79));const b=jr(a),w=g.useState("floatingRootContext"),C=g.useState("isOpenedByTrigger",b),_=k.useRef(null),{registerTrigger:y,isMountedByThisTrigger:v}=jE(b,_,g,{payload:c}),{getButtonProps:S,buttonRef:E}=Br({disabled:u,native:h}),T=Yu(w,{enabled:w!=null}),A=rc([T]),M=k.useMemo(()=>({disabled:u,open:C}),[u,C]),L=g.useState("triggerProps",v);return ut("button",t,{state:M,ref:[E,n,y,_],props:[A.getReferenceProps(),L,{[g2]:"",id:b},p,S],stateAttributesMapping:e0})});function Ms({...e}){return x.jsx(l8,{"data-slot":"dialog",...e})}function eR({...e}){return x.jsx(JE,{"data-slot":"dialog-trigger",...e})}function c8({...e}){return x.jsx(YE,{"data-slot":"dialog-portal",...e})}function y0({...e}){return x.jsx(up,{"data-slot":"dialog-close",...e})}function u8({className:e,...t}){return x.jsx(W2,{"data-slot":"dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ds({className:e,children:t,showCloseButton:n=!0,...s}){return x.jsxs(c8,{children:[x.jsx(u8,{}),x.jsxs(KE,{"data-slot":"dialog-content",className:Be("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...s,children:[t,n&&x.jsxs(up,{"data-slot":"dialog-close",render:x.jsx(ze,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[x.jsx(Ce,{icon:go,strokeWidth:2}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function vi({className:e,...t}){return x.jsx("div",{"data-slot":"dialog-header",className:Be("gap-1 flex flex-col",e),...t})}function pa({className:e,showCloseButton:t=!1,children:n,...s}){return x.jsxs("div",{"data-slot":"dialog-footer",className:Be("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&x.jsx(up,{render:x.jsx(ze,{variant:"outline"}),children:"Close"})]})}function _i({className:e,...t}){return x.jsx(ZE,{"data-slot":"dialog-title",className:Be("text-sm font-medium",e),...t})}function ra({className:e,...t}){return x.jsx($2,{"data-slot":"dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}let cC=(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 d8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Aa={valid(e){return e===null?null:e?{[cC.valid]:""}:{[cC.invalid]:""}}},f8=k.createContext({invalid:void 0,name:void 0,validityData:{state:d8,errors:[],error:"",value:"",initialValue:null},setValidityData:rn,disabled:void 0,touched:!1,setTouched:rn,dirty:!1,setDirty:rn,filled:!1,setFilled:rn,focused:!1,setFocused:rn,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=en)=>e,getInputValidationProps:(e=en)=>e,inputRef:{current:null},commit:async()=>{}}});function is(e=!0){const t=k.useContext(f8);if(t.setValidityData===rn&&!e)throw new Error(It(28));return t}const h8=k.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:rn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Zu(){return k.useContext(h8)}const p8=k.createContext({controlId:void 0,setControlId:rn,labelId:void 0,setLabelId:rn,messageIds:[],setMessageIds:rn,getDescriptionProps:e=>e});function xo(){return k.useContext(p8)}function m8(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function js({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,c=k.useCallback(d=>{o||h(d)},[]);return[a,c]}function Sp(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:o,setControlId:u}=xo(),h=jr(t);return Ne(()=>{if(!(!n&&!t||u===rn)){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 Ju(e){const{enabled:t=!0,value:n,id:s,name:o,controlRef:u,commit:h}=e,{formRef:a}=Zu(),{invalid:c,markedDirtyRef:d,validityData:p,setValidityData:f}=is(),g=Oe(e.getValue);Ne(()=>{if(!t)return;let b=n;b===void 0&&(b=g()),p.initialValue===null&&b!==null&&f(w=>({...w,initialValue:b}))},[t,f,n,p.initialValue,g]),Ne(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:m8(p,c),validate(){let b=n;b===void 0&&(b=g()),d.current=!0,Jn.flushSync(()=>h(b))}})},[h,u,t,a,g,s,c,d,o,p,n]),Ne(()=>{const b=a.current.fields;return()=>{s&&b.delete(s)}},[a,s])}const g8=k.forwardRef(function(t,n){const{render:s,className:o,id:u,name:h,value:a,disabled:c=!1,onValueChange:d,defaultValue:p,...f}=t,{state:g,name:b,disabled:w}=is(),C=w||c,_=b??h,y=k.useMemo(()=>({...g,disabled:C}),[g,C]),{setTouched:v,setDirty:S,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=is(),{labelId:D}=xo(),U=Sp({id:u});Ne(()=>{const V=a!=null;L.inputRef.current?.value||V&&a!==""?A(!0):V&&a===""&&A(!1)},[L.inputRef,A,a]);const[z,W]=js({controlled:a,default:p,name:"FieldControl",state:"value"}),j=a!==void 0,Y=Oe((V,q)=>{d?.(V,q),!q.isCanceled&&W(V)});return Ju({id:U,name:_,commit:L.commit,value:z,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),ut("input",t,{ref:n,state:y,props:[{id:U,disabled:C,name:_,ref:L.inputRef,"aria-labelledby":D,...j?{value:z}:{defaultValue:p},onChange(V){const q=V.currentTarget.value;Y(q,Fe(Pn,V.nativeEvent)),S(q!==E.initialValue),A(q!=="")},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:Aa})}),v8=k.createContext({disabled:!1});function _8(){return k.useContext(v8)}const y8=k.createContext(void 0);function b8(e=!0){const t=k.useContext(y8);if(t===void 0&&!e)throw new Error(It(3));return t}const S8=k.forwardRef(function(t,n){return x.jsx(g8,{ref:n,...t})});function qt({className:e,type:t,...n}){return x.jsx(S8,{type:t,"data-slot":"input",className:Be("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function xp({className:e,...t}){return x.jsx("textarea",{"data-slot":"textarea",className:Be("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function x8({className:e,...t}){return x.jsx("label",{"data-slot":"label",className:Be("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const C8=k.forwardRef(function(t,n){const{className:s,render:o,orientation:u="horizontal",...h}=t,a=k.useMemo(()=>({orientation:u}),[u]);return ut("div",t,{state:a,ref:n,props:[{role:"separator","aria-orientation":u},h]})});function w8({className:e,orientation:t="horizontal",...n}){return x.jsx(C8,{"data-slot":"separator",orientation:t,className:Be("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function Cp({className:e,...t}){return x.jsx("div",{"data-slot":"field-group",className:Be("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const E8=Xl("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 In({className:e,orientation:t="vertical",...n}){return x.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Be(E8({orientation:t}),e),...n})}function jn({className:e,...t}){return x.jsx(x8,{"data-slot":"field-label",className:Be("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function gi({className:e,...t}){return x.jsx("p",{"data-slot":"field-description",className:Be("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function tR(e){const t=k.useRef(!0);t.current&&(t.current=!1,e())}const nR=k.createContext(null),rR=k.createContext(null);function Fs(){const e=k.useContext(nR);if(e===null)throw new Error(It(60));return e}function sR(){const e=k.useContext(rR);if(e===null)throw new Error(It(61));return e}const iR=(e,t)=>Object.is(e,t);function Si(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function sa(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Si(s,t,n))}function ql(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Si(s,t,n))}function oR(e,t,n){return e.filter(s=>!Si(s,t,n))}function c_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function aR(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function kn(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 c_(e)}function ps(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?c_(e.value):c_(e)}function R8(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]??kn(e,n);if(Array.isArray(t)){const s=aR(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:kn(e,n)}if(typeof e!="object"){const o=s.find(u=>u&&u.value===e);return o&&o.label!=null?o.label:kn(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 kn(e,n)}function k8(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>kn(n,t)).join(", ")}const ft={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=>Si(u,n,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Si(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?"":ps(n,s)})};function ia(e,t){const n=k.useRef(e),s=Oe(t);Ne(()=>{n.current!==e&&s(n.current)},[e,s]),Ne(()=>{n.current=e},[e])}function T8(e){const{id:t,value:n,defaultValue:s=null,onValueChange:o,open:u,defaultOpen:h=!1,onOpenChange:a,name:c,disabled:d=!1,readOnly:p=!1,required:f=!1,modal:g=!0,actionsRef:b,inputRef:w,onOpenChangeComplete:C,items:_,multiple:y=!1,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E=iR,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=Zu(),{setDirty:L,shouldValidateOnChange:D,validityData:U,setFilled:z,name:W,disabled:j,validation:Y}=is(),{controlId:$}=xo(),V=Sp({id:t}),q=j||d,H=W??c,[P,B]=js({controlled:n,default:y?s??mr:s,name:"Select",state:"value"}),[I,G]=js({controlled:u,default:h,name:"Select",state:"open"}),K=k.useRef([]),J=k.useRef([]),Z=k.useRef(null),ee=k.useRef(null),X=k.useRef(0),F=k.useRef(null),se=k.useRef([]),re=k.useRef(!1),ne=k.useRef(!1),oe=k.useRef(null),ce=k.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),_e=k.useRef(!1),{mounted:ve,setMounted:he,transitionStatus:fe}=wi(I),{openMethod:De,triggerProps:Ae,reset:Pe}=bp(I),Se=qn(()=>new ha({id:V,modal:g,multiple:y,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E,value:P,open:I,mounted:ve,transitionStatus:fe,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,be=Le(Se,ft.activeIndex),ae=Le(Se,ft.selectedIndex),xe=Le(Se,ft.triggerElement),Re=Le(Se,ft.positionerElement),Ue=k.useMemo(()=>y&&Array.isArray(P)&&P.length===0?"":ps(P,S),[y,P,S]),nt=k.useMemo(()=>y&&Array.isArray(P)?P.map(at=>ps(at,S)):ps(P,S),[y,P,S]),He=fn(Se.state.triggerElement);Ju({id:V,commit:Y.commit,value:P,controlRef:He,name:H,getValue:()=>nt});const st=k.useRef(P);Ne(()=>{P!==st.current&&Se.set("forceMount",!0)},[Se,P]),Ne(()=>{z(P!==null)},[P,z]),Ne(function(){if(I)return;const wt=se.current;if(y){const St=Array.isArray(P)?P:[];if(St.length===0){Se.set("selectedIndex",null);return}const Qe=St[St.length-1],Ht=ql(wt,Qe,E);Se.set("selectedIndex",Ht===-1?null:Ht);return}const bt=ql(wt,P,E);Se.set("selectedIndex",bt===-1?null:bt)},[y,I,P,se,E,Se]),ia(P,()=>{M(H),L(P!==U.initialValue),D()?Y.commit(P):Y.commit(P,!0)});const et=Oe((at,wt)=>{if(a?.(at,wt),!wt.isCanceled&&(G(at),!at&&Se.state.activeIndex!==null)){const bt=K.current[Se.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),ht=Oe(()=>{he(!1),Se.set("activeIndex",null),Pe(),C?.(!1)});zr({enabled:!b,open:I,ref:Z,onComplete(){I||ht()}}),k.useImperativeHandle(b,()=>({unmount:ht}),[ht]);const qe=Oe((at,wt)=>{o?.(at,wt),!wt.isCanceled&&B(at)}),$e=Oe(()=>{const at=Se.state.listElement||Z.current;if(!at)return;const wt=at.scrollTop,bt=at.scrollTop+at.clientHeight,St=wt>1,Qe=bt<at.scrollHeight-1;Se.state.scrollUpArrowVisible!==St&&Se.set("scrollUpArrowVisible",St),Se.state.scrollDownArrowVisible!==Qe&&Se.set("scrollDownArrowVisible",Qe)}),ue=m0({open:I,onOpenChange:et,elements:{reference:xe,floating:Re}}),je=Yu(ue,{enabled:!p&&!q,event:"mousedown"}),rt=pp(ue,{bubbles:!1}),Xe=g0(ue,{enabled:!p&&!q,listRef:K,activeIndex:be,selectedIndex:ae,disabledIndices:mr,onNavigate(at){at===null&&!I||Se.set("activeIndex",at)},focusItemOnHover:!1}),it=v0(ue,{enabled:!p&&!q&&(I||!y),listRef:J,activeIndex:be,selectedIndex:ae,onMatch(at){I?Se.set("activeIndex",at):qe(se.current[at],Fe("none"))},onTypingChange(at){re.current=at}}),{getReferenceProps:Ct,getFloatingProps:lt,getItemProps:tn}=rc([je,rt,Xe,it]),kt=k.useMemo(()=>zs(Ct(),Ae),[Ct,Ae]);tR(()=>{Se.update({popupProps:lt(),triggerProps:kt})}),Ne(()=>{Se.update({id:V,modal:g,multiple:y,value:P,open:I,mounted:ve,transitionStatus:fe,popupProps:lt(),triggerProps:kt,items:_,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E,openMethod:De})},[Se,V,g,y,P,I,ve,fe,lt,kt,_,v,S,E,De]);const vt=k.useMemo(()=>({store:Se,name:H,required:f,disabled:q,readOnly:p,multiple:y,itemToStringLabel:v,itemToStringValue:S,highlightItemOnHover:T,setValue:qe,setOpen:et,listRef:K,popupRef:Z,scrollHandlerRef:ee,handleScrollArrowVisibility:$e,scrollArrowsMountedCountRef:X,getItemProps:tn,events:ue.context.events,valueRef:F,valuesRef:se,labelsRef:J,typingRef:re,selectionRef:ce,selectedItemTextRef:oe,validation:Y,onOpenChangeComplete:C,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:_e,initialValueRef:st}),[Se,H,f,q,p,y,v,S,T,qe,et,tn,ue.context.events,Y,C,$e]),Je=ss(w,Y.inputRef),Ot=y&&Array.isArray(P)&&P.length>0,jt=k.useMemo(()=>!y||!Array.isArray(P)||!H?null:P.map(at=>{const wt=ps(at,S);return x.jsx("input",{type:"hidden",name:H,value:wt},wt)}),[y,P,H,S]);return x.jsx(nR.Provider,{value:vt,children:x.jsxs(rR.Provider,{value:ue,children:[A,x.jsx("input",{...Y.getInputValidationProps({onFocus(){Se.state.triggerElement?.focus()},onChange(at){if(at.nativeEvent.defaultPrevented)return;const wt=at.target.value,bt=Fe(Pn,at.nativeEvent);function St(){if(y)return;const Qe=se.current.find(Ht=>ps(Ht,S).toLowerCase()===wt.toLowerCase());Qe!=null&&(L(Qe!==U.initialValue),qe(Qe,bt),D()&&Y.commit(Qe))}Se.set("forceMount",!0),queueMicrotask(St)}}),id:t||$||void 0,name:y?void 0:H,value:Ue,disabled:q,required:f&&!Ot,readOnly:p,ref:Je,style:nc,tabIndex:-1,"aria-hidden":!0}),jt]})})}function b0(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,c=parseFloat(s.height)||0,d=Math.max(t.width,u,a),p=Math.max(t.height,h,c),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 Kf=2,L8={...Au,...Aa,value:()=>null},A8=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{setTouched:c,setFocused:d,validationMode:p,state:f,disabled:g}=is(),{labelId:b}=xo(),{store:w,setOpen:C,selectionRef:_,validation:y,readOnly:v,alignItemWithTriggerActiveRef:S,disabled:E,keyboardActiveRef:T}=Fs(),A=g||E||u,M=Le(w,ft.open),L=Le(w,ft.value),D=Le(w,ft.triggerProps),U=Le(w,ft.positionerElement),z=Le(w,ft.listElement),W=Le(w,ft.serializedValue),j=fn(U),Y=k.useRef(null),$=Qt(),V=Qt(),{getButtonProps:q,buttonRef:H}=Br({disabled:A,native:h}),P=Oe(ee=>{w.set("triggerElement",ee)}),B=ss(n,Y,H,P),I=Qt(),G=Qt();k.useEffect(()=>{if(M)return G.start(200,()=>{_.current.allowUnselectedMouseUp=!0,I.start(200,()=>{_.current.allowSelectedMouseUp=!0})}),()=>{I.clear(),G.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},V.clear()},[M,_,V,I,G]);const K=k.useMemo(()=>z?.id??Ou(U)?.id,[z,U]),J=zs(D,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?K:void 0,"aria-labelledby":b,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:B,onFocus(ee){d(!0),M&&S.current&&C(!1,Fe(xa,ee.nativeEvent)),$.start(0,()=>{w.set("forceMount",!0)})},onBlur(){c(!0),d(!1),p==="onBlur"&&y.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(ee){if(M)return;const X=gr(ee.currentTarget);function F(se){if(!Y.current)return;const re=se.target;if(dt(Y.current,re)||dt(j.current,re)||re===Y.current)return;const ne=b0(Y.current);se.clientX>=ne.left-Kf&&se.clientX<=ne.right+Kf&&se.clientY>=ne.top-Kf&&se.clientY<=ne.bottom+Kf||C(!1,Fe(q2,se))}V.start(0,()=>{X.addEventListener("mouseup",F,{once:!0})})}},y.getValidationProps,a,q);J.role="combobox";const Z=k.useMemo(()=>({...f,open:M,disabled:A,value:L,readOnly:v,placeholder:!W}),[f,M,A,L,v,W]);return ut("button",t,{ref:[n,Y],state:Z,stateAttributesMapping:L8,props:J})}),O8={value:()=>null},M8=k.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:c}=Fs(),d=Le(a,ft.value),p=Le(a,ft.items),f=Le(a,ft.itemToStringLabel),g=Le(a,ft.serializedValue),b=k.useMemo(()=>({value:d,placeholder:!g}),[d,g]),w=typeof u=="function"?u(d):u??(Array.isArray(d)?k8(d,f):R8(d,p,f));return ut("span",t,{state:b,ref:[n,c],props:[{children:w},h],stateAttributesMapping:O8})}),D8=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=Fs(),a=Le(h,ft.open),c=k.useMemo(()=>({open:a}),[a]);return ut("span",t,{state:c,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:e0})}),P8=k.createContext(void 0),I8=k.forwardRef(function(t,n){const{store:s}=Fs(),o=Le(s,ft.mounted),u=Le(s,ft.forceMount);return o||u?x.jsx(P8.Provider,{value:!0,children:x.jsx(dp,{ref:n,...t})}):null}),lR=k.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function j8(){return k.useContext(lR)}function ed(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=Oe(o),h=k.useRef(0),a=qn(B8).current,c=qn(N8).current,[d,p]=k.useState(0),f=k.useRef(d),g=Oe((y,v)=>{c.set(y,v??null),f.current+=1,p(f.current)}),b=Oe(y=>{c.delete(y),f.current+=1,p(f.current)}),w=k.useMemo(()=>{const y=new Map;return Array.from(c.keys()).filter(S=>S.isConnected).sort(z8).forEach((S,E)=>{const T=c.get(S)??{};y.set(S,{...T,index:E})}),y},[c,d]);Ne(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const y=new MutationObserver(v=>{const S=new Set,E=T=>S.has(T)?S.delete(T):S.add(T);v.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),S.size===0&&(f.current+=1,p(f.current))});return w.forEach((v,S)=>{S.parentElement&&y.observe(S.parentElement,{childList:!0})}),()=>{y.disconnect()}},[w]),Ne(()=>{f.current===d&&(n.current.length!==w.size&&(n.current.length=w.size),s&&s.current.length!==w.size&&(s.current.length=w.size),h.current=w.size),u(w)},[u,w,n,s,d]),Ne(()=>()=>{n.current=[]},[n]),Ne(()=>()=>{s&&(s.current=[])},[s]);const C=Oe(y=>(a.add(y),()=>{a.delete(y)}));Ne(()=>{a.forEach(y=>y(w))},[a,w]);const _=k.useMemo(()=>({register:g,unregister:b,subscribeMapChange:C,elementsRef:n,labelsRef:s,nextIndexRef:h}),[g,b,C,n,s,h]);return x.jsx(lR.Provider,{value:_,children:t})}function N8(){return new Map}function B8(){return new Set}function z8(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 H8=k.createContext(void 0);function Oa(){return k.useContext(H8)?.direction??"ltr"}const V8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:u,platform:h,elements:a,middlewareData:c}=t,{element:d,padding:p=0,offsetParent:f="real"}=bi(e,t)||{};if(d==null)return{};const g=sE(p),b={x:n,y:s},w=l0(o),C=a0(w),_=await h.getDimensions(d),y=w==="y",v=y?"top":"left",S=y?"bottom":"right",E=y?"clientHeight":"clientWidth",T=u.reference[C]+u.reference[w]-b[w]-u.floating[C],A=b[w]-u.reference[w],M=f==="real"?await h.getOffsetParent?.(d):a.floating;let L=a.floating[E]||u.floating[C];(!L||!await h.isElement?.(M))&&(L=a.floating[E]||u.floating[C]);const D=T/2-A/2,U=L/2-_[C]/2-1,z=Math.min(g[v],U),W=Math.min(g[S],U),j=z,Y=L-_[C]-W,$=L/2-_[C]/2+D,V=r_(j,$,Y),q=!c.arrow&&bo(o)!=null&&$!==V&&u.reference[C]/2-($<j?z:W)-_[C]/2<0,H=q?$<j?$-j:$-Y:0;return{[w]:b[w]+H,data:{[w]:V,centerOffset:$-V-H,...q&&{alignmentOffset:H}},reset:q}}}),F8=(e,t)=>({...V8(e),options:[e,t]}),U8={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 JD().fn(e)).data?.referenceHidden||u}}}},W8={sideX:"left",sideY:"top"};function cR(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 uC(e,t,n){const{rects:s,placement:o}=e;return{side:cR(t,Pr(o),n),align:bo(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function S0(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:h=0,collisionBoundary:a,collisionPadding:c=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:b,mounted:w,collisionAvoidance:C,shiftCrossAxis:_=!1,nodeId:y,adaptiveOrigin:v,lazyFlip:S=!1,externalTree:E}=e,[T,A]=k.useState(null);!w&&T!==null&&A(null);const M=C.side||"flip",L=C.align||"flip",D=C.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,z=Oe(U),W=U?z:t,j=fn(t),$=Oa()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[s],q=u==="center"?V:`${V}-${u}`;let H=c;const P=1,B=s==="bottom"?P:0,I=s==="top"?P:0,G=s==="right"?P:0,K=s==="left"?P:0;typeof H=="number"?H={top:H+B,right:H+K,bottom:H+I,left:H+G}:H&&(H={top:(H.top||0)+B,right:(H.right||0)+K,bottom:(H.bottom||0)+I,left:(H.left||0)+G});const J={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:H},Z=k.useRef(null),ee=fn(o),X=fn(h),re=[KD(Xe=>{const it=uC(Xe,s,$),Ct=typeof ee.current=="function"?ee.current(it):ee.current,lt=typeof X.current=="function"?X.current(it):X.current;return{mainAxis:Ct,crossAxis:lt,alignmentAxis:lt}},[typeof o!="function"?o:0,typeof h!="function"?h:0,$,s])],ne=L==="none"&&M!=="shift",oe=!ne&&(d||_||M==="shift"),ce=M==="none"?null:QD({...J,padding:{top:H.top+P,right:H.right+P,bottom:H.bottom+P,left:H.left+P},mainAxis:!_&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),_e=ne?null:YD(Xe=>{const it=gr(Xe.elements.floating).documentElement;return{...J,rootBoundary:_?{x:0,y:0,width:it.clientWidth,height:it.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||_?void 0:XD(Ct=>{if(!Z.current)return{};const{width:lt,height:tn}=Z.current.getBoundingClientRect(),kt=es(Pr(Ct.placement)),vt=kt==="y"?lt:tn,Je=kt==="y"?H.left+H.right:H.top+H.bottom;return{offset:vt/2+Je/2}})}},[J,d,_,H,L]);M==="shift"||L==="shift"||u==="center"?re.push(_e,ce):re.push(ce,_e),re.push(ZD({...J,apply({elements:{floating:Xe},rects:{reference:it},availableWidth:Ct,availableHeight:lt}){Object.entries({"--available-width":`${Ct}px`,"--available-height":`${lt}px`,"--anchor-width":`${it.width}px`,"--anchor-height":`${it.height}px`}).forEach(([tn,kt])=>{Xe.style.setProperty(tn,kt)})}}),F8(()=>({element:Z.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Xe){const{elements:it,middlewareData:Ct,placement:lt,rects:tn,y:kt}=Xe,vt=Pr(lt),Je=es(vt),Ot=Z.current,jt=Ct.arrow?.x||0,at=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,St=jt+wt/2,Qe=at+bt/2,Ht=Math.abs(Ct.shift?.y||0),wn=tn.reference.height/2,Kn=typeof o=="function"?o(uC(Xe,s,$)):o,Bn=Ht>Kn,ys={top:`${St}px calc(100% + ${Kn}px)`,bottom:`${St}px ${-Kn}px`,left:`calc(100% + ${Kn}px) ${Qe}px`,right:`${-Kn}px ${Qe}px`}[vt],za=`${St}px ${tn.reference.y+wn-kt}px`;return it.floating.style.setProperty("--transform-origin",oe&&Je==="y"&&Bn?za:ys),{}}},U8,v),Ne(()=>{!w&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,b]);const ve=k.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:fe,x:De,y:Ae,middlewareData:Pe,update:Se,placement:be,context:ae,isPositioned:xe,floatingStyles:Re}=R6({rootContext:b,placement:q,middleware:re,strategy:n,whileElementsMounted:g?void 0:(...Xe)=>Qx(...Xe,ve),nodeId:y,externalTree:E}),{sideX:Ue,sideY:nt}=Pe.adaptiveOrigin||W8,He=xe?n:"fixed",st=k.useMemo(()=>v?{position:He,[Ue]:De,[nt]:Ae}:{position:He,...Re},[v,He,Ue,De,nt,Ae,Re]),et=k.useRef(null);Ne(()=>{if(!w)return;const Xe=j.current,it=typeof Xe=="function"?Xe():Xe,lt=(dC(it)?it.current:it)||null||null;lt!==et.current&&(he.setPositionReference(lt),et.current=lt)},[w,he,W,j]),k.useEffect(()=>{if(!w)return;const Xe=j.current;typeof Xe!="function"&&dC(Xe)&&Xe.current!==et.current&&(he.setPositionReference(Xe.current),et.current=Xe.current)},[w,he,W,j]),k.useEffect(()=>{if(g&&w&&fe.domReference&&fe.floating)return Qx(fe.domReference,fe.floating,Se,ve)},[g,w,fe,Se,ve]);const ht=Pr(be),qe=cR(s,ht,$),$e=bo(be)||"center",ue=!!Pe.hide?.referenceHidden;Ne(()=>{S&&w&&xe&&A(ht)},[S,w,xe,ht]);const je=k.useMemo(()=>({position:"absolute",top:Pe.arrow?.y,left:Pe.arrow?.x}),[Pe.arrow]),rt=Pe.arrow?.centerOffset!==0;return k.useMemo(()=>({positionerStyles:st,arrowStyles:je,arrowRef:Z,arrowUncentered:rt,side:qe,align:$e,physicalSide:ht,anchorHidden:ue,refs:he,context:ae,isPositioned:xe,update:Se}),[st,je,Z,rt,qe,$e,ht,ue,he,ae,xe,Se])}function dC(e){return e!=null&&"current"in e}const uR=k.createContext(void 0);function x0(){const e=k.useContext(uR);if(!e)throw new Error(It(59));return e}function Vh(e,t){e&&Object.assign(e.style,t)}const dR={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},q8={position:"fixed"},G8=k.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a="bottom",align:c="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:C,alignItemWithTrigger:_=!0,collisionAvoidance:y=K_,...v}=t,{store:S,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:D,popupRef:U,setValue:z}=Fs(),W=sR(),j=Le(S,ft.open),Y=Le(S,ft.mounted),$=Le(S,ft.modal),V=Le(S,ft.value),q=Le(S,ft.openMethod),H=Le(S,ft.positionerElement),P=Le(S,ft.triggerElement),B=Le(S,ft.isItemEqualToValue),I=k.useRef(null),G=k.useRef(null),[K,J]=k.useState(_),Z=Y&&K&&q!=="touch";!Y&&K!==_&&J(_),Ne(()=>{Y||(ft.scrollUpArrowVisible(S.state)&&S.set("scrollUpArrowVisible",!1),ft.scrollDownArrowVisible(S.state)&&S.set("scrollDownArrowVisible",!1))},[S,Y]),k.useImperativeHandle(A,()=>Z),yp((Z||$)&&j&&q!=="touch",P);const ee=S0({anchor:s,floatingRootContext:W,positionMethod:o,mounted:Y,side:a,sideOffset:d,align:c,alignOffset:p,arrowPadding:b,collisionBoundary:f,collisionPadding:g,sticky:w,disableAnchorTracking:C??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:!Y,style:{...F,...he}}},[j,Y,F]),re=k.useMemo(()=>({open:j,side:X,align:ee.align,anchorHidden:ee.anchorHidden}),[j,X,ee.align,ee.anchorHidden]),ne=Oe(he=>{S.set("positionerElement",he)}),oe=ut("div",t,{ref:[n,ne],state:re,stateAttributesMapping:yo,props:[se,v]}),ce=k.useRef(0),_e=Oe(he=>{if(he.size===0&&ce.current===0||L.current.length===0)return;const fe=ce.current;if(ce.current=he.size,he.size===fe)return;const De=Fe(Pn);if(fe!==0&&!S.state.multiple&&V!==null&&ql(L.current,V,B)===-1){const Pe=D.current,be=Pe!=null&&sa(L.current,Pe,B)?Pe:null;z(be,De),be===null&&(S.set("selectedIndex",null),M.current=null)}if(fe!==0&&S.state.multiple&&Array.isArray(V)){const Ae=V.filter(Pe=>sa(L.current,Pe,B));(Ae.length!==V.length||Ae.some(Pe=>!sa(V,Pe,B)))&&(z(Ae,De),Ae.length===0&&(S.set("selectedIndex",null),M.current=null))}if(j&&Z){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ae={height:""};Vh(H,Ae),Vh(U.current,Ae)}}),ve=k.useMemo(()=>({...ee,side:X,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:I,scrollDownArrowRef:G}),[ee,X,Z,J]);return x.jsx(ed,{elementsRef:E,labelsRef:T,onMapChange:_e,children:x.jsxs(uR.Provider,{value:ve,children:[Y&&$&&x.jsx(_p,{inert:vp(!j),cutout:P}),oe]})})});function fR(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Yf="base-ui-disable-scrollbar",Iu={className:Yf,element:x.jsx("style",{href:Yf,precedence:"base-ui:low",children:`.${Yf}{scrollbar-width:none}.${Yf}::-webkit-scrollbar{display:none}`})},$8=k.createContext(void 0);function hR(e){return k.useContext($8)}function C0(e){return e==="starting"?zO:en}const K8={...yo,...Vs},Y8=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{store:h,popupRef:a,onOpenChangeComplete:c,setOpen:d,valueRef:p,selectedItemTextRef:f,keyboardActiveRef:g,multiple:b,handleScrollArrowVisibility:w,scrollHandlerRef:C}=Fs(),{side:_,align:y,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:S,scrollDownArrowRef:E,scrollUpArrowRef:T}=x0(),A=hR()!=null,M=sR(),L=Qt(),D=Le(h,ft.id),U=Le(h,ft.open),z=Le(h,ft.mounted),W=Le(h,ft.popupProps),j=Le(h,ft.transitionStatus),Y=Le(h,ft.triggerElement),$=Le(h,ft.positionerElement),V=Le(h,ft.listElement),q=k.useRef(0),H=k.useRef(!1),P=k.useRef(0),B=k.useRef(!1),I=k.useRef({}),G=Ku(),K=Oe(X=>{if(!$||!a.current||!B.current)return;if(H.current||!v){w();return}const F=$.style.top==="0px",se=$.style.bottom==="0px",re=$.getBoundingClientRect().height,ne=gr($),oe=getComputedStyle($),ce=parseFloat(oe.marginTop),_e=parseFloat(oe.marginBottom),ve=ne.documentElement.clientHeight-ce-_e,he=X.scrollTop,fe=X.scrollHeight,De=X.clientHeight,Ae=fe-De;let Pe=null,Se=null,be=!1;if(F){const ae=Ae-he,xe=re+ae,Re=Math.min(xe,ve);Pe=Re,Re!==ve?Se=Ae:be=!0}else if(se){const ae=he-0,xe=re+ae,Re=Math.min(xe,ve),Ue=xe-ve;Pe=Re,Re!==ve?Se=0:(be=!0,he<Ae&&(Se=he-(ae-Ue)))}Pe!=null&&($.style.height=`${Pe}px`),Se!=null&&(X.scrollTop=Se),be&&(H.current=!0),w()});k.useImperativeHandle(C,()=>K,[K]),zr({open:U,ref:a,onComplete(){U&&c?.(!0)}});const J=k.useMemo(()=>({open:U,transitionStatus:j,side:_,align:y}),[U,j,_,y]);Ne(()=>{!$||!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,$]),Ne(()=>{z||v||(B.current=!1,H.current=!1,q.current=0,P.current=0,Vh($,I.current))},[z,v,$,a]),Ne(()=>{const X=a.current;if(!(!z||!Y||!$||!X)){if(!v){B.current=!0,G.request(w);return}queueMicrotask(()=>{const F=getComputedStyle($),se=getComputedStyle(X),re=gr(Y),ne=Cn($),oe=Y.getBoundingClientRect(),ce=$.getBoundingClientRect(),_e=oe.left,ve=oe.height,he=V||X,fe=he.scrollHeight,De=parseFloat(se.borderBottomWidth),Ae=parseFloat(F.marginTop)||10,Pe=parseFloat(F.marginBottom)||10,Se=parseFloat(F.minHeight)||100,be=5,ae=5,xe=20,Re=re.documentElement.clientHeight-Ae-Pe,Ue=re.documentElement.clientWidth,nt=Re-oe.bottom+ve,He=f.current,st=p.current;let et=0,ht=0;if(He&&st){const vt=st.getBoundingClientRect(),Je=He.getBoundingClientRect(),Ot=vt.left-_e,jt=Je.left-ce.left,at=vt.top-oe.top+vt.height/2,wt=Je.top-ce.top+Je.height/2;et=Ot-jt,ht=wt-at}const qe=nt+ht+Pe+De;let $e=Math.min(Re,qe);const ue=Re-Ae-Pe,je=qe-$e,rt=Math.max(be,_e+et),Xe=Ue-ae,it=Math.max(0,rt+ce.width-Xe);$.style.left=`${rt-it}px`,$.style.height=`${$e}px`,$.style.maxHeight="auto",$.style.marginTop=`${Ae}px`,$.style.marginBottom=`${Pe}px`,X.style.height="100%";const Ct=he.scrollHeight-he.clientHeight,lt=je>=Ct;lt&&($e=Math.min(Re,ce.height)-(je-Ct));const tn=oe.top<xe||oe.bottom>Re-xe||$e<Math.min(fe,Se),kt=(ne.visualViewport?.scale??1)!==1&&r0;if(tn||kt){B.current=!0,Vh($,I.current),Jn.flushSync(()=>S(!1));return}if(lt){const vt=Math.max(0,Re-qe);$.style.top=ce.height>=ue?"0":`${vt}px`,$.style.height=`${$e}px`,he.scrollTop=he.scrollHeight-he.clientHeight,q.current=Math.max(Se,$e)}else $.style.bottom="0",q.current=Math.max(Se,$e),he.scrollTop=je;q.current===Re&&(H.current=!0),w(),setTimeout(()=>{B.current=!0})})}},[h,z,$,Y,p,f,a,w,v,S,G,E,T,V]),k.useEffect(()=>{if(!v||!$||!z)return;const X=Cn($);function F(se){d(!1,Fe(p4,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":b||void 0,id:`${D}-list`},onKeyDown(X){g.current=!0,A&&_0.has(X.key)&&X.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(X){if(fR(X)||X.pointerType==="touch")return;const F=X.currentTarget;L.start(0,()=>{h.set("activeIndex",null),F.focus({preventScroll:!0})})},onScroll(X){V||C.current?.(X.currentTarget)},...v&&{style:V?{height:"100%"}:dR}},ee=ut("div",t,{ref:[n,a],state:J,stateAttributesMapping:K8,props:[W,Z,C0(j),{className:!V&&v?Iu.className:void 0},u]});return x.jsxs(k.Fragment,{children:[Iu.element,x.jsx(fp,{context:M,modal:!1,disabled:!z,restoreFocus:!0,children:ee})]})}),X8=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=Fs(),{alignItemWithTriggerActive:c}=x0(),d=Le(h,ft.hasScrollArrows),p=Le(h,ft.openMethod),f=Le(h,ft.multiple),b={id:`${Le(h,ft.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(C){a.current?.(C.currentTarget)},...c&&{style:dR},className:d&&p!=="touch"?Iu.className:void 0},w=Oe(C=>{h.set("listElement",C)});return ut("div",t,{ref:[n,w],props:[b,u]})});let w0=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function td(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:o,index:u}=e,{register:h,unregister:a,subscribeMapChange:c,elementsRef:d,labelsRef:p,nextIndexRef:f}=j8(),g=k.useRef(-1),[b,w]=k.useState(u??(o===w0.GuessFromOrder?()=>{if(g.current===-1){const y=f.current;f.current+=1,g.current=y}return g.current}:-1)),C=k.useRef(null),_=k.useCallback(y=>{if(C.current=y,b!==-1&&y!==null&&(d.current[b]=y,p)){const v=t!==void 0;p.current[b]=v?t:s?.current?.textContent??y.textContent}},[b,d,p,t,s]);return Ne(()=>{if(u!=null)return;const y=C.current;if(y)return h(y,n),()=>{a(y)}},[u,h,a,n]),Ne(()=>{if(u==null)return c(y=>{const v=C.current?y.get(C.current)?.index:null;v!=null&&w(v)})},[u,c,w]),k.useMemo(()=>({ref:_,index:b}),[b,_])}const pR=k.createContext(void 0);function E0(){const e=k.useContext(pR);if(!e)throw new Error(It(57));return e}const Q8=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,label:h,disabled:a=!1,nativeButton:c=!1,...d}=t,p=k.useRef(null),f=td({label:h,textRef:p,indexGuessBehavior:w0.GuessFromOrder}),{store:g,getItemProps:b,setOpen:w,setValue:C,selectionRef:_,typingRef:y,valuesRef:v,keyboardActiveRef:S,multiple:E,highlightItemOnHover:T}=Fs(),A=Qt(),M=Le(g,ft.isActive,f.index),L=Le(g,ft.isSelected,f.index,u),D=Le(g,ft.isSelectedByFocus,f.index),U=Le(g,ft.isItemEqualToValue),z=f.index,W=z!==-1,j=k.useRef(null),Y=fn(z);Ne(()=>{if(!W)return;const ee=v.current;return ee[z]=u,()=>{delete ee[z]}},[W,z,u,v]),Ne(()=>{if(!W)return;const ee=g.state.value;let X=ee;E&&Array.isArray(ee)&&ee.length>0&&(X=ee[ee.length-1]),X!==void 0&&Si(X,u,U)&&g.set("selectedIndex",z)},[W,z,E,U,g,u]);const $=k.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),V=b({active:M,selected:L});V.onFocus=void 0,V.id=void 0;const q=k.useRef(null),H=k.useRef("mouse"),P=k.useRef(!1),{getButtonProps:B,buttonRef:I}=Br({disabled:a,focusableWhenDisabled:!0,native:c});function G(ee){const X=g.state.value;if(E){const F=Array.isArray(X)?X:[],se=L?oR(F,u,U):[...F,u];C(se,Fe(da,ee))}else C(u,Fe(da,ee)),w(!1,Fe(da,ee))}const K={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",z)},onMouseEnter(){!S.current&&g.state.selectedIndex===null&&g.set("activeIndex",z)},onMouseMove(){T&&g.set("activeIndex",z)},onMouseLeave(ee){!T||S.current||fR(ee)||A.start(0,()=>{g.state.activeIndex===z&&g.set("activeIndex",null)})},onTouchStart(){_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){q.current=ee.key,g.set("activeIndex",z)},onClick(ee){P.current=!1,!(ee.type==="keydown"&&q.current===null)&&(a||q.current===" "&&y.current||H.current!=="touch"&&!M||(q.current=null,G(ee.nativeEvent)))},onPointerEnter(ee){H.current=ee.pointerType},onPointerDown(ee){H.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||H.current!=="touch"&&!M||G(ee.nativeEvent)}},J=ut("div",t,{ref:[I,n,f.ref,j],state:$,props:[V,K,d,B]}),Z=k.useMemo(()=>({selected:L,indexRef:Y,textRef:p,selectedByFocus:D,hasRegistered:W}),[L,Y,p,D,W]);return x.jsx(pR.Provider,{value:Z,children:J})})),Z8=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=E0();return s||o?x.jsx(J8,{...t,ref:n}):null}),J8=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=E0(),a=k.useRef(null),{transitionStatus:c,setMounted:d}=wi(h),p=k.useMemo(()=>({selected:h,transitionStatus:c}),[h,c]),f=ut("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Vs});return zr({open:h,ref:a,onComplete(){h||d(!1)}}),f})),eP=k.memo(k.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=E0(),{selectedItemTextRef:a}=Fs(),{className:c,render:d,...p}=t,f=k.useCallback(b=>{if(!b||!h)return;const w=a.current===null||!a.current.isConnected;(u||w&&s.current===0)&&(a.current=b)},[a,s,u,h]);return ut("div",t,{ref:[f,n,o],props:p})})),mR=k.forwardRef(function(t,n){const{render:s,className:o,direction:u,keepMounted:h=!1,...a}=t,{store:c,popupRef:d,listRef:p,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:g}=Fs(),{side:b,scrollDownArrowRef:w,scrollUpArrowRef:C}=x0(),_=u==="up"?ft.scrollUpArrowVisible:ft.scrollDownArrowVisible,y=Le(c,_),v=Le(c,ft.openMethod),S=y&&v!=="touch",E=Qt(),T=u==="up"?C:w,{transitionStatus:A,setMounted:M}=wi(S);Ne(()=>(g.current+=1,c.state.hasScrollArrows||c.set("hasScrollArrows",!0),()=>{g.current=Math.max(0,g.current-1),g.current===0&&c.state.hasScrollArrows&&c.set("hasScrollArrows",!1)}),[c,g]),zr({open:S,ref:T,onComplete(){S||M(!1)}});const L=k.useMemo(()=>({direction:u,visible:S,side:b,transitionStatus:A}),[u,S,b,A]),U=ut("div",t,{ref:[n,T],state:L,props:[{"aria-hidden":!0,children:u==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||E.isStarted())return;c.set("activeIndex",null);function j(){const Y=c.state.listElement??d.current;if(!Y)return;c.set("activeIndex",null),f();const $=Y.scrollTop===0,V=Math.round(Y.scrollTop+Y.clientHeight)>=Y.scrollHeight;if(p.current.length===0&&(u==="up"?c.set("scrollUpArrowVisible",!$):c.set("scrollDownArrowVisible",!V)),u==="up"&&$||u==="down"&&V){E.clear();return}if((c.state.listElement||d.current)&&p.current&&p.current.length>0){const H=p.current,P=T.current?.offsetHeight||0;if(u==="up"){let B=0;const I=Y.scrollTop+P;for(let K=0;K<H.length;K+=1){const J=H[K];if(J&&J.offsetTop>=I){B=K;break}}const G=Math.max(0,B-1);if(G<B){const K=H[G];K&&(Y.scrollTop=Math.max(0,K.offsetTop-P))}else Y.scrollTop=0}else{let B=H.length-1;const I=Y.scrollTop+Y.clientHeight-P;for(let K=0;K<H.length;K+=1){const J=H[K];if(J&&J.offsetTop+J.offsetHeight>I){B=Math.max(0,K-1);break}}const G=Math.min(H.length-1,B+1);if(G>B){const K=H[G];K&&(Y.scrollTop=K.offsetTop+K.offsetHeight-Y.clientHeight+P)}else Y.scrollTop=Y.scrollHeight-Y.clientHeight}}E.start(40,j)}E.start(40,j)},onMouseLeave(){E.clear()}},a]});return S||h?U:null}),tP=k.forwardRef(function(t,n){return x.jsx(mR,{...t,ref:n,direction:"down"})}),nP=k.forwardRef(function(t,n){return x.jsx(mR,{...t,ref:n,direction:"up"})}),Ml=T8;function Dl({className:e,...t}){return x.jsx(M8,{"data-slot":"select-value",className:Be("flex flex-1 text-left",e),...t})}function Pl({className:e,size:t="default",children:n,...s}){return x.jsxs(A8,{"data-slot":"select-trigger","data-size":t,className:Be("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[n,x.jsx(D8,{render:x.jsx(Ce,{icon:r4,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Il({className:e,children:t,side:n="bottom",sideOffset:s=4,align:o="center",alignOffset:u=0,alignItemWithTrigger:h=!0,...a}){return x.jsx(I8,{children:x.jsx(G8,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:x.jsxs(Y8,{"data-slot":"select-content",className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...a,children:[x.jsx(rP,{}),x.jsx(X8,{children:t}),x.jsx(sP,{})]})})})}function hr({className:e,children:t,...n}){return x.jsxs(Q8,{"data-slot":"select-item",className:Be("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[x.jsx(eP,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),x.jsx(Z8,{render:x.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:x.jsx(Ce,{icon:ka,strokeWidth:2,className:"pointer-events-none"})})]})}function rP({className:e,...t}){return x.jsx(nP,{"data-slot":"select-scroll-up-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:x.jsx(Ce,{icon:I2,strokeWidth:2})})}function sP({className:e,...t}){return x.jsx(tP,{"data-slot":"select-scroll-down-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:x.jsx(Ce,{icon:O2,strokeWidth:2})})}const gR=k.createContext(void 0);function R0(){const e=k.useContext(gR);if(e===void 0)throw new Error(It(64));return e}let iP=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const k0={tabActivationDirection:e=>({[iP.activationDirection]:e})},oP=k.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:c,...d}=t,p=Oa(),f=Object.hasOwn(t,"defaultValue"),g=k.useRef([]),[b,w]=k.useState(()=>new Map),[C,_]=js({controlled:c,default:o,name:"Tabs",state:"value"}),y=c!==void 0,[v,S]=k.useState(()=>new Map),[E,T]=k.useState("none"),A=Oe((q,H)=>{u?.(q,H),!H.isCanceled&&(_(q),T(H.activationDirection))}),M=Oe((q,H)=>{w(P=>{if(P.get(q)===H)return P;const B=new Map(P);return B.set(q,H),B})}),L=Oe((q,H)=>{w(P=>{if(!P.has(q)||P.get(q)!==H)return P;const B=new Map(P);return B.delete(q),B})}),D=k.useCallback(q=>b.get(q),[b]),U=k.useCallback(q=>{for(const H of v.values())if(q===H?.value)return H?.id},[v]),z=k.useCallback(q=>{if(q===void 0)return null;for(const[H,P]of v.entries())if(P!=null&&q===(P.value??P.index))return H;return null},[v]),W=k.useMemo(()=>({direction:p,getTabElementBySelectedValue:z,getTabIdByPanelValue:U,getTabPanelIdByValue:D,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:S,unregisterMountedTabPanel:L,tabActivationDirection:E,value:C}),[p,z,U,D,A,h,M,S,L,E,C]),j=k.useMemo(()=>{for(const q of v.values())if(q!=null&&q.value===C)return q},[v,C]),Y=k.useMemo(()=>{for(const q of v.values())if(q!=null&&!q.disabled)return q.value},[v]);Ne(()=>{if(y||v.size===0)return;const q=j?.disabled,H=j==null&&C!==null;if(f&&q&&C===o||!q&&!H)return;const B=Y??null;C!==B&&(_(B),T("none"))},[o,Y,f,y,j,T,_,v,C]);const V=ut("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:k0});return x.jsx(gR.Provider,{value:W,children:x.jsx(ed,{elementsRef:g,children:V})})}),vR="data-composite-item-active";function _R(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=G_(),{ref:o,index:u}=td(e),h=n===u,a=k.useRef(null),c=ss(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:c,index:u}}const yR=k.createContext(void 0);function aP(){const e=k.useContext(yR);if(e===void 0)throw new Error(It(65));return e}const lP=k.forwardRef(function(t,n){const{className:s,disabled:o=!1,render:u,value:h,id:a,nativeButton:c=!0,...d}=t,{value:p,getTabPanelIdByValue:f,orientation:g}=R0(),{activateOnFocus:b,highlightedTabIndex:w,onTabActivation:C,setHighlightedTabIndex:_,tabsListElement:y}=aP(),v=jr(a),S=k.useMemo(()=>({disabled:o,id:v,value:h}),[o,v,h]),{compositeProps:E,compositeRef:T,index:A}=_R({metadata:S}),M=h===p,L=k.useRef(!1);Ne(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&w!==A))return;const P=y;if(P!=null){const B=hs(gr(P));if(B&&dt(P,B))return}o||_(A)},[M,A,w,_,o,y]);const{getButtonProps:D,buttonRef:U}=Br({disabled:o,native:c,focusableWhenDisabled:!0}),z=f(h),W=k.useRef(!1),j=k.useRef(!1);function Y(P){M||o||C(h,Fe(Pn,P.nativeEvent,void 0,{activationDirection:"none"}))}function $(P){M||(A>-1&&!o&&_(A),!o&&b&&(!W.current||W.current&&j.current)&&C(h,Fe(Pn,P.nativeEvent,void 0,{activationDirection:"none"})))}function V(P){if(M||o)return;W.current=!0;function B(){W.current=!1,j.current=!1}(!P.button||P.button===0)&&(j.current=!0,gr(P.currentTarget).addEventListener("pointerup",B,{once:!0}))}const q=k.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return ut("button",t,{state:q,ref:[n,U,T],props:[E,{role:"tab","aria-controls":z,"aria-selected":M,id:v,onClick:Y,onFocus:$,onPointerDown:V,[vR]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,D]})});let cP=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const uP=k.forwardRef(function(t,n){const{className:s,value:o,render:u,keepMounted:h=!1,...a}=t,{value:c,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:g,unregisterMountedTabPanel:b}=R0(),w=jr(),C=k.useMemo(()=>({id:w,value:o}),[w,o]),{ref:_,index:y}=td({metadata:C}),v=o!==c,S=d(o),E=k.useMemo(()=>({hidden:v,orientation:p,tabActivationDirection:f}),[v,p,f]),T=ut("div",t,{state:E,ref:[n,_],props:[{"aria-labelledby":S,hidden:v,id:w??void 0,role:"tabpanel",tabIndex:v?-1:0,[cP.index]:y},a],stateAttributesMapping:k0});return Ne(()=>{if(!(v&&!h)&&w!=null)return g(o,w),()=>{b(o,w)}},[v,h,o,w,g,b]),!v||h?T:null});function dP(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const fP=[];function hP(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:o=!1,orientation:u="both",direction:h,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:d,enableHomeAndEndKeys:p=!1,stopEventPropagation:f=!1,disabledIndices:g,modifierKeys:b=fP}=e,[w,C]=k.useState(0),_=n>1,y=k.useRef(null),v=ss(y,d),S=k.useRef([]),E=k.useRef(!1),T=a??w,A=Oe((D,U=!1)=>{if((c??C)(D),U){const z=S.current[D];sC(y.current,z,h,u)}}),M=Oe(D=>{if(D.size===0||E.current)return;E.current=!0;const U=Array.from(D.keys()),z=U.find(j=>j?.hasAttribute(vR))??null,W=z?U.indexOf(z):-1;W!==-1&&A(W),sC(y.current,z,h,u)}),L=k.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:v,onFocus(D){!y.current||!rC(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const U=p?G6:$E;if(!U.has(D.key)||pP(D,b)||!y.current)return;const W=h==="rtl",j=W?Pu:Ol,Y={horizontal:j,vertical:na,both:j}[u],$=W?Ol:Pu,V={horizontal:$,vertical:Al,both:$}[u];if(rC(D.target)&&!dP(D.target)){const K=D.target.selectionStart,J=D.target.selectionEnd,Z=D.target.value??"";if(K==null||D.shiftKey||K!==J||D.key!==V&&K<Z.length||D.key!==Y&&K>0)return}let q=T;const H=dh(S,g),P=i_(S,g);if(_){const K=t||Array.from({length:S.current.length},()=>({width:1,height:1})),J=oE(K,n,o),Z=J.findIndex(X=>X!=null&&!ho(S,X,g)),ee=J.reduce((X,F,se)=>F!=null&&!ho(S,F,g)?se:X,-1);q=J[iE({current:J.map(X=>X?S.current[X]:null)},{event:D,orientation:u,loopFocus:s,cols:n,disabledIndices:lE([...g||S.current.map((X,F)=>ho(S,F)?F:void 0),void 0],J),minIndex:Z,maxIndex:ee,prevIndex:aE(T>P?H:T,K,J,n,D.key===na?"bl":D.key===Ol?"tr":"tl"),rtl:W})]}const B={horizontal:[j],vertical:[na],both:[j,na]}[u],I={horizontal:[$],vertical:[Al],both:[$,Al]}[u],G=_?U:{horizontal:p?W6:qE,vertical:p?q6:GE,both:U}[u];p&&(D.key===Xu?q=H:D.key===Qu&&(q=P)),q===T&&(B.includes(D.key)||I.includes(D.key))&&(s&&q===P&&B.includes(D.key)?q=H:s&&q===H&&I.includes(D.key)?q=P:q=Un(S,{startingIndex:q,decrement:I.includes(D.key),disabledIndices:g})),q!==T&&!Rl(S,q)&&(f&&D.stopPropagation(),G.has(D.key)&&D.preventDefault(),A(q,!0),queueMicrotask(()=>{S.current[q]?.focus()}))}}),[n,o,h,g,S,p,T,_,t,s,v,b,A,u,f]);return k.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:S,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,S,g,M])}function pP(e,t){for(const n of Q6.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function mP(e){const{render:t,className:n,refs:s=mr,props:o=mr,state:u=en,stateAttributesMapping:h,highlightedIndex:a,onHighlightedIndexChange:c,orientation:d,dense:p,itemSizes:f,loopFocus:g,cols:b,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:_=!0,rootRef:y,disabledIndices:v,modifierKeys:S,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=Oa(),{props:L,highlightedIndex:D,onHighlightedIndexChange:U,elementsRef:z,onMapChange:W,relayKeyboardEvent:j}=hP({itemSizes:f,cols:b,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:y,stopEventPropagation:_,enableHomeAndEndKeys:w,direction:M,disabledIndices:v,modifierKeys:S}),Y=ut(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),$=k.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:U,highlightItemOnHover:E,relayKeyboardEvent:j}),[D,U,E,j]);return x.jsx(h2.Provider,{value:$,children:x.jsx(ed,{elementsRef:z,onMapChange:V=>{C?.(V),W(V)},children:Y})})}const gP=k.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:o,loopFocus:u=!0,render:h,...a}=t,{getTabElementBySelectedValue:c,onValueChange:d,orientation:p,value:f,setTabMap:g,tabActivationDirection:b}=R0(),[w,C]=k.useState(0),[_,y]=k.useState(null),v=vP(f,p,_,c),S=Oe((M,L)=>{if(M!==f){const D=v(M);L.activationDirection=D,d(M,L)}}),E=k.useMemo(()=>({orientation:p,tabActivationDirection:b}),[p,b]),T={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=k.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:w,onTabActivation:S,setHighlightedTabIndex:C,tabsListElement:_,value:f}),[s,w,S,C,_,f]);return x.jsx(yR.Provider,{value:A,children:x.jsx(mP,{render:h,className:o,state:E,refs:[n,y],props:[T,a],stateAttributesMapping:k0,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:C,onMapChange:g,disabledIndices:mr})})});function fC(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 vP(e,t,n,s){const[o,u]=k.useState(null);return Ne(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:c}=fC(h,n);u(t==="horizontal"?a:c)},[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:c,top:d}=fC(a,n);if(o==null)return u(t==="horizontal"?c:d),"none";if(t==="horizontal"){if(c<o)return u(c),"left";if(c>o)return u(c),"right"}else{if(d<o)return u(d),"up";if(d>o)return u(d),"down"}}}return"none"},[s,t,o,n,e])}function wp({className:e,orientation:t="horizontal",...n}){return x.jsx(oP,{"data-slot":"tabs","data-orientation":t,className:Be("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const _P=Xl("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 Ep({className:e,variant:t="default",...n}){return x.jsx(gP,{"data-slot":"tabs-list","data-variant":t,className:Be(_P({variant:t}),e),...n})}function po({className:e,...t}){return x.jsx(lP,{"data-slot":"tabs-trigger",className:Be("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function ma({className:e,...t}){return x.jsx(uP,{"data-slot":"tabs-content",className:Be("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function yP(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,actionsRef:h,handle:a,triggerId:c,defaultTriggerId:d=null}=e,p=xi(),f=!!p,g=qn(()=>a?.store??new QE({open:n??s,activeTriggerId:c!==void 0?c:d,modal:!0,disablePointerDismissal:!0,nested:f,role:"alertdialog"})).current;g.useControlledProp("open",n,s),g.useControlledProp("activeTriggerId",c,d),g.useSyncedValue("nested",f),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",u);const b=g.useState("payload");XE({store:g,actionsRef:h,parentContext:p?.store.context});const w=k.useMemo(()=>({store:g}),[g]);return x.jsx(J_.Provider,{value:w,children:typeof t=="function"?t({payload:b}):t})}const bR=k.createContext(void 0),SR=k.createContext(void 0),xR=k.createContext(void 0),CR=k.createContext("");function Ei(){const e=k.useContext(bR);if(!e)throw new Error(It(22));return e}function Rp(){const e=k.useContext(SR);if(!e)throw new Error(It(23));return e}function Ma(){const e=k.useContext(xR);if(!e)throw new Error(It(24));return e}function T0(){return k.useContext(CR)}const We={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=>Si(o,t,n)):Si(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 bP(e,t){return(n,s)=>{if(n==null)return!1;const o=kn(n,t);return e.contains(o,s)}}function SP(e,t,n){return(s,o)=>{if(s==null)return!1;if(!o)return!0;const u=kn(s,t),h=n!=null?kn(n,t):"";return h&&e.contains(h,o)&&h.length===o.length?!0:e.contains(u,o)}}const hC=new Map;function wR(e){return Array.isArray(e)?e.map(t=>wR(t)).join(","):e==null?"":String(e)}function xP(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${wR(e.locale)}|${JSON.stringify(t)}`,s=hC.get(n);if(s)return s;const o=new Intl.Collator(e.locale,t),u={contains(h,a,c){if(!a)return!0;const d=kn(h,c);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,c){if(!a)return!0;const d=kn(h,c);return o.compare(d.slice(0,a.length),a)===0},endsWith(h,a,c){if(!a)return!0;const d=kn(h,c),p=a.length;return d.length>=p&&o.compare(d.slice(d.length-p),a)===0}};return hC.set(n,u),u}const CP=xP,ER=Symbol("none"),qo={value:ER,index:-1};function wP(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:s=null,selectedValue:o,onSelectedValueChange:u,defaultInputValue:h,inputValue:a,selectionMode:c="none",onItemHighlighted:d,name:p,disabled:f=!1,readOnly:g=!1,required:b=!1,inputRef:w,grid:C=!1,items:_,filteredItems:y,filter:v,openOnInputClick:S=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:D=iR,virtualized:U=!1,inline:z=!1,fillInputOnItemPress:W=!0,modal:j=!1,limit:Y=-1,autoComplete:$="list",locale:V,submitOnItemClick:q=!1}=e,{clearErrors:H}=Zu(),{setDirty:P,validityData:B,shouldValidateOnChange:I,setFilled:G,name:K,disabled:J,validation:Z}=is(),ee=Sp({id:t}),X=CP({locale:V}),[F,se]=k.useState(!1),[re,ne]=k.useState(null),oe=k.useRef([]),ce=k.useRef([]),_e=k.useRef(null),ve=k.useRef(null),he=k.useRef(null),fe=k.useRef(!0),De=k.useRef(!1),Ae=k.useRef(null),Pe=k.useRef(null),Se=k.useRef(null),be=k.useRef(qo),ae=k.useRef(null),xe=k.useRef([]),Re=k.useRef([]),Ue=J||f,nt=K??p,He=c==="multiple",st=c==="single",et=a!==void 0||h!==void 0,ht=_!==void 0,qe=y!==void 0;let $e;E==="always"?$e="always":$e=E?"input-change":!1;const[ue,je]=js({controlled:o,default:He?s??mr:s,name:"Combobox",state:"selectedValue"}),rt=k.useMemo(()=>v===null?()=>!0:v!==void 0?v:st&&!F?SP(X,M,ue):bP(X,M),[v,st,ue,F,X,M]),Xe=qn(()=>et?h??"":st?kn(ue,M):"").current,[it,Ct]=js({controlled:a,default:Xe,name:"Combobox",state:"inputValue"}),[lt,tn]=js({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),kt=aR(_),vt=re??(it===""?"":String(it).trim()),Je=st?kn(ue,M):"",Ot=st&&!F&&vt!==""&&Je!==""&&Je.length===vt.length&&X.contains(Je,vt),jt=Ot?"":vt,at=ht&&qe&&Ot,wt=k.useMemo(()=>_?kt?_.flatMap(Ve=>Ve.items):_:mr,[_,kt]),bt=k.useMemo(()=>{if(y&&!at)return y;if(!_)return mr;if(kt){const tt=_,mt=[];let $t=0;for(const nn of tt){if(Y>-1&&$t>=Y)break;const gn=jt===""?nn.items:nn.items.filter(Xs=>rt(Xs,jt,M));if(gn.length===0)continue;const Ks=Y>-1?Y-$t:1/0,Ys=gn.slice(0,Ks);if(Ys.length>0){const Xs={...nn,items:Ys};mt.push(Xs),$t+=Ys.length}}return mt}if(jt==="")return Y>-1?wt.slice(0,Y):wt;const Ve=[];for(const tt of wt){if(Y>-1&&Ve.length>=Y)break;rt(tt,jt,M)&&Ve.push(tt)}return Ve},[y,at,_,kt,jt,Y,rt,M,wt]),St=k.useMemo(()=>kt?bt.flatMap(tt=>tt.items):bt,[bt,kt]),Qe=qn(()=>new ha({id:ee,selectedValue:ue,open:lt,filter:rt,query:vt,items:_,selectionMode:c,listRef:oe,labelsRef:ce,popupRef:_e,emptyRef:he,inputRef:ve,keyboardActiveRef:fe,chipsContainerRef:Ae,clearRef:Pe,valuesRef:xe,allValuesRef:Re,selectionEventRef:Se,name:nt,disabled:Ue,readOnly:g,required:b,grid:C,isGrouped:kt,virtualized:U,openOnInputClick:S,itemToStringLabel:M,isItemEqualToValue:D,modal:j,autoHighlight:$e,submitOnItemClick:q,hasInputValue:et,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||rn,setOpen:rn,setInputValue:rn,setSelectedValue:rn,setIndices:rn,onItemHighlighted:rn,handleSelection:rn,getItemProps:()=>en,forceMount:rn,requestSubmit:rn})).current,Ht=c==="none"?it:ue,wn=k.useMemo(()=>c==="none"?Ht:Array.isArray(ue)?ue.map(Ve=>ps(Ve,L)):ps(ue,L),[Ht,L,c,ue]),Kn=Oe(d),Bn=Oe(n),ys=Le(Qe,We.activeIndex),za=Le(Qe,We.selectedIndex),_r=Le(Qe,We.positionerElement),hn=Le(Qe,We.listElement),pn=Le(Qe,We.triggerElement),bs=Le(Qe,We.inputElement),yr=Le(Qe,We.inline),qs=Le(Qe,We.inputInsidePopup),jp=fn(pn),{mounted:hc,setMounted:wo,transitionStatus:Eo}=wi(lt),{openMethod:Gs,triggerProps:Ss,reset:Ro}=bp(lt);Ju({id:ee,name:nt,commit:Z.commit,value:Ht,controlRef:qs?jp:ve,getValue:()=>wn});const os=Oe(()=>{_?ce.current=St.map(Ve=>kn(Ve,M)):Qe.set("forceMounted",!0)}),mn=k.useRef(ue);Ne(()=>{ue!==mn.current&&os()},[os,ue]);const er=Oe(Ve=>{Qe.update(Ve);const tt=Ve.type||"none";if(Ve.activeIndex!==void 0)if(Ve.activeIndex===null)be.current!==qo&&(be.current=qo,Kn(void 0,du(tt,void 0,{index:-1})));else{const mt=xe.current[Ve.activeIndex];be.current={value:mt,index:Ve.activeIndex},Kn(mt,du(tt,void 0,{index:Ve.activeIndex}))}}),tr=Oe((Ve,tt)=>{if(De.current=tt.reason===eo,e.onInputValueChange?.(Ve,tt),!tt.isCanceled){if(tt.reason===ta){const mt=Ve.trim()!=="";mt&&se(!0),ae.current={hasQuery:mt},mt&&$e&&Qe.state.activeIndex==null&&Qe.set("activeIndex",0)}Ct(Ve)}}),br=Oe((Ve,tt)=>{lt!==Ve&&(tt.reason==="escape-key"&&ht&&St.length===0&&!Qe.state.emptyRef.current&&tt.allowPropagation(),e.onOpenChange?.(Ve,tt),!tt.isCanceled&&(!Ve&&F&&(st?(ne(vt),vt===""&&se(!1)):He&&(yr||qs?er({activeIndex:null}):ne(vt),tr("",Fe(eo,tt.event)))),tn(Ve)))}),as=Oe((Ve,tt)=>{if(u?.(Ve,tt),tt.isCanceled)return;je(Ve),(c==="none"&&_e.current&&W||st&&!Qe.state.inputInsidePopup)&&tr(kn(Ve,M),Fe(tt.reason,tt.event)),st&&Ve!=null&&tt.reason!==ta&&F&&ne(vt)}),Np=Oe((Ve,tt)=>{let mt=tt;if(mt===void 0){if(ys===null)return;mt=xe.current[ys]}const $t=An(Ve),nn=Se.current??Ve;Se.current=null;const gn=Fe(da,nn),Ks=$t?.closest("a")?.getAttribute("href");if(Ks){Ks.startsWith("#")&&br(!1,gn);return}if(He){const Ys=Array.isArray(ue)?ue:[],ls=sa(Ys,mt,Qe.state.isItemEqualToValue)?oR(Ys,mt,Qe.state.isItemEqualToValue):[...Ys,mt];if(as(ls,gn),!(ve.current?ve.current.value.trim()!=="":!1))return;Qe.state.inputInsidePopup?tr("",Fe(eo,gn.event)):br(!1,gn)}else as(mt,gn),br(!1,gn)}),Ha=Oe(()=>{if(!Qe.state.submitOnItemClick)return;const Ve=Qe.state.inputElement?.form;Ve&&typeof Ve.requestSubmit=="function"&&Ve.requestSubmit()}),Va=Oe(()=>{if(wo(!1),Bn?.(!1),se(!1),Ro(),ne(null),er(c==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),He&&ve.current&&ve.current.value!==""&&!De.current&&tr("",Fe(eo)),st)if(Qe.state.inputInsidePopup)ve.current&&ve.current.value!==""&&tr("",Fe(eo));else{const Ve=kn(ue,M);ve.current&&ve.current.value!==Ve&&tr(Ve,Fe(Ve===""?eo:Pn))}}),Bp=k.useMemo(()=>yr&&_r?{current:_r.closest('[role="dialog"]')}:_e,[yr,_r]);zr({enabled:!e.actionsRef,open:lt,ref:Bp,onComplete(){lt||Va()}}),k.useImperativeHandle(e.actionsRef,()=>({unmount:Va}),[Va]),Ne(function(){if(lt||c==="none")return;const tt=_?wt:Re.current;if(He){const mt=Array.isArray(ue)?ue:[],$t=mt[mt.length-1],nn=ql(tt,$t,D);er({selectedIndex:nn===-1?null:nn})}else{const mt=ql(tt,ue,D);er({selectedIndex:mt===-1?null:mt})}},[lt,ue,_,c,wt,He,D,er]),Ne(()=>{_&&(xe.current=St,oe.current.length=St.length)},[_,St]),Ne(()=>{const Ve=ae.current;if(Ve&&(Ve.hasQuery?$e&&Qe.set("activeIndex",0):$e==="always"&&Qe.set("activeIndex",0),ae.current=null),!lt&&!yr)return;const mt=ht||qe?St:xe.current,$t=Qe.state.activeIndex;if($t==null){if($e==="always"&&mt.length>0){Qe.set("activeIndex",0);return}be.current!==qo&&(be.current=qo,Qe.state.onItemHighlighted(void 0,du(Pn,void 0,{index:-1})));return}if($t>=mt.length){be.current!==qo&&(be.current=qo,Qe.state.onItemHighlighted(void 0,du(Pn,void 0,{index:-1}))),Qe.set("activeIndex",null);return}const nn=mt[$t],gn=be.current.value,Ks=gn!==ER&&Qe.state.isItemEqualToValue(nn,gn);(be.current.index!==$t||!Ks)&&(be.current={value:nn,index:$t},Qe.state.onItemHighlighted(nn,du(Pn,void 0,{index:$t})))},[ys,$e,qe,ht,St,yr,lt,Qe]),Ne(()=>{if(!_||c==="none")return;const Ve=wt;if(He){const $t=Array.isArray(ue)?ue:mr,nn=$t.filter(gn=>sa(Ve,gn,Qe.state.isItemEqualToValue));nn.length!==$t.length&&je(nn);return}if(ue==null?!0:sa(Ve,ue,Qe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&sa(Ve,s,Qe.state.isItemEqualToValue)&&(mt=s),je(mt),!Qe.state.inputInsidePopup){const $t=kn(mt,M);ve.current&&ve.current.value!==$t&&tr($t,Fe(Pn))}},[_,wt,He,c,ue,s,je,M,Qe,tr]),Ne(()=>{if(c==="none"){G(String(it)!=="");return}G(He?Array.isArray(ue)&&ue.length>0:ue!=null)},[G,c,it,ue,He]),k.useEffect(()=>{ht&&$e&&St.length===0&&er({activeIndex:null})},[ht,$e,St.length,er]),ia(vt,()=>{!lt||vt===""||vt===String(Xe)||se(!0)}),ia(ue,()=>{if(c!=="none"&&(H(nt),P(ue!==B.initialValue),I()?Z.commit(ue):Z.commit(ue,!0),He&&Qe.state.selectedIndex!==null&&(!Array.isArray(ue)||ue.length===0)&&er({activeIndex:null,selectedIndex:null}),st&&!et&&!qs)){const Ve=kn(ue,M);it!==Ve&&tr(Ve,Fe(Pn))}}),ia(it,()=>{c==="none"&&(H(nt),P(it!==B.initialValue),I()?Z.commit(it):Z.commit(it,!0))}),ia(_,()=>{if(!st||et||qs||F)return;const Ve=kn(ue,M);it!==Ve&&tr(Ve,Fe(Pn))});const $s=m0({open:yr?!0:lt,onOpenChange:br,elements:{reference:qs?pn:bs,floating:_r}});let Ri,Sr;yr||(Ri=C?"grid":"listbox",Sr=lt?"true":"false");const ir=k.useMemo(()=>{const Ve=bs?.tagName==="INPUT",tt=Ve||lt,mt=Ve?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return tt&&(mt.role="combobox",mt["aria-expanded"]=Sr,mt["aria-haspopup"]=Ri,mt["aria-controls"]=lt?hn?.id:void 0,mt["aria-autocomplete"]=$),{reference:mt,floating:{role:"presentation"}}},[bs,lt,Sr,Ri,hn?.id,$]),vd=Yu($s,{enabled:!g&&!Ue&&S,event:"mousedown-only",toggle:!1,touchOpenDelay:qs?0:50}),zp=pp($s,{enabled:!g&&!Ue&&!yr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:yr?!0:void 0,outsidePress(Ve){const tt=An(Ve);return!dt(pn,tt)&&!dt(Pe.current,tt)&&!dt(Ae.current,tt)}}),pc=g0($s,{enabled:!g&&!Ue,id:ee,listRef:oe,activeIndex:ys,selectedIndex:za,virtual:!0,loopFocus:!0,allowEscape:!$e,focusItemOnOpen:F||c==="none"&&!$e?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:C?2:1,orientation:C?"horizontal":void 0,disabledIndices:mr,onNavigate(Ve,tt){!tt&&!lt||Eo==="ending"||er(tt?{activeIndex:Ve,type:fe.current?"keyboard":"pointer"}:{activeIndex:Ve})}}),{getReferenceProps:Fa,getFloatingProps:ki,getItemProps:mc}=rc([ir,vd,zp,pc]);tR(()=>{Qe.update({inline:z,popupProps:ki(),inputProps:Fa(),triggerProps:Ss,getItemProps:mc,setOpen:br,setInputValue:tr,setSelectedValue:as,setIndices:er,onItemHighlighted:Kn,handleSelection:Np,forceMount:os,requestSubmit:Ha})}),Ne(()=>{Qe.update({id:ee,selectedValue:ue,open:lt,mounted:hc,transitionStatus:Eo,items:_,inline:z,popupProps:ki(),inputProps:Fa(),triggerProps:Ss,openMethod:Gs,getItemProps:mc,selectionMode:c,name:nt,disabled:Ue,readOnly:g,required:b,grid:C,isGrouped:kt,virtualized:U,onOpenChangeComplete:Bn,openOnInputClick:S,itemToStringLabel:M,modal:j,autoHighlight:$e,isItemEqualToValue:D,submitOnItemClick:q,hasInputValue:et,requestSubmit:Ha})},[Qe,ee,ue,lt,hc,Eo,_,ki,Fa,mc,Gs,Ss,c,nt,Ue,g,b,Z,C,kt,U,Bn,S,M,j,D,q,et,z,Ha,$e]);const or=ss(w,Z.inputRef),gc=k.useMemo(()=>({query:vt,filteredItems:bt,flatFilteredItems:St}),[vt,bt,St]),_d=k.useMemo(()=>Array.isArray(Ht)?"":ps(Ht,L),[Ht,L]),vc=He&&Array.isArray(ue)&&ue.length>0,Ti=k.useMemo(()=>!He||!Array.isArray(ue)||!nt?null:ue.map(Ve=>{const tt=ps(Ve,L);return x.jsx("input",{type:"hidden",name:nt,value:tt},tt)}),[He,ue,nt,L]),yd=x.jsxs(k.Fragment,{children:[e.children,x.jsx("input",{...Z.getInputValidationProps({onFocus(){if(qs){pn?.focus();return}(ve.current||pn)?.focus()},onChange(Ve){if(Ve.nativeEvent.defaultPrevented)return;const tt=Ve.target.value,mt=Fe(ta,Ve.nativeEvent);function $t(){if(He)return;if(c==="none"){P(tt!==B.initialValue),tr(tt,mt),I()&&Z.commit(tt);return}const nn=xe.current.find(gn=>ps(gn,L).toLowerCase()===tt.toLowerCase());nn!=null&&(P(nn!==B.initialValue),as?.(nn,mt),I()&&Z.commit(nn))}_?$t():(os(),queueMicrotask($t))}}),id:ee,name:He||c==="none"?void 0:nt,disabled:Ue,required:b&&!vc,readOnly:g,value:_d,ref:or,style:nc,tabIndex:-1,"aria-hidden":!0}),Ti]});return x.jsx(bR.Provider,{value:Qe,children:x.jsx(SR.Provider,{value:$s,children:x.jsx(xR.Provider,{value:gc,children:x.jsx(CR.Provider,{value:it,children:yd})})})})}const Xf=2,EP={...Au,...Aa},RP=k.forwardRef(function(t,n){const{render:s,className:o,nativeButton:u=!0,disabled:h=!1,...a}=t,{state:c,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:b}=is(),{labelId:w}=xo(),C=Ei(),_=Le(C,We.selectionMode),y=Le(C,We.disabled),v=Le(C,We.readOnly),S=Le(C,We.listElement),E=Le(C,We.triggerProps),T=Le(C,We.triggerElement),A=Le(C,We.inputInsidePopup),M=Le(C,We.open),L=Le(C,We.selectedValue),D=Le(C,We.activeIndex),U=Le(C,We.selectedIndex),z=Rp(),W=T0(),j=Qt(),Y=d||y||h,$=k.useRef("");function V(Z){$.current=Z.pointerType}const q=z.select("domReferenceElement");k.useEffect(()=>{A&&T&&T!==q&&z.set("domReferenceElement",T)},[T,q,z,A]);const{reference:H}=v0(z,{enabled:!M&&!v&&!y&&_==="single",listRef:C.state.labelsRef,activeIndex:D,selectedIndex:U,onMatch(Z){const ee=C.state.valuesRef.current[Z];ee!==void 0&&C.state.setSelectedValue(ee,Fe("none"))}}),{reference:P}=Yu(z,{enabled:!v&&!y,event:"mousedown"}),{buttonRef:B,getButtonProps:I}=Br({native:u,disabled:Y}),G=k.useMemo(()=>({...c,open:M,disabled:Y}),[c,M,Y]),K=Oe(Z=>{C.set("triggerElement",Z)});return ut("button",t,{ref:[n,B,K],state:G,props:[E,P,H,{tabIndex:A?0:-1,disabled:Y,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?S?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":w,onPointerDown:V,onPointerEnter:V,onFocus(){f(!0),!(Y||v)&&j.start(0,C.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const Z=_==="none"?W:L;b.commit(Z)}},onMouseDown(Z){if(Y||v||(A||z.set("domReferenceElement",Z.currentTarget),C.state.forceMount(),$.current!=="touch"&&(C.state.inputRef.current?.focus(),A||Z.preventDefault()),M))return;const ee=gr(Z.currentTarget);function X(F){if(!T)return;const se=An(F),re=C.state.positionerElement,ne=C.state.listElement;if(dt(T,se)||dt(re,se)||dt(ne,se)||se===T)return;const oe=b0(T),ce=F.clientX>=oe.left-Xf&&F.clientX<=oe.right+Xf,_e=F.clientY>=oe.top-Xf&&F.clientY<=oe.bottom+Xf;ce&&_e||C.state.setOpen(!1,Fe("cancel-open",F))}A&&ee.addEventListener("mouseup",X,{once:!0})},onKeyDown(Z){Y||v||(Z.key==="ArrowDown"||Z.key==="ArrowUp")&&(dn(Z),C.state.setOpen(!0,Fe(wu,Z.nativeEvent)),C.state.inputRef.current?.focus())}},b?b.getValidationProps(a):a,I],stateAttributesMapping:EP})}),kP=k.createContext(void 0);function TP(){return k.useContext(kP)}const RR=k.createContext(void 0);function L0(e){const t=k.useContext(RR);if(t===void 0&&!e)throw new Error(It(21));return t}const LP={...Au,...Aa,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},AP=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,id:h,...a}=t,{state:c,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:b}=is(),{labelId:w}=xo(),C=TP(),y=!!L0(!0),v=Ei(),{filteredItems:S}=Ma(),E=T0(),T=jr(h),A=Oa(),M=Le(v,We.disabled),L=Le(v,We.readOnly),D=Le(v,We.name),U=Le(v,We.selectionMode),z=Le(v,We.autoHighlight),W=Le(v,We.inputProps),j=Le(v,We.triggerProps),Y=Le(v,We.open),$=Le(v,We.mounted),V=Le(v,We.selectedValue),q=Le(v,We.popupSide),H=Le(v,We.positionerElement),P=!!z,B=$&&H?q:null,I=d||M||u,G=S.length===0,[K,J]=k.useState(null),Z=k.useRef(!1),ee=Oe(re=>{const ne=y||v.state.inline;ne&&!v.state.hasInputValue&&v.state.setInputValue("",Fe(Pn)),v.update({inputElement:re,inputInsidePopup:ne})}),X=k.useMemo(()=>({...c,open:Y,disabled:I,readOnly:L,popupSide:B,listEmpty:G}),[c,Y,I,L,B,G]);function F(re){if(!C)return;let ne;const{highlightedChipIndex:oe}=C;if(oe!==void 0){if(re.key==="ArrowLeft")re.preventDefault(),oe>0?ne=oe-1:ne=void 0;else if(re.key==="ArrowRight")re.preventDefault(),oe<V.length-1?ne=oe+1:ne=void 0;else if(re.key==="Backspace"||re.key==="Delete"){re.preventDefault();const ce=oe>=V.length-1?V.length-2:oe;ne=ce>=0?ce:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return ne}return re.key==="ArrowLeft"&&(re.currentTarget.selectionStart??0)===0&&V.length>0?(re.preventDefault(),ne=Math.max(V.length-1,0)):re.key==="Backspace"&&re.currentTarget.value===""&&V.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),re.preventDefault()),ne}return ut("input",t,{state:X,ref:[n,v.state.inputRef,ee],props:[W,j,{type:"text",value:t.value??K??E,"aria-readonly":L||void 0,"aria-labelledby":w,disabled:I,readOnly:L,...U==="none"&&D&&{name:D},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const re=U==="none"?E:V;b.commit(re)}},onCompositionStart(re){Mh||(Z.current=!0,J(re.currentTarget.value))},onCompositionEnd(re){Z.current=!1;const ne=re.currentTarget.value;J(null),v.state.setInputValue(ne,Fe(ta,re.nativeEvent))},onChange(re){if(Z.current){const _e=re.currentTarget.value;J(_e),_e===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,Fe(eo,re.nativeEvent));const ve=_e.trim(),he=P&&ve!=="";!L&&!I&&ve!==""&&(v.state.setOpen(!0,Fe(ta,re.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),Y&&v.state.activeIndex!==null&&!he&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(re.currentTarget.value,Fe(ta,re.nativeEvent));const ne=re.currentTarget.value==="",oe=Fe(eo,re.nativeEvent);ne&&!v.state.inputInsidePopup&&(U==="single"&&v.state.setSelectedValue(null,oe),v.state.openOnInputClick||v.state.setOpen(!1,oe));const ce=re.currentTarget.value.trim();!L&&!I&&ce!==""&&(v.state.setOpen(!0,Fe(ta,re.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),Y&&v.state.activeIndex!==null&&!P&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(re){if(I||L||re.ctrlKey||re.shiftKey||re.altKey||re.metaKey)return;v.state.keyboardActiveRef.current=!0;const ne=re.currentTarget,oe=ne.scrollWidth-ne.clientWidth,ce=A==="rtl";if(re.key==="Home"){dn(re);const ve=Ix&&ce?ne.value.length:0;ne.setSelectionRange(ve,ve),ne.scrollLeft=0;return}if(re.key==="End"){dn(re);const ve=Ix&&ce?0:ne.value.length;ne.setSelectionRange(ve,ve),ne.scrollLeft=ce?-oe:oe;return}if(!$&&re.key==="Escape"){const ve=U==="multiple"&&Array.isArray(V)?V.length===0:V===null,he=Fe(cp,re.nativeEvent),fe=U==="multiple"?[]:null;v.state.setInputValue("",he),v.state.setSelectedValue(fe,he),!ve&&!v.state.inline&&!he.isPropagationAllowed&&re.stopPropagation();return}if(C&&re.key==="Backspace"&&ne.value===""&&C.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,Fe(Pn,re.nativeEvent));return}const _e=F(re);if(C?.setHighlightedChipIndex(_e),_e!==void 0?C?.chipsRef.current[_e]?.focus():v.state.inputRef.current?.focus(),re.which!==229&&re.key==="Enter"&&Y){const ve=v.state.activeIndex,he=re.nativeEvent;if(ve===null){v.state.setOpen(!1,Fe(Pn,he));return}dn(re);const fe=v.state.listRef.current[ve];fe&&(v.state.selectionEventRef.current=he,fe.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},b?b.getValidationProps(a):a],stateAttributesMapping:LP})}),OP={...Vs,...e0},MP=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,keepMounted:a=!1,...c}=t,{disabled:d}=is(),p=Ei(),f=Le(p,We.selectionMode),g=Le(p,We.disabled),b=Le(p,We.readOnly),w=Le(p,We.open),C=Le(p,We.selectedValue),_=T0();let y=!1;f==="none"?y=_!=="":f==="single"?y=C!=null:y=Array.isArray(C)&&C.length>0;const v=d||g||u,{buttonRef:S,getButtonProps:E}=Br({native:h,disabled:v}),{mounted:T,transitionStatus:A,setMounted:M}=wi(y),L=k.useMemo(()=>({disabled:v,open:w,transitionStatus:A}),[v,w,A]);zr({open:y,ref:p.state.clearRef,onComplete(){y||M(!1)}});const D=ut("button",t,{state:L,ref:[n,S,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":b||void 0,onMouseDown(z){z.preventDefault()},onClick(z){if(v||b)return;const W=p.state.keyboardActiveRef;p.state.setInputValue("",Fe(Mx,z.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(C)?[]:null,Fe(Mx,z.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:W.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:W.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},c,E],stateAttributesMapping:OP});return a||T?D:null}),DP=k.createContext(null);function PP(){return k.useContext(DP)}function IP(e){const{children:t}=e,{filteredItems:n}=Ma(),s=PP(),o=s?s.items:n;return o?x.jsx(k.Fragment,{children:o.map(t)}):null}const jP=k.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,c=Ei(),d=Rp(),p=!!L0(!0),{filteredItems:f}=Ma(),g=Le(c,We.items),b=Le(c,We.labelsRef),w=Le(c,We.listRef),C=Le(c,We.selectionMode),_=Le(c,We.grid),y=Le(c,We.popupProps),v=Le(c,We.disabled),S=Le(c,We.readOnly),E=Le(c,We.virtualized),T=C==="multiple",A=f.length===0,M=Oe(j=>{c.set("positionerElement",j)}),L=Oe(j=>{c.set("listElement",j)}),D=k.useMemo(()=>typeof h=="function"?s||(s=x.jsx(IP,{children:h})):h,[h]),U=k.useMemo(()=>({empty:A}),[A]),z=d.useState("floatingId"),W=ut("div",t,{state:U,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||S)&&j.key==="Enter"){const Y=c.state.activeIndex;if(Y==null)return;dn(j);const $=j.nativeEvent,V=c.state.listRef.current[Y];V&&(c.state.selectionEventRef.current=$,V.click(),c.state.selectionEventRef.current=null)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},a]});return E?W:x.jsx(ed,{elementsRef:w,labelsRef:g?void 0:b,children:W})}),kR=k.createContext(void 0);function NP(){const e=k.useContext(kR);if(e===void 0)throw new Error(It(20));return e}const BP=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ei(),h=Le(u,We.mounted),a=Le(u,We.forceMounted);return h||s||a?x.jsx(kR.Provider,{value:s,children:x.jsx(dp,{ref:n,...o})}):null}),zP=k.forwardRef(function(t,n){const{render:s,className:o,anchor:u,positionMethod:h="absolute",side:a="bottom",align:c="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:_=K_,...y}=t,v=Ei(),{filteredItems:S}=Ma(),E=Rp(),T=NP(),A=Le(v,We.modal),M=Le(v,We.open),L=Le(v,We.mounted),D=Le(v,We.openMethod),U=Le(v,We.triggerElement),z=Le(v,We.inputElement),W=Le(v,We.inputInsidePopup),j=S.length===0,$=S0({anchor:u??(W?U:z),floatingRootContext:E,positionMethod:h,mounted:L,side:a,sideOffset:d,align:c,alignOffset:p,arrowPadding:b,collisionBoundary:f,collisionPadding:g,sticky:w,disableAnchorTracking:C,keepMounted:T,collisionAvoidance:_,lazyFlip:!0});yp(M&&A&&D!=="touch",U);const V=k.useMemo(()=>{const I={...$.positionerStyles};return M||(I.pointerEvents="none"),{role:"presentation",hidden:!L,style:I}},[M,L,$.positionerStyles]),q=k.useMemo(()=>({open:M,side:$.side,align:$.align,anchorHidden:$.anchorHidden,empty:j}),[M,$.side,$.align,$.anchorHidden,j]);Ne(()=>{v.set("popupSide",$.side)},[v,$.side]);const H=k.useMemo(()=>({side:$.side,align:$.align,arrowRef:$.arrowRef,arrowUncentered:$.arrowUncentered,arrowStyles:$.arrowStyles,anchorHidden:$.anchorHidden,isPositioned:$.isPositioned}),[$.side,$.align,$.arrowRef,$.arrowUncentered,$.arrowStyles,$.anchorHidden,$.isPositioned]),P=Oe(I=>{v.set("positionerElement",I)}),B=ut("div",t,{state:q,ref:[n,P],props:[V,y],stateAttributesMapping:yo});return x.jsxs(RR.Provider,{value:H,children:[L&&A&&x.jsx(_p,{inert:vp(!M),cutout:z??U}),B]})}),HP={...yo,...Vs},VP=k.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,c=Ei(),d=L0(),p=Rp(),{filteredItems:f}=Ma(),g=Le(c,We.mounted),b=Le(c,We.open),w=Le(c,We.openMethod),C=Le(c,We.transitionStatus),_=Le(c,We.inputInsidePopup),y=Le(c,We.inputElement),v=f.length===0;zr({open:b,ref:c.state.popupRef,onComplete(){b&&c.state.onOpenChangeComplete(!0)}});const S=k.useMemo(()=>({open:b,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:C,empty:v}),[b,d.side,d.align,d.anchorHidden,C,v]),E=ut("div",t,{state:S,ref:[n,c.state.popupRef],props:[{role:_?"dialog":"presentation",tabIndex:-1,onFocus(L){const D=An(L.nativeEvent);w!=="touch"&&(dt(c.state.listElement,D)||D===L.currentTarget)&&c.state.inputRef.current?.focus()}},C0(C),a],stateAttributesMapping:HP}),A=u===void 0?_?L=>L==="touch"?c.state.popupRef.current:y:!1:u;let M;return h!=null?M=h:M=_?void 0:!1,x.jsx(fp,{context:p,disabled:!g,modal:!_,openInteractionType:w,initialFocus:A,returnFocus:M,children:E})}),TR=k.createContext(void 0);function LR(){const e=k.useContext(TR);if(!e)throw new Error(It(19));return e}const FP=k.createContext(!1);function UP(){return k.useContext(FP)}const WP=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,index:h,disabled:a=!1,nativeButton:c=!1,...d}=t,p=k.useRef(!1),f=k.useRef(null),g=td({index:h,textRef:f,indexGuessBehavior:w0.GuessFromOrder}),b=Ei(),w=UP(),{flatFilteredItems:C}=Ma(),_=Le(b,We.open),y=Le(b,We.selectionMode),v=Le(b,We.readOnly),S=Le(b,We.virtualized),E=Le(b,We.isItemEqualToValue),T=y!=="none",A=h??(S?ql(C,u,E):g.index),M=g.index!==-1,L=Le(b,We.id),D=Le(b,We.isActive,A),U=Le(b,We.isSelected,u),z=Le(b,We.items),W=Le(b,We.getItemProps),j=k.useRef(null),Y=L!=null&&M?`${L}-${A}`:void 0,$=U&&T;Ne(()=>{if(!(M&&(S||h!=null)))return;const Z=b.state.listRef.current;return Z[A]=j.current,()=>{delete Z[A]}},[M,S,A,h,b]),Ne(()=>{if(!M||z)return;const J=b.state.valuesRef.current;return J[A]=u,y!=="none"&&b.state.allValuesRef.current.push(u),()=>{delete J[A]}},[M,z,A,u,b,y]),Ne(()=>{if(!_){p.current=!1;return}if(!M||z)return;const J=b.state.selectedValue,Z=Array.isArray(J)?J[J.length-1]:J;Si(Z,u,E)&&b.set("selectedIndex",A)},[M,z,_,b,A,u,E]);const V=k.useMemo(()=>({disabled:a,selected:$,highlighted:D}),[a,$,D]),q=W({active:D,selected:$});q.id=void 0,q.onFocus=void 0;const{getButtonProps:H,buttonRef:P}=Br({disabled:a,focusableWhenDisabled:!0,native:c});function B(J){function Z(){b.state.handleSelection(J,u)}b.state.submitOnItemClick?(Jn.flushSync(Z),b.state.requestSubmit()):Z()}const I={id:Y,role:w?"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)}},G=ut("div",t,{ref:[P,n,g.ref,j],state:V,props:[q,I,d,H]}),K=k.useMemo(()=>({selected:$,textRef:f}),[$,f]);return x.jsx(TR.Provider,{value:K,children:G})})),qP=k.forwardRef(function(t,n){const{render:s,className:o,children:u,...h}=t,{filteredItems:a}=Ma(),c=Ei(),d=a.length===0?u:null;return ut("div",t,{ref:[n,c.state.emptyRef],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},h]})});let pC=(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 AR(e){return k.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[pC.checked]:""}:{[pC.unchecked]:""}},...Aa}),[e.indeterminate])}const OR=k.createContext(void 0);function GP(){const e=k.useContext(OR);if(e===void 0)throw new Error(It(14));return e}const $P="data-parent",KP=k.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u=!1,disabled:h=!1,id:a,indeterminate:c=!1,inputRef:d,name:p,onCheckedChange:f,parent:g=!1,readOnly:b=!1,render:w,required:C=!1,uncheckedValue:_,value:y,nativeButton:v=!1,...S}=t,{clearErrors:E}=Zu(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:D,setTouched:U,state:z,validationMode:W,validityData:j,shouldValidateOnChange:Y,validation:$}=is(),V=_8(),{labelId:q,controlId:H,setControlId:P,getDescriptionProps:B}=xo(),I=b8(),G=I?.parent,K=G&&I.allValues,J=T||V.disabled||I?.disabled||h,Z=A??p,ee=y??Z,X=jr(),F=jr();let se=H;K?se=g?F:`${G.id}-${ee}`:a&&(se=a);let re={};K&&(g?re=I.parent.getParentProps():ee&&(re=I.parent.getChildProps(ee)));const ne=Oe(f),{checked:oe=s,indeterminate:ce=c,onCheckedChange:_e,...ve}=re,he=I?.value,fe=I?.setValue,De=I?.defaultValue,Ae=k.useRef(null),{getButtonProps:Pe,buttonRef:Se}=Br({disabled:J,native:v}),be=I?.validation??$,[ae,xe]=js({controlled:ee&&he&&!g?he.includes(ee):oe,default:ee&&De&&!g?De.includes(ee):u,name:"Checkbox",state:"checked"});Ne(()=>{if(P!==rn)return P(se),()=>{P(void 0)}},[se,I,P,g]),Ju({enabled:!I,id:X,commit:be.commit,value:ae,controlRef:Ae,name:Z,getValue:()=>ae});const Re=k.useRef(null),Ue=ss(d,Re,be.inputRef);Ne(()=>{Re.current&&(Re.current.indeterminate=ce,ae&&L(!0))},[ae,ce,L]),ia(ae,()=>{I&&!g||(E(Z),L(ae),M(ae!==j.initialValue),Y()?be.commit(ae):be.commit(ae,!0))});const nt=zs({checked:ae,disabled:J,name:g?void 0:Z,id:se??void 0,required:C,ref:Ue,style:nc,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange($e){if($e.nativeEvent.defaultPrevented)return;const ue=$e.target.checked,je=Fe(Pn,$e.nativeEvent);if(_e?.(ue,je),ne(ue,je),!je.isCanceled&&(xe(ue),ee&&he&&fe&&!g)){const rt=ue?[...he,ee]:he.filter(Xe=>Xe!==ee);fe(rt,je)}},onFocus(){Ae.current?.focus()}},y!==void 0?{value:(I?ae&&y:y)||""}:en,B,I?be.getValidationProps:be.getInputValidationProps),He=K?!!oe:ae,st=K&&ce||c;k.useEffect(()=>{G&&ee&&G.disabledStatesRef.current.set(ee,J)},[G,J,ee]);const et=k.useMemo(()=>({...z,checked:He,disabled:J,readOnly:b,required:C,indeterminate:st}),[z,He,J,b,C,st]),ht=AR(et),qe=ut("span",t,{state:et,ref:[Se,Ae,n,I?.registerControlRef],props:[{id:X,role:"checkbox","aria-checked":ce?"mixed":ae,"aria-readonly":b||void 0,"aria-required":C||void 0,"aria-labelledby":q,[$P]:g?"":void 0,onFocus(){D(!0)},onBlur(){const $e=Re.current;$e&&(U(!0),D(!1),W==="onBlur"&&be.commit(I?he:$e.checked))},onClick($e){b||J||($e.preventDefault(),Re.current?.click())}},B,be.getValidationProps,S,ve,Pe],stateAttributesMapping:ht});return x.jsxs(OR.Provider,{value:et,children:[qe,!ae&&!I&&Z&&!g&&_!==void 0&&x.jsx("input",{type:"hidden",name:Z,value:_}),x.jsx("input",{...nt})]})}),YP=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=GP(),c=a.checked||a.indeterminate,{transitionStatus:d,setMounted:p}=wi(c),f=k.useRef(null),g=k.useMemo(()=>({...a,transitionStatus:d}),[a,d]);zr({open:c,ref:f,onComplete(){c||p(!1)}});const b=AR(a),w=k.useMemo(()=>({...b,...Vs,...Aa}),[b]),C=u||c,_=ut("span",t,{enabled:C,ref:[n,f],state:g,stateAttributesMapping:w,props:h});return C?_:null});function XP(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return x.jsx(wP,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const QP=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=LR();return s||o?x.jsx(ZP,{...t,ref:n}):null}),ZP=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=LR(),a=k.useRef(null),{transitionStatus:c,setMounted:d}=wi(h),p=k.useMemo(()=>({selected:h,transitionStatus:c}),[h,c]),f=ut("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Vs});return zr({open:h,ref:a,onComplete(){h||d(!1)}}),f})),JP=k.createContext(void 0);function kp(e=!0){const t=k.useContext(JP);if(t===void 0&&!e)throw new Error(It(25));return t}const MR=k.createContext(void 0);function DR(e){const t=k.useContext(MR);if(t===void 0&&!e)throw new Error(It(33));return t}const PR=k.createContext(void 0);function Da(e){const t=k.useContext(PR);if(t===void 0&&!e)throw new Error(It(36));return t}const e9={type:"regular-item"};function t9(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:o,store:u,nativeButton:h,itemMetadata:a,nodeId:c}=e,d=k.useRef(null),p=kp(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:b,buttonRef:w}=Br({disabled:n,focusableWhenDisabled:!0,native:h}),C=k.useCallback(y=>zs({id:o,role:"menuitem",tabIndex:s?0:-1,onMouseMove(v){c&&g.emit("itemhover",{nodeId:c,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:da})},onMouseUp(v){if(p){const S=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&S&&Math.abs(v.clientX-S.x)<=1&&Math.abs(v.clientY-S.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&d.current.click()}},y,b),[o,s,b,t,g,u,f,p,a,c]),_=ss(d,w);return k.useMemo(()=>({getItemProps:C,itemRef:_}),[C,_])}let mC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const IR={checked(e){return e?{[mC.checked]:""}:{[mC.unchecked]:""}},...Vs},n9={...yo,...Vs},r9=k.forwardRef(function(t,n){const{render:s,className:o,finalFocus:u,...h}=t,{store:a}=Da(),{side:c,align:d}=DR(),p=hR()!=null,f=a.useState("open"),g=a.useState("transitionStatus"),b=a.useState("popupProps"),w=a.useState("mounted"),C=a.useState("instantType"),_=a.useState("activeTriggerElement"),y=a.useState("parent"),v=a.useState("lastOpenChangeReason"),S=a.useState("rootId"),E=a.useState("floatingRootContext"),T=a.useState("floatingTreeRoot"),A=a.useState("closeDelay"),M=a.useState("activeTriggerElement");zr({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),k.useEffect(()=>{function j(Y){a.setOpen(!1,Fe(Y.reason,Y.domEvent))}return T.events.on("close",j),()=>{T.events.off("close",j)}},[T.events,a]);const L=a.useState("hoverEnabled"),D=a.useState("disabled");O6(E,{enabled:L&&!D&&y.type!=="context-menu"&&y.type!=="menubar",closeDelay:A});const U=k.useMemo(()=>({transitionStatus:g,side:c,align:d,open:f,nested:y.type==="menu",instant:C}),[g,c,d,f,y.type,C]),z=ut("div",t,{state:U,ref:[n,a.context.popupRef],stateAttributesMapping:n9,props:[b,{onKeyDown(j){p&&_0.has(j.key)&&j.stopPropagation()}},C0(g),h,{"data-rootownerid":S}]});let W=y.type===void 0||y.type==="context-menu";return(_||y.type==="menubar"&&v!==t0)&&(W=!0),x.jsx(fp,{context:E,modal:!1,disabled:!w,returnFocus:u===void 0?W: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})}),jR=k.createContext(void 0);function s9(){const e=k.useContext(jR);if(e===void 0)throw new Error(It(32));return e}const i9=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Da();return u.useState("mounted")||s?x.jsx(jR.Provider,{value:s,children:x.jsx(dp,{ref:n,...o})}):null}),o9=k.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a,align:c,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:_=K_,...y}=t,{store:v}=Da(),S=s9(),E=kp(!0),T=v.useState("parent"),A=v.useState("floatingRootContext"),M=v.useState("floatingTreeRoot"),L=v.useState("mounted"),D=v.useState("open"),U=v.useState("modal"),z=v.useState("activeTriggerElement"),W=v.useState("lastOpenChangeReason"),j=v.useState("floatingNodeId"),Y=v.useState("floatingParentNodeId");let $=s,V=d,q=p,H=c,P=_;T.type==="context-menu"&&($=s??T.context?.anchor,H=H??"start",!a&&H!=="center"&&(q=t.alignOffset??2,V=t.sideOffset??-5));let B=a,I=H;T.type==="menu"?(B=B??"inline-end",I=I??"start",P=t.collisionAvoidance??HO):T.type==="menubar"&&(B=B??"bottom",I=I??"start");const G=T.type==="context-menu",K=S0({anchor:$,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:B,sideOffset:V,align:I,alignOffset:q,arrowPadding:G?0:b,collisionBoundary:f,collisionPadding:g,sticky:w,nodeId:j,keepMounted:S,disableAnchorTracking:C,collisionAvoidance:P,shiftCrossAxis:G,externalTree:M}),J=k.useMemo(()=>{const re={};return D||(re.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...K.positionerStyles,...re}}},[D,L,K.positionerStyles]);k.useEffect(()=>{function re(ne){ne.open?(ne.parentNodeId===j&&v.set("hoverEnabled",!1),ne.nodeId!==j&&ne.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,Fe(_u))):ne.parentNodeId===j&&ne.reason!==_u&&v.set("hoverEnabled",!0)}return M.events.on("menuopenchange",re),()=>{M.events.off("menuopenchange",re)}},[v,M.events,j]),k.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function re(ne){if(ne.open||ne.nodeId!==v.select("floatingParentNodeId"))return;const oe=ne.reason??_u;v.setOpen(!1,Fe(oe))}return M.events.on("menuopenchange",re),()=>{M.events.off("menuopenchange",re)}},[M.events,v]),k.useEffect(()=>{function re(ne){!D||ne.nodeId!==v.select("floatingParentNodeId")||ne.target&&z&&z!==ne.target&&v.setOpen(!1,Fe(_u))}return M.events.on("itemhover",re),()=>{M.events.off("itemhover",re)}},[M.events,D,z,v]),k.useEffect(()=>{const re={open:D,nodeId:j,parentNodeId:Y,reason:v.select("lastOpenChangeReason")};M.events.emit("menuopenchange",re)},[M.events,D,v,j,Y]);const Z=k.useMemo(()=>({open:D,side:K.side,align:K.align,anchorHidden:K.anchorHidden,nested:T.type==="menu"}),[D,K.side,K.align,K.anchorHidden,T.type]),ee=k.useMemo(()=>({side:K.side,align:K.align,arrowRef:K.arrowRef,arrowUncentered:K.arrowUncentered,arrowStyles:K.arrowStyles,nodeId:K.context.nodeId}),[K.side,K.align,K.arrowRef,K.arrowUncentered,K.arrowStyles,K.context.nodeId]),X=ut("div",t,{state:Z,stateAttributesMapping:yo,ref:[n,v.useStateSetter("positionerElement")],props:[J,y]}),F=L&&T.type!=="menu"&&(T.type!=="menubar"&&U&&W!==Dr||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=z),x.jsxs(MR.Provider,{value:ee,children:[F&&x.jsx(_p,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:vp(!D),cutout:se}),x.jsx(nD,{id:j,children:x.jsx(ed,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),NR=k.createContext(void 0);function a9(){const e=k.useContext(NR);if(e===void 0)throw new Error(It(34));return e}const l9=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u,defaultValue:h,onValueChange:a,disabled:c=!1,...d}=t,[p,f]=js({controlled:u,default:h,name:"MenuRadioGroup"}),g=Oe(a),b=Oe((y,v)=>{g?.(y,v),!v.isCanceled&&f(y)}),w=k.useMemo(()=>({disabled:c}),[c]),C=ut("div",t,{state:w,ref:n,props:{role:"group","aria-disabled":c||void 0,...d}}),_=k.useMemo(()=>({value:p,setValue:b,disabled:c}),[p,b,c]);return x.jsx(NR.Provider,{value:_,children:C})})),BR=k.createContext(void 0);function c9(){const e=k.useContext(BR);if(e===void 0)throw new Error(It(35));return e}const u9=k.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:c=!1,closeOnClick:d=!1,value:p,...f}=t,g=td({label:h}),b=DR(!0),w=jr(u),{store:C}=Da(),_=C.useState("isActive",g.index),y=C.useState("itemProps"),{value:v,setValue:S,disabled:E}=a9(),T=E||c,A=v===p,{getItemProps:M,itemRef:L}=t9({closeOnClick:d,disabled:T,highlighted:_,id:w,store:C,nativeButton:a,nodeId:b?.nodeId,itemMetadata:e9}),D=k.useMemo(()=>({disabled:T,highlighted:_,checked:A}),[T,_,A]),U=Oe(W=>{const j={...Fe(da,W.nativeEvent),preventUnmountOnClose:()=>{}};S(p,j)}),z=ut("div",t,{state:D,stateAttributesMapping:IR,props:[y,{role:"menuitemradio","aria-checked":A,onClick:U},f,M],ref:[L,n,g.ref]});return x.jsx(BR.Provider,{value:D,children:z})}),d9=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=c9(),c=k.useRef(null),{transitionStatus:d,setMounted:p}=wi(a.checked);zr({open:a.checked,ref:c,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 ut("span",t,{state:f,stateAttributesMapping:IR,ref:[n,c],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),f9=k.createContext(null);function zR(e){return k.useContext(f9)}const h9={...HE,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 A0 extends h0{constructor(t){super({...p9(),...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},h9),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 qn(()=>t??new A0(n)).current}unsubscribeParentListener=null}function p9(){return{...zE(),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 u0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:en,keyboardEventRelay:void 0,closeDelay:0}}const m9=k.createContext(void 0);function g9(){return k.useContext(m9)}function v9(e){const{children:t,open:n,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:u=!1,disabled:h=!1,modal:a,loopFocus:c=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:f=!1,handle:g,triggerId:b,defaultTriggerId:w=null,highlightItemOnHover:C=!0}=e,_=kp(!0),y=Da(!0),v=zR(),S=g9(),E=k.useMemo(()=>S&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:_&&!y?{type:"context-menu",context:_}:{type:void 0},[_,y,v,S]),T=A0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=xE(A),L=Ci();Ne(()=>{_&&!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",b,w),T.useContextCallback("onOpenChangeComplete",o);const D=T.useState("open"),U=T.useState("activeTriggerElement"),z=T.useState("positionerElement"),W=T.useState("hoverEnabled"),j=T.useState("modal"),Y=T.useState("disabled"),$=T.useState("lastOpenChangeReason"),V=T.useState("parent"),q=T.useState("activeIndex"),H=T.useState("payload"),P=T.useState("floatingParentNodeId"),B=k.useRef(null),I=P!=null;let G;T.useSyncedValues({disabled:h,modal:V.type===void 0?a:void 0,rootId:Ta()});const{openMethod:K,triggerProps:J,reset:Z}=bp(D);NE(T);const{forceUnmount:ee}=BE(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&&$!==Dr&&K!=="touch",z),Ne(()=>{!D&&!W&&T.set("hoverEnabled",!0)},[D,W,T]);const se=k.useRef(!0),re=Qt(),ne=Oe((ue,je)=>{const rt=je.reason;if(D===ue&&je.trigger===U||(je.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!ue&&je.trigger==null&&(je.trigger=U??void 0),s?.(ue,je),je.isCanceled))return;const Xe={open:ue,nativeEvent:je.event,reason:je.reason,nested:I};G?.emit("openchange",Xe);const it=je.event;if(ue===!1&&it?.type==="click"&&it.pointerType==="touch"&&!se.current)return;if(!ue&&q!==null){const kt=T.context.itemDomElements.current[q];queueMicrotask(()=>{kt?.setAttribute("tabindex","-1")})}ue&&rt===Oh?(se.current=!1,re.start(300,()=>{se.current=!0})):(se.current=!0,re.clear());const Ct=(rt===ua||rt===da)&&it.detail===0&&it?.isTrusted,lt=!ue&&(rt===cp||rt==null);function tn(){const kt={open:ue,openChangeReason:rt};B.current=je.event??null;const vt=je.trigger?.id??null;(vt||ue)&&(kt.activeTriggerId=vt,kt.activeTriggerElement=je.trigger??null),T.update(kt)}rt===Dr?Jn.flushSync(tn):tn(),V.type==="menubar"&&(rt===Oh||rt===xa||rt===Dr||rt===wu||rt===_u)?T.set("instantType","group"):Ct||lt?T.set("instantType",Ct?"click":"dismiss"):T.set("instantType",void 0)}),oe=k.useCallback(ue=>{const je=Fe(ue);return je.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},je},[T]),ce=k.useCallback(()=>{T.setOpen(!1,oe(G2))},[T,oe]);k.useImperativeHandle(p,()=>({unmount:ee,close:ce}),[ee,ce]);let _e;V.type==="context-menu"&&(_e=V.context),k.useImperativeHandle(_e?.positionerRef,()=>z,[z]),k.useImperativeHandle(_e?.actionsRef,()=>({setOpen:ne}),[ne]);const ve=VE({popupStore:T,onOpenChange:ne});G=ve.context.events,k.useEffect(()=>{const ue=({open:je,eventDetails:rt})=>ne(je,rt);return G.on("setOpen",ue),()=>{G?.off("setOpen",ue)}},[G,ne]);const he=pp(ve,{enabled:!Y,bubbles:f&&V.type==="menu",outsidePress(){return V.type!=="context-menu"||B.current?.type==="contextmenu"?!0:X.current},externalTree:I?A:void 0}),fe=UE(ve,{role:"menu"}),De=Oa(),Ae=k.useCallback(ue=>{T.select("activeIndex")!==ue&&T.set("activeIndex",ue)},[T]),Pe=g0(ve,{enabled:!Y,listRef:T.context.itemDomElements,activeIndex:q,nested:V.type!==void 0,loopFocus:c,orientation:d,parentOrientation:V.type==="menubar"?V.context.orientation:void 0,rtl:De==="rtl",disabledIndices:mr,onNavigate:Ae,openOnArrowKeyDown:V.type!=="context-menu",externalTree:I?A:void 0,focusItemOnHover:C}),Se=k.useCallback(ue=>{T.context.typingRef.current=ue},[T]),be=v0(ve,{listRef:T.context.itemLabels,activeIndex:q,resetMs:NO,onMatch:ue=>{D&&ue!==q&&T.set("activeIndex",ue)},onTypingChange:Se}),{getReferenceProps:ae,getFloatingProps:xe,getItemProps:Re,getTriggerProps:Ue}=rc([he,fe,Pe,be]),nt=k.useMemo(()=>{const ue=zs(ae(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},J);return delete ue.role,ue},[ae,T,J]),He=k.useMemo(()=>{const ue=Ue();if(!ue)return ue;const je=zs(ue,J);return delete je.role,delete je["aria-controls"],je},[Ue,J]),st=Ku(),et=k.useMemo(()=>xe({onMouseEnter(){V.type==="menu"&&st.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(ue){const je=T.select("keyboardEventRelay");je&&!ue.isPropagationStopped()&&je(ue)}}),[xe,V.type,st,T]),ht=k.useMemo(()=>Re(),[Re]);T.useSyncedValues({floatingRootContext:ve,activeTriggerProps:nt,inactiveTriggerProps:He,popupProps:et,itemProps:ht});const qe=k.useMemo(()=>({store:T,parent:E}),[T,E]),$e=x.jsx(PR.Provider,{value:qe,children:typeof t=="function"?t({payload:H}):t});return V.type===void 0||V.type==="context-menu"?x.jsx(rD,{externalTree:A,children:$e}):$e}function _9(e){const{render:t,className:n,state:s=en,props:o=mr,refs:u=mr,metadata:h,stateAttributesMapping:a,tag:c="div",...d}=e,{compositeProps:p,compositeRef:f}=_R({metadata:h});return ut(c,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function HR(e){if(Jt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ps(e))return HR(Bs(e))}function y9(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,gr(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:en,[t,n,s])}const Qf=2,b9=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,openOnHover:c,delay:d=100,closeDelay:p=0,handle:f,payload:g,...b}=t,w=Da(!0),C=f?.store??w?.store;if(!C)throw new Error(It(85));const _=jr(a),y=C.useState("isTriggerActive",_),v=C.useState("floatingRootContext"),S=C.useState("isOpenedByTrigger",_),E=k.useRef(null),T=x9(),A=G_(!0),M=So(),L=k.useMemo(()=>M??new u0,[M]),D=xE(L),U=Ci(),{registerTrigger:z,isMountedByThisTrigger:W}=jE(_,E,C,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:D,floatingParentNodeId:U,keyboardEventRelay:A?.relayKeyboardEvent}),j=C.useState("disabled"),Y=u||j||T.type==="menubar"&&T.context.disabled,{getButtonProps:$,buttonRef:V}=Br({disabled:Y,native:h});k.useEffect(()=>{!S&&T.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,S,T.type]);const q=k.useRef(null),H=Qt(),P=Oe(fe=>{if(!q.current)return;H.clear(),C.context.allowMouseUpTriggerRef.current=!1;const De=fe.target;if(dt(q.current,De)||dt(C.select("positionerElement"),De)||De===q.current||De!=null&&HR(De)===C.select("rootId"))return;const Ae=b0(q.current);fe.clientX>=Ae.left-Qf&&fe.clientX<=Ae.right+Qf&&fe.clientY>=Ae.top-Qf&&fe.clientY<=Ae.bottom+Qf||L.events.emit("close",{domEvent:fe,reason:q2})});k.useEffect(()=>{S&&C.select("lastOpenChangeReason")===Dr&&gr(q.current).addEventListener("mouseup",P,{once:!0})},[S,P,C]);const B=T.type==="menubar"&&T.context.hasSubmenuOpen,G=P6(v,{enabled:(c??B??!1)&&!Y&&T.type!=="context-menu"&&(T.type!=="menubar"||B&&!W),handleClose:H6({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}),K=S9(S,C.select("lastOpenChangeReason")),J=Yu(v,{enabled:!Y&&T.type!=="context-menu",event:S&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?K:!1}),Z=k6(v,{enabled:!Y&&(T.type!=="menubar"&&S||B)}),ee=y9({open:S,enabled:T.type==="menubar",mouseDownAction:"open"}),X=rc([J,Z]),F=T.type==="menubar",se=k.useMemo(()=>({disabled:Y,open:S}),[Y,S]),re=C.useState("triggerProps",W),ne=[q,n,V,z,E],oe=[X.getReferenceProps(),G??en,re,{"aria-haspopup":"menu",id:_,onMouseDown:fe=>{if(C.select("open"))return;H.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),gr(fe.currentTarget).addEventListener("mouseup",P,{once:!0})}},F?{role:"menuitem"}:{},ee,b,$],ce=k.useRef(null),_e=Oe(fe=>{Jn.flushSync(()=>{C.setOpen(!1,Fe(xa,fe.nativeEvent,fe.currentTarget))}),eD(ce.current)?.focus()}),ve=Oe(fe=>{const De=C.select("positionerElement");if(De&&kl(fe,De))C.context.beforeContentFocusGuardRef.current?.focus();else{Jn.flushSync(()=>{C.setOpen(!1,Fe(xa,fe.nativeEvent,fe.currentTarget))});let Ae=J4(E.current);for(;Ae!==null&&dt(De,Ae)||Ae?.hasAttribute("aria-hidden");){const Pe=Ae;if(Ae=c0(Ae),Ae===Pe)break}Ae?.focus()}}),he=ut("button",t,{enabled:!F,stateAttributesMapping:Au,state:se,ref:ne,props:oe});return F?x.jsx(_9,{tag:"button",render:s,className:o,state:se,refs:ne,props:oe,stateAttributesMapping:Au}):S?x.jsxs(k.Fragment,{children:[x.jsx(Wl,{ref:ce,onFocus:_e},`${_}-pre-focus-guard`),x.jsx(k.Fragment,{children:he},_),x.jsx(Wl,{ref:C.context.triggerFocusTargetRef,onFocus:ve},`${_}-post-focus-guard`)]}):x.jsx(k.Fragment,{children:he},_)});function S9(e,t){const n=Qt(),[s,o]=k.useState(!1);return Ne(()=>{e&&t==="trigger-hover"?(o(!0),n.start(BO,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function x9(){const e=kp(!0),t=Da(!0),n=zR();return k.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function pi(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const VR=k.createContext(void 0);function Tp(){const e=k.useContext(VR);if(e===void 0)throw new Error(It(53));return e}let Fh=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Zf=500,gC=16;function ts(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 C9=(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 O0={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},vC={width:0,height:0},w9={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},E9=k.forwardRef(function(t,n){const{render:s,className:o,overflowEdgeThreshold:u,...h}=t,[a,c]=k.useState(!1),[d,p]=k.useState(!1),[f,g]=k.useState(!1),[b,w]=k.useState(vC),[C,_]=k.useState(vC),[y,v]=k.useState(!1),[S,E]=k.useState(w9),T=jr(),A=k.useRef(null),M=k.useRef(null),L=k.useRef(null),D=k.useRef(null),U=k.useRef(null),z=k.useRef(null),W=k.useRef(null),j=k.useRef(!1),Y=k.useRef(0),$=k.useRef(0),V=k.useRef(0),q=k.useRef(0),H=k.useRef("vertical"),P=Qt(),B=Qt(),I=k.useRef({x:0,y:0}),[G,K]=k.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),J=R9(u),Z=Oe(_e=>{const ve=_e.x-I.current.x,he=_e.y-I.current.y;I.current=_e,he!==0&&(g(!0),P.start(Zf,()=>{g(!1)})),ve!==0&&(p(!0),B.start(Zf,()=>{p(!1)}))}),ee=Oe(_e=>{_e.button===0&&(j.current=!0,Y.current=_e.clientY,$.current=_e.clientX,H.current=_e.currentTarget.getAttribute(C9.orientation),M.current&&(V.current=M.current.scrollTop,q.current=M.current.scrollLeft),U.current&&H.current==="vertical"&&U.current.setPointerCapture(_e.pointerId),z.current&&H.current==="horizontal"&&z.current.setPointerCapture(_e.pointerId))}),X=Oe(_e=>{if(!j.current)return;const ve=_e.clientY-Y.current,he=_e.clientX-$.current;if(M.current){const fe=M.current.scrollHeight,De=M.current.clientHeight,Ae=M.current.scrollWidth,Pe=M.current.clientWidth;if(U.current&&L.current&&H.current==="vertical"){const Se=ts(L.current,"padding","y"),be=ts(U.current,"margin","y"),ae=U.current.offsetHeight,xe=L.current.offsetHeight-ae-Se-be,Re=ve/xe;M.current.scrollTop=V.current+Re*(fe-De),_e.preventDefault(),g(!0),P.start(Zf,()=>{g(!1)})}if(z.current&&D.current&&H.current==="horizontal"){const Se=ts(D.current,"padding","x"),be=ts(z.current,"margin","x"),ae=z.current.offsetWidth,xe=D.current.offsetWidth-ae-Se-be,Re=he/xe;M.current.scrollLeft=q.current+Re*(Ae-Pe),_e.preventDefault(),p(!0),B.start(Zf,()=>{p(!1)})}}}),F=Oe(_e=>{j.current=!1,U.current&&H.current==="vertical"&&U.current.releasePointerCapture(_e.pointerId),z.current&&H.current==="horizontal"&&z.current.releasePointerCapture(_e.pointerId)});function se(_e){const ve=_e.pointerType==="touch";if(v(ve),!ve){const he=dt(A.current,_e.target);c(he)}}const re=k.useMemo(()=>({hasOverflowX:!G.scrollbarXHidden,hasOverflowY:!G.scrollbarYHidden,overflowXStart:S.xStart,overflowXEnd:S.xEnd,overflowYStart:S.yStart,overflowYEnd:S.yEnd,cornerHidden:G.cornerHidden}),[G.scrollbarXHidden,G.scrollbarYHidden,G.cornerHidden,S]),ne={role:"presentation",onPointerEnter:se,onPointerMove:se,onPointerDown({pointerType:_e}){v(_e==="touch")},onPointerLeave(){c(!1)},style:{position:"relative",[Fh.scrollAreaCornerHeight]:`${b.height}px`,[Fh.scrollAreaCornerWidth]:`${b.width}px`}},oe=ut("div",t,{state:re,ref:[n,A],props:[ne,h],stateAttributesMapping:O0}),ce=k.useMemo(()=>({handlePointerDown:ee,handlePointerMove:X,handlePointerUp:F,handleScroll:Z,cornerSize:b,setCornerSize:w,thumbSize:C,setThumbSize:_,touchModality:y,cornerRef:W,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:c,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:D,thumbYRef:U,thumbXRef:z,rootId:T,hiddenState:G,setHiddenState:K,overflowEdges:S,setOverflowEdges:E,viewportState:re,overflowEdgeThreshold:J}),[ee,X,F,Z,b,C,y,W,d,p,f,g,a,c,M,A,L,D,U,z,T,G,S,re,J]);return x.jsxs(VR.Provider,{value:ce,children:[Iu.element,oe]})});function R9(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 k9=k.createContext(void 0);function T9(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})({}),_C=!1;function L9(){_C||r0||(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{}}),_C=!0)}const A9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{viewportRef:h,scrollbarYRef:a,scrollbarXRef:c,thumbYRef:d,thumbXRef:p,cornerRef:f,setCornerSize:g,setThumbSize:b,rootId:w,setHiddenState:C,hiddenState:_,handleScroll:y,setHovering:v,setOverflowEdges:S,overflowEdges:E,overflowEdgeThreshold:T}=Tp(),A=Oa(),M=k.useRef(!0),L=Qt(),D=Qt();function U(){const q=h.current,H=a.current,P=c.current,B=d.current,I=p.current,G=f.current;if(!q)return;const K=q.scrollHeight,J=q.scrollWidth,Z=q.clientHeight,ee=q.clientWidth,X=q.scrollTop,F=q.scrollLeft;if(K===0||J===0)return;const se=Z>=K,re=ee>=J,ne=ee/J,oe=Z/K,ce=Math.max(0,J-ee),_e=Math.max(0,K-Z);let ve=0,he=0;re||(A==="rtl"?ve=pi(-F,0,ce):ve=pi(F,0,ce),he=ce-ve);const fe=se?0:pi(X,0,_e),De=se?0:_e-fe,Ae=re?0:ee,Pe=se?0:Z,Se=ts(P,"padding","x"),be=ts(H,"padding","y"),ae=ts(I,"margin","x"),xe=ts(B,"margin","y"),Re=Ae-Se-ae,Ue=Pe-be-xe,nt=P?Math.min(P.offsetWidth,Re):Re,He=H?Math.min(H.offsetHeight,Ue):Ue,st=Math.max(gC,nt*ne),et=Math.max(gC,He*oe);if(b(Xe=>Xe.height===et&&Xe.width===st?Xe:{width:st,height:et}),H&&B){const Xe=H.offsetHeight-et-be-xe,it=K-Z,Ct=it===0?0:X/it,lt=Math.min(Xe,Math.max(0,Ct*Xe));B.style.transform=`translate3d(0,${lt}px,0)`}if(P&&I){const Xe=P.offsetWidth-st-Se-ae,it=J-ee,Ct=it===0?0:F/it,lt=A==="rtl"?pi(Ct*Xe,-Xe,0):pi(Ct*Xe,0,Xe);I.style.transform=`translate3d(${lt}px,0,0)`}const ht=pi(ve,0,ce),qe=pi(he,0,ce),$e=pi(fe,0,_e),ue=pi(De,0,_e),je=[[io.scrollAreaOverflowXStart,ht],[io.scrollAreaOverflowXEnd,qe],[io.scrollAreaOverflowYStart,$e],[io.scrollAreaOverflowYEnd,ue]];for(const[Xe,it]of je)q.style.setProperty(Xe,`${it}px`);if(G){if(re||se)g({width:0,height:0});else if(!re&&!se){const Xe=H?.offsetWidth||0,it=P?.offsetHeight||0;g({width:Xe,height:it})}}C(Xe=>{const it=se||re;return Xe.scrollbarYHidden===se&&Xe.scrollbarXHidden===re&&Xe.cornerHidden===it?Xe:{scrollbarYHidden:se,scrollbarXHidden:re,cornerHidden:it}});const rt={xStart:!re&&ht>T.xStart,xEnd:!re&&qe>T.xEnd,yStart:!se&&$e>T.yStart,yEnd:!se&&ue>T.yEnd};S(Xe=>Xe.xStart===rt.xStart&&Xe.xEnd===rt.xEnd&&Xe.yStart===rt.yStart&&Xe.yEnd===rt.yEnd?Xe:rt)}const z=Oe(()=>{Jn.flushSync(U)});Ne(()=>h.current?(L9(),T9(h.current,z)):void 0,[z,h]),Ne(()=>{queueMicrotask(z)},[z,_,A]),Ne(()=>{h.current?.matches(":hover")&&v(!0)},[h,v]),k.useEffect(()=>{const q=h.current;if(typeof ResizeObserver>"u"||!q)return;const H=new ResizeObserver(z);return H.observe(q),D.start(0,()=>{Promise.all(q.getAnimations({subtree:!0}).map(P=>P.finished)).then(z).catch(()=>{})}),()=>{H.disconnect(),D.clear()}},[z,h,D]);function W(){M.current=!1}const j={role:"presentation",...w&&{"data-id":`${w}-viewport`},...(!_.scrollbarXHidden||!_.scrollbarYHidden)&&{tabIndex:0},className:Iu.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:W,onTouchMove:W,onPointerMove:W,onPointerEnter:W,onKeyDown:W},Y=k.useMemo(()=>({hasOverflowX:!_.scrollbarXHidden,hasOverflowY:!_.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:_.cornerHidden}),[_.scrollbarXHidden,_.scrollbarYHidden,_.cornerHidden,E]),$=ut("div",t,{ref:[n,h],state:Y,props:[j,u],stateAttributesMapping:O0}),V=k.useMemo(()=>({computeThumbPosition:z}),[z]);return x.jsx(k9.Provider,{value:V,children:$})}),FR=k.createContext(void 0);function O9(){const e=k.useContext(FR);if(e===void 0)throw new Error(It(54));return e}let Uh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const M9=k.forwardRef(function(t,n){const{render:s,className:o,orientation:u="vertical",keepMounted:h=!1,...a}=t,{hovering:c,scrollingX:d,scrollingY:p,hiddenState:f,overflowEdges:g,scrollbarYRef:b,scrollbarXRef:w,viewportRef:C,thumbYRef:_,thumbXRef:y,handlePointerDown:v,handlePointerUp:S,rootId:E,thumbSize:T}=Tp(),A=k.useMemo(()=>({hovering:c,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}),[c,d,p,u,f,g]),M=Oa();k.useEffect(()=>{const j=C.current,Y=u==="vertical"?b.current:w.current;if(!Y)return;function $(V){if(!(!j||!Y||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 Y.addEventListener("wheel",$,{passive:!1}),()=>{Y.removeEventListener("wheel",$)}},[u,w,b,C]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(j){if(j.button===0&&j.currentTarget===j.target&&C.current){if(_.current&&b.current&&u==="vertical"){const Y=ts(_.current,"margin","y"),$=ts(b.current,"padding","y"),V=_.current.offsetHeight,q=b.current.getBoundingClientRect(),H=j.clientY-q.top-V/2-$+Y/2,P=C.current.scrollHeight,B=C.current.clientHeight,I=b.current.offsetHeight-V-$-Y,K=H/I*(P-B);C.current.scrollTop=K}if(y.current&&w.current&&u==="horizontal"){const Y=ts(y.current,"margin","x"),$=ts(w.current,"padding","x"),V=y.current.offsetWidth,q=w.current.getBoundingClientRect(),H=j.clientX-q.left-V/2-$+Y/2,P=C.current.scrollWidth,B=C.current.clientWidth,I=w.current.offsetWidth-V-$-Y,G=H/I;let K;M==="rtl"?(K=(1-G)*(P-B),C.current.scrollLeft<=0&&(K=-K)):K=G*(P-B),C.current.scrollLeft=K}v(j)}},onPointerUp:S,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...u==="vertical"&&{top:0,bottom:`var(${Fh.scrollAreaCornerHeight})`,insetInlineEnd:0,[Uh.scrollAreaThumbHeight]:`${T.height}px`},...u==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Fh.scrollAreaCornerWidth})`,bottom:0,[Uh.scrollAreaThumbWidth]:`${T.width}px`}}},D=ut("div",t,{ref:[n,u==="vertical"?b:w],state:A,props:[L,a],stateAttributesMapping:O0}),U=k.useMemo(()=>({orientation:u}),[u]),z=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!z?x.jsx(FR.Provider,{value:U,children:D}):null}),D9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{thumbYRef:h,thumbXRef:a,handlePointerDown:c,handlePointerMove:d,handlePointerUp:p,setScrollingX:f,setScrollingY:g}=Tp(),{orientation:b}=O9(),w=k.useMemo(()=>({orientation:b}),[b]);return ut("div",t,{ref:[n,b==="vertical"?h:a],state:w,props:[{onPointerDown:c,onPointerMove:d,onPointerUp(_){b==="vertical"&&g(!1),b==="horizontal"&&f(!1),p(_)},style:{...b==="vertical"&&{height:`var(${Uh.scrollAreaThumbHeight})`},...b==="horizontal"&&{width:`var(${Uh.scrollAreaThumbWidth})`}}},u]})}),P9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:c}=Tp(),d=ut("div",t,{ref:[n,h],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:a.width,height:a.height}},u]});return c.cornerHidden?null:d}),UR=k.createContext(void 0);function I9(){const e=k.useContext(UR);if(e===void 0)throw new Error(It(63));return e}let yC=(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 WR={...Aa,checked(e){return e?{[yC.checked]:""}:{[yC.unchecked]:""}}},j9=k.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u,id:h,inputRef:a,name:c,nativeButton:d=!1,onCheckedChange:p,readOnly:f=!1,required:g=!1,disabled:b=!1,render:w,uncheckedValue:C,..._}=t,{clearErrors:y}=Zu(),{state:v,setTouched:S,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:D,disabled:U,name:z,validation:W}=is(),{labelId:j}=xo(),Y=U||b,$=z??c,V=Oe(p),q=k.useRef(null),H=ss(q,a,W.inputRef),P=k.useRef(null),B=jr(),I=Sp({id:h,implicit:!1,controlRef:P}),[G,K]=js({controlled:s,default:!!u,name:"Switch",state:"checked"});Ju({id:B,commit:W.commit,value:G,controlRef:P,name:$,getValue:()=>G}),Ne(()=>{q.current&&A(q.current.checked)},[q,A]),ia(G,()=>{y($),E(G!==T.initialValue),A(G),L()?W.commit(G):W.commit(G,!0)});const{getButtonProps:J,buttonRef:Z}=Br({disabled:Y,native:d}),ee={id:B,role:"switch","aria-checked":G,"aria-readonly":f||void 0,"aria-labelledby":j,onFocus(){Y||M(!0)},onBlur(){const re=q.current;!re||Y||(S(!0),M(!1),D==="onBlur"&&W.commit(re.checked))},onClick(re){f||Y||(re.preventDefault(),q?.current?.click())}},X=k.useMemo(()=>zs({checked:G,disabled:Y,id:I,name:$,required:g,style:nc,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:H,onChange(re){if(re.nativeEvent.defaultPrevented)return;const ne=re.target.checked,oe=Fe(Pn,re.nativeEvent);V?.(ne,oe),!oe.isCanceled&&K(ne)},onFocus(){P.current?.focus()}},W.getInputValidationProps),[G,Y,H,I,$,V,g,K,W]),F=k.useMemo(()=>({...v,checked:G,disabled:Y,readOnly:f,required:g}),[v,G,Y,f,g]),se=ut("span",t,{state:F,ref:[n,P,Z],props:[ee,W.getValidationProps,_,J],stateAttributesMapping:WR});return x.jsxs(UR.Provider,{value:F,children:[se,!G&&$&&C!==void 0&&x.jsx("input",{type:"hidden",name:$,value:C}),x.jsx("input",{...X})]})}),N9=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=is(),a=I9(),c={...h,...a};return ut("span",t,{state:c,ref:n,stateAttributesMapping:WR,props:u})});function B9(e){return ut(e.defaultTagName??"div",e,e)}function z9({className:e,...t}){return x.jsx("div",{"data-slot":"input-group",role:"group",className:Be("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const H9=Xl("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 V9({className:e,align:t="inline-start",...n}){return x.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Be(H9({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const F9=Xl("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 x.jsx(ze,{type:t,"data-size":s,variant:n,className:Be(F9({size:s}),e),...o})}function U9({className:e,...t}){return x.jsx(qt,{"data-slot":"input-group-control",className:Be("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const W9=XP;function q9({className:e,children:t,...n}){return x.jsxs(RP,{"data-slot":"combobox-trigger",className:Be("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,x.jsx(Ce,{icon:O2,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function G9({className:e,...t}){return x.jsx(MP,{"data-slot":"combobox-clear",render:x.jsx(qR,{variant:"ghost",size:"icon-xs"}),className:Be(e),...t,children:x.jsx(Ce,{icon:go,strokeWidth:2,className:"pointer-events-none"})})}function $9({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return x.jsxs(z9,{className:Be("w-auto",e),children:[x.jsx(AP,{render:x.jsx(U9,{disabled:n}),...u}),x.jsxs(V9,{align:"inline-end",children:[s&&x.jsx(qR,{size:"icon-xs",variant:"ghost",render:x.jsx(q9,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&x.jsx(G9,{disabled:n})]}),t]})}function K9({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return x.jsx(BP,{children:x.jsx(zP,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:x.jsx(VP,{"data-slot":"combobox-content","data-chips":!!u,className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...h})})})}function Y9({className:e,...t}){return x.jsx(jP,{"data-slot":"combobox-list",className:Be("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function X9({className:e,children:t,...n}){return x.jsxs(WP,{"data-slot":"combobox-item",className:Be("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,x.jsx(QP,{render:x.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:x.jsx(Ce,{icon:ka,strokeWidth:2,className:"pointer-events-none"})})]})}function Q9({className:e,...t}){return x.jsx(qP,{"data-slot":"combobox-empty",className:Be("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}function to({className:e,size:t="default",...n}){return x.jsx(j9,{"data-slot":"switch","data-size":t,className:Be("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:x.jsx(N9,{"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"})})}const Pa="";async function Ia(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function M0(){return $n({queryKey:["tasks"],queryFn:()=>Ia(`${Pa}/api/tasks`)})}function GR(e){return $n({queryKey:["tasks",e],queryFn:()=>Ia(`${Pa}/api/tasks/${e}`),enabled:!!e})}function Z9(){const e=Gn();return Nn({mutationFn:t=>Ia(`${Pa}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function J9(){const e=Gn();return Nn({mutationFn:({taskId:t,status:n,position:s})=>Ia(`${Pa}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function D0(){const e=Gn();return Nn({mutationFn:({taskId:t,updates:n})=>Ia(`${Pa}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function eI(){const e=Gn();return Nn({mutationFn:t=>Ia(`${Pa}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function tI(){const e=Gn();return Nn({mutationFn:t=>Ia(`${Pa}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const sc="";async function ic(e){const t=await fetch(e);if(!t.ok){const n=await t.json().catch(()=>({error:"Request failed"}));throw new Error(n.error||"Request failed")}return t.json()}function nI(e){return $n({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return ic(`${sc}/api/fs/list${t}`)},enabled:e!==null})}function rI(e){return $n({queryKey:["git","branches",e],queryFn:()=>ic(`${sc}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function sI(e,t={}){const{staged:n=!1,ignoreWhitespace:s=!1,includeUntracked:o=!1}=t;return $n({queryKey:["git","diff",e,n,s,o],queryFn:()=>{const u=new URLSearchParams({path:e,...n&&{staged:"true"},...s&&{ignoreWhitespace:"true"},...o&&{includeUntracked:"true"}});return ic(`${sc}/api/git/diff?${u}`)},enabled:!!e,refetchInterval:5e3})}function iI(e){return $n({queryKey:["fs","tree",e],queryFn:()=>ic(`${sc}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function oI(e,t,n){return $n({queryKey:["fs","read",e,t,n?.maxLines],queryFn:()=>{const s=new URLSearchParams({path:t,root:e,...n?.maxLines});return ic(`${sc}/api/fs/read?${s}`)},enabled:!!e&&!!t})}async function aI(e){return ic(`${sc}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const oc="";async function ac(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}const an={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"},lI=3333,cI="claude --dangerously-skip-permissions";function Co(e){return $n({queryKey:["config",e],queryFn:()=>ac(`${oc}/api/config/${e}`)})}function uI(){const e=Co(an.PORT);return{...e,data:e.data?.value??lI,isDefault:e.data?.isDefault??!0}}function P0(){const e=Co(an.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??"",isDefault:!0}}function I0(){const e=Co(an.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function $R(){const e=Co(an.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??cI,isDefault:e.data?.isDefault??!0}}function KR(){const e=Co(an.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function YR(){const e=Co(an.SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function dI(){const e=Co(an.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function fI(){const e=Co(an.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function hI(){const e=Gn();return Nn({mutationFn:({key:t,value:n})=>ac(`${oc}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]})}})}function pI(){const e=Gn();return Nn({mutationFn:t=>ac(`${oc}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function mI(){return $n({queryKey:["config","notifications"],queryFn:()=>ac(`${oc}/api/config/notifications`)})}function gI(){const e=Gn();return Nn({mutationFn:t=>ac(`${oc}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function vI(){return Nn({mutationFn:e=>ac(`${oc}/api/config/notifications/test/${e}`,{method:"POST"})})}const nd="";async function rd(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function j0(){return $n({queryKey:["repositories"],queryFn:()=>rd(`${nd}/api/repositories`)})}function _I(e){return $n({queryKey:["repositories",e],queryFn:()=>rd(`${nd}/api/repositories/${e}`),enabled:!!e})}function XR(){const e=Gn();return Nn({mutationFn:t=>rd(`${nd}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function yI(){const e=Gn();return Nn({mutationFn:({id:t,updates:n})=>rd(`${nd}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function QR(){const e=Gn();return Nn({mutationFn:t=>rd(`${nd}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function sd({className:e,children:t,...n}){return x.jsxs(E9,{"data-slot":"scroll-area",className:Be("relative",e),...n,children:[x.jsx(A9,{"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}),x.jsx(bI,{}),x.jsx(P9,{})]})}function bI({className:e,orientation:t="vertical",...n}){return x.jsx(M9,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Be("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:x.jsx(D9,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function N0({open:e,onOpenChange:t,onSelect:n,initialPath:s}){const[o,u]=k.useState(s||null),[h,a]=k.useState(""),[c,d]=k.useState("");k.useEffect(()=>{e&&(u(s||null),a(""),d(""))},[e,s]);const{data:p,isLoading:f,error:g}=nI(e?o??"":null),b=S=>{p&&(u(p.path+"/"+S),d(""))},w=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},C=()=>{u(null),d("")},_=()=>{h.trim()&&(u(h.trim()),d(""))},y=S=>{n(S),t(!1)},v=p?.entries.filter(S=>S.name.toLowerCase().includes(c.toLowerCase()));return x.jsx(Ms,{open:e,onOpenChange:t,children:x.jsxs(Ds,{className:"sm:max-w-lg",children:[x.jsxs(vi,{children:[x.jsx(_i,{children:"Select Git Repository"}),x.jsx(ra,{children:"Choose an existing git repository"})]}),x.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),x.jsx(w8,{}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx(qt,{value:h,onChange:S=>a(S.target.value),placeholder:"/path/to/your/project",onKeyDown:S=>S.key==="Enter"&&_(),className:"flex-1"}),x.jsx(ze,{variant:"outline",size:"sm",onClick:_,children:"Go"})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),x.jsxs("div",{className:"relative",children:[x.jsx(Ce,{icon:t4,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),x.jsx(qt,{value:c,onChange:S=>d(S.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(ze,{variant:"outline",size:"icon-sm",onClick:C,title:"Home",children:x.jsx(Ce,{icon:$M,size:14,strokeWidth:2})}),x.jsx(ze,{variant:"outline",size:"icon-sm",onClick:w,disabled:!p||p.parent===p.path,title:"Parent directory",children:x.jsx(Ce,{icon:I2,size:14,strokeWidth:2})}),x.jsx("code",{className:"flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate",children:p?.path||"~"}),x.jsx(ze,{variant:"outline",size:"sm",onClick:()=>p&&y(p.path),disabled:!p,children:"Select Current"})]}),x.jsx(sd,{className:"h-64 border rounded-md",children:x.jsxs("div",{className:"p-1",children:[f&&x.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),g&&x.jsx("div",{className:"text-destructive text-xs p-3",children:g.message}),p&&v&&x.jsxs(x.Fragment,{children:[v.length===0&&x.jsx("div",{className:"text-muted-foreground text-xs p-3",children:c?"No matches found":"Empty directory"}),v.map(S=>x.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:S.type==="directory"?x.jsxs(x.Fragment,{children:[x.jsx(Ce,{icon:S.isGitRepo?z2:_s,size:16,strokeWidth:2,className:S.isGitRepo?"text-emerald-500":"text-blue-500"}),x.jsx("button",{onClick:()=>b(S.name),className:"flex-1 text-left text-xs truncate hover:underline",children:S.name}),S.isGitRepo&&x.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"})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"w-4"}),x.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate",children:S.name})]})},S.name))]})]})}),x.jsxs(pa,{children:[x.jsx(y0,{render:x.jsx(ze,{variant:"outline"}),children:"Cancel"}),x.jsx(ze,{onClick:()=>p&&y(p.path),disabled:!p,children:"Select Path"})]})]})})}function SI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function xI(e){const t=SI(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function CI({open:e,onOpenChange:t}={}){const[n,s]=k.useState(!1),o=e??n,u=t??s,[h,a]=k.useState(!1),[c,d]=k.useState(""),[p,f]=k.useState(""),[g,b]=k.useState(""),[w,C]=k.useState(""),[_,y]=k.useState(""),[v,S]=k.useState(""),[E,T]=k.useState(!0),[A,M]=k.useState(!0),[L,D]=k.useState(null),[U,z]=k.useState("browse"),[W,j]=k.useState(""),[Y,$]=k.useState(null),[V,q]=k.useState(!1),H=vo(),P=Z9(),B=XR(),{data:I}=P0(),{data:G}=I0(),{data:K}=j0(),{data:J,isLoading:Z}=rI(g||null),ee=L?K?.find(ce=>ce.id===L):null,X=k.useMemo(()=>{if(!K)return[];if(!W.trim())return K;const ce=W.toLowerCase();return K.filter(_e=>_e.displayName.toLowerCase().includes(ce)||_e.path.toLowerCase().includes(ce))},[K,W]);k.useEffect(()=>{K&&K.length>0?z("saved"):z("browse")},[K]),k.useEffect(()=>{C(J?J.current||J.branches[0]||"main":"")},[J,g]);const F=ce=>{d(ce),S(xI(ce))},se=async ce=>{$(null),q(!0);try{if(!(await aI(ce)).isGitRepo){$("Selected folder is not a git repository"),q(!1);return}if(b(ce),D(null),!K?.find(he=>he.path===ce)){const he=ce.split("/").pop()||"Unknown";B.mutate({path:ce,displayName:he})}}catch(_e){$(_e instanceof Error?_e.message:"Failed to validate repository")}finally{q(!1)}},re=ce=>{if(ce.preventDefault(),!c.trim()||!g)return;const _e=g.split("/").pop()||"repo",ve=_.trim()||v,he=`${I}/${ve}`;P.mutate({title:c.trim(),description:p.trim(),repoPath:g,repoName:_e,baseBranch:w||"main",branch:ve,worktreePath:he,initializeVibora:E,copyFiles:ee?.copyFiles||void 0,startupScript:ee?.startupScript||void 0},{onSuccess:fe=>{const De=A&&p.trim()?{planMode:!0,description:p.trim()}:void 0;u(!1),d(""),f(""),b(""),C(""),y(""),S(""),T(!0),M(!0),D(null),j(""),$(null),z(K&&K.length>0?"saved":"browse"),H({to:"/tasks/$taskId",params:{taskId:fe.id},state:De})}})},ne=_.trim()||v,oe=ne?`${I}/${ne}`:"";return x.jsxs(x.Fragment,{children:[x.jsxs(Ms,{open:o,onOpenChange:u,children:[x.jsxs(eR,{render:x.jsx(ze,{size:"sm"}),children:[x.jsx(Ce,{icon:ec,size:16,strokeWidth:2,"data-slot":"icon"}),"New Task"]}),x.jsx(Ds,{className:"sm:max-w-md",children:x.jsxs("form",{onSubmit:re,children:[x.jsxs(vi,{children:[x.jsx(_i,{children:"Create New Task"}),x.jsx(ra,{children:"Create a new task with a git worktree for isolated development."})]}),x.jsxs(Cp,{className:"mt-4",children:[x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"title",children:"Title"}),x.jsx(qt,{id:"title",value:c,onChange:ce=>F(ce.target.value),placeholder:"Add user authentication",required:!0})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"description",children:"Description"}),x.jsx(xp,{id:"description",value:p,onChange:ce=>f(ce.target.value),placeholder:"Implement OAuth2 login flow...",rows:2})]}),x.jsxs(In,{className:"flex flex-row items-center justify-between",children:[x.jsxs("div",{children:[x.jsx(jn,{htmlFor:"planMode",className:"mb-0 cursor-pointer",children:"Start in Plan Mode"}),x.jsx(gi,{children:"Launch Claude with the task title and description"})]}),x.jsx(to,{id:"planMode",checked:A,onCheckedChange:ce=>M(ce)})]}),x.jsxs(In,{children:[x.jsx(jn,{children:"Repository"}),x.jsxs(wp,{value:U,onValueChange:ce=>{z(ce),$(null)},children:[x.jsxs(Ep,{children:[x.jsx(po,{value:"saved",disabled:!K?.length,children:"Saved"}),x.jsx(po,{value:"browse",children:"Browse"})]}),x.jsx(ma,{value:"saved",className:"mt-2",children:x.jsxs(W9,{value:L||"",onValueChange:ce=>{const _e=K?.find(ve=>ve.id===ce);_e&&(D(ce),b(_e.path),j(_e.displayName),$(null))},inputValue:W,onInputValueChange:ce=>{j(ce),ee&&ce!==ee.displayName&&D(null)},itemToStringLabel:ce=>K?.find(_e=>_e.id===ce)?.displayName||"",children:[x.jsx($9,{placeholder:"Search repositories...",className:"w-full"}),x.jsx(K9,{children:x.jsxs(Y9,{children:[x.jsx(Q9,{children:"No repositories found"}),X.map(ce=>x.jsx(X9,{value:ce.id,children:ce.displayName},ce.id))]})})]})}),x.jsx(ma,{value:"browse",className:"mt-2",children:x.jsxs(ze,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:V,children:[x.jsx(Ce,{icon:_s,size:14,strokeWidth:2,className:"mr-2"}),V?x.jsx("span",{className:"text-muted-foreground",children:"Validating..."}):g&&!L?x.jsx("span",{className:"truncate",children:g}):x.jsx("span",{className:"text-muted-foreground",children:"Select folder..."})]})})]}),Y&&x.jsx("p",{className:"text-sm text-destructive",children:Y}),g&&!Y&&x.jsx(gi,{className:"font-mono text-xs truncate",children:g})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"baseBranch",children:"Base Branch"}),x.jsxs(Ml,{value:w,onValueChange:ce=>C(ce??""),disabled:!g||Z,children:[x.jsx(Pl,{className:"w-full",children:x.jsx(Dl,{children:w||x.jsx("span",{className:"text-muted-foreground",children:g?Z?"Loading branches...":"Select branch":"Select repository first"})})}),x.jsx(Il,{children:J?.branches.map(ce=>x.jsxs(hr,{value:ce,children:[ce,ce===J.current&&x.jsx("span",{className:"text-muted-foreground ml-2",children:"(current)"})]},ce))})]})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"branch",children:"Branch Name"}),x.jsx(qt,{id:"branch",value:_,onChange:ce=>y(ce.target.value),placeholder:v||"auto-generated-from-title"}),oe&&x.jsxs(gi,{children:["Worktree: ",oe]}),!_.trim()&&v&&x.jsxs(gi,{children:['Will use "',v,'" if left empty.']})]}),x.jsxs(In,{className:"flex flex-row items-center justify-between",children:[x.jsxs("div",{children:[x.jsx(jn,{htmlFor:"initializeVibora",className:"mb-0 cursor-pointer",children:"Initialize Vibora"}),x.jsx(gi,{children:"Create or update CLAUDE.local.md with CLI instructions"})]}),x.jsx(to,{id:"initializeVibora",checked:E,onCheckedChange:ce=>T(ce)})]})]}),x.jsxs(pa,{className:"mt-4",children:[x.jsx(y0,{render:x.jsx(ze,{variant:"outline",type:"button"}),children:"Cancel"}),x.jsx(ze,{type:"submit",disabled:P.isPending||!c.trim()||!g,children:P.isPending?"Creating...":"Create Task"})]})]})})]}),x.jsx(N0,{open:h,onOpenChange:a,onSelect:se,initialPath:G||void 0})]})}function wI({onNewTaskRef:e}){const{location:t}=Zn(),n=t.pathname,[s,o]=k.useState(!1);return k.useEffect(()=>{e?.(()=>o(!0))},[e]),x.jsxs("header",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between border-b border-border bg-black px-4",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx(Wn,{to:"/tasks",className:"flex items-center",children:x.jsx("img",{src:"/vibora-logo.jpeg",alt:"Vibora",className:"h-7"})}),x.jsxs("nav",{className:"flex items-center gap-1",children:[x.jsx(Wn,{to:"/tasks",children:x.jsxs(ze,{variant:n.startsWith("/tasks")?"secondary":"ghost",size:"sm",children:[x.jsx(Ce,{icon:Lh,size:16,strokeWidth:2,"data-slot":"icon"}),"Tasks"]})}),x.jsx(Wn,{to:"/terminals",children:x.jsxs(ze,{variant:n==="/terminals"?"secondary":"ghost",size:"sm",children:[x.jsx(Ce,{icon:X_,size:16,strokeWidth:2,"data-slot":"icon"}),"Terminals"]})}),x.jsx(Wn,{to:"/worktrees",children:x.jsxs(ze,{variant:n.startsWith("/worktrees")?"secondary":"ghost",size:"sm",children:[x.jsx(Ce,{icon:H2,size:16,strokeWidth:2,"data-slot":"icon"}),"Worktrees"]})}),x.jsx(Wn,{to:"/repositories",children:x.jsxs(ze,{variant:n.startsWith("/repositories")?"secondary":"ghost",size:"sm",children:[x.jsx(Ce,{icon:N2,size:16,strokeWidth:2,"data-slot":"icon"}),"Repositories"]})}),x.jsx(Wn,{to:"/review",children:x.jsxs(ze,{variant:n.startsWith("/review")?"secondary":"ghost",size:"sm",children:[x.jsx(Ce,{icon:Q_,size:16,strokeWidth:2,"data-slot":"icon"}),"Review"]})})]})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(CI,{open:s,onOpenChange:o}),x.jsx(Wn,{to:"/settings",children:x.jsx(ze,{variant:n==="/settings"?"secondary":"ghost",size:"icon-sm",children:x.jsx(Ce,{icon:F2,size:16,strokeWidth:2})})})]})]})}function EI(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 RI=e=>{switch(e){case"success":return LI;case"info":return OI;case"warning":return AI;case"error":return MI;default:return null}},kI=Array(12).fill(0),TI=({visible:e,className:t})=>Ie.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ie.createElement("div",{className:"sonner-spinner"},kI.map((n,s)=>Ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),LI=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.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"})),AI=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ie.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"})),OI=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.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"})),MI=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.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"})),DI=Ie.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"},Ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),PI=()=>{const[e,t]=Ie.useState(document.hidden);return Ie.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let u_=1;class II{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:u_++,h=this.toasts.find(c=>c.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(c=>c.id===u?(this.publish({...c,...t,id:u,title:s}),{...c,...t,id:u,dismissible:a,title:s}):c):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],Ie.isValidElement(d))u=!1,this.create({id:s,type:"default",message:d});else if(NI(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,w=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...w})}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,w=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...w})}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,w=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"success",description:g,...w})}}).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,b=typeof p=="object"&&!Ie.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:f,...b})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>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:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=n?.id||u_++;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 pr=new II,jI=(e,t)=>{const n=t?.id||u_++;return pr.addToast({title:e,...t,id:n}),n},NI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",BI=jI,zI=()=>pr.toasts,HI=()=>pr.getActiveToasts(),Mr=Object.assign(BI,{success:pr.success,info:pr.info,warning:pr.warning,error:pr.error,custom:pr.custom,message:pr.message,promise:pr.promise,dismiss:pr.dismiss,loading:pr.loading},{getHistory:zI,getToasts:HI});EI("[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 Jf(e){return e.label!==void 0}const VI=3,FI="24px",UI="16px",bC=4e3,WI=356,qI=14,GI=45,$I=200;function Rs(...e){return e.filter(Boolean).join(" ")}function KI(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const YI=e=>{var t,n,s,o,u,h,a,c,d;const{invert:p,toast:f,unstyled:g,interacting:b,setHeights:w,visibleToasts:C,heights:_,index:y,toasts:v,expanded:S,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:D,className:U="",descriptionClassName:z="",duration:W,position:j,gap:Y,expandByDefault:$,classNames:V,icons:q,closeButtonAriaLabel:H="Close toast"}=e,[P,B]=Ie.useState(null),[I,G]=Ie.useState(null),[K,J]=Ie.useState(!1),[Z,ee]=Ie.useState(!1),[X,F]=Ie.useState(!1),[se,re]=Ie.useState(!1),[ne,oe]=Ie.useState(!1),[ce,_e]=Ie.useState(0),[ve,he]=Ie.useState(0),fe=Ie.useRef(f.duration||W||bC),De=Ie.useRef(null),Ae=Ie.useRef(null),Pe=y===0,Se=y+1<=C,be=f.type,ae=f.dismissible!==!1,xe=f.className||"",Re=f.descriptionClassName||"",Ue=Ie.useMemo(()=>_.findIndex(Je=>Je.toastId===f.id)||0,[_,f.id]),nt=Ie.useMemo(()=>{var Je;return(Je=f.closeButton)!=null?Je:A},[f.closeButton,A]),He=Ie.useMemo(()=>f.duration||W||bC,[f.duration,W]),st=Ie.useRef(0),et=Ie.useRef(0),ht=Ie.useRef(0),qe=Ie.useRef(null),[$e,ue]=j.split("-"),je=Ie.useMemo(()=>_.reduce((Je,Ot,jt)=>jt>=Ue?Je:Je+Ot.height,0),[_,Ue]),rt=PI(),Xe=f.invert||p,it=be==="loading";et.current=Ie.useMemo(()=>Ue*Y+je,[Ue,je]),Ie.useEffect(()=>{fe.current=He},[He]),Ie.useEffect(()=>{J(!0)},[]),Ie.useEffect(()=>{const Je=Ae.current;if(Je){const Ot=Je.getBoundingClientRect().height;return he(Ot),w(jt=>[{toastId:f.id,height:Ot,position:f.position},...jt]),()=>w(jt=>jt.filter(at=>at.toastId!==f.id))}},[w,f.id]),Ie.useLayoutEffect(()=>{if(!K)return;const Je=Ae.current,Ot=Je.style.height;Je.style.height="auto";const jt=Je.getBoundingClientRect().height;Je.style.height=Ot,he(jt),w(at=>at.find(bt=>bt.toastId===f.id)?at.map(bt=>bt.toastId===f.id?{...bt,height:jt}:bt):[{toastId:f.id,height:jt,position:f.position},...at])},[K,f.title,f.description,w,f.id,f.jsx,f.action,f.cancel]);const Ct=Ie.useCallback(()=>{ee(!0),_e(et.current),w(Je=>Je.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},$I)},[f,E,w,et]);Ie.useEffect(()=>{if(f.promise&&be==="loading"||f.duration===1/0||f.type==="loading")return;let Je;return S||b||rt?(()=>{if(ht.current<st.current){const at=new Date().getTime()-st.current;fe.current=fe.current-at}ht.current=new Date().getTime()})():fe.current!==1/0&&(st.current=new Date().getTime(),Je=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},fe.current)),()=>clearTimeout(Je)},[S,b,f,be,rt,Ct]),Ie.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function lt(){var Je;if(q?.loading){var Ot;return Ie.createElement("div",{className:Rs(V?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":be==="loading"},q.loading)}return Ie.createElement(TI,{className:Rs(V?.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader),visible:be==="loading"})}const tn=f.icon||q?.[be]||RI(be);var kt,vt;return Ie.createElement("li",{tabIndex:0,ref:Ae,className:Rs(U,xe,V?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,V?.default,V?.[be],f==null||(n=f.classNames)==null?void 0:n[be]),"data-sonner-toast":"","data-rich-colors":(kt=f.richColors)!=null?kt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":K,"data-promise":!!f.promise,"data-swiped":ne,"data-removed":Z,"data-visible":Se,"data-y-position":$e,"data-x-position":ue,"data-index":y,"data-front":Pe,"data-swiping":X,"data-dismissible":ae,"data-type":be,"data-invert":Xe,"data-swipe-out":se,"data-swipe-direction":I,"data-expanded":!!(S||$&&K),"data-testid":f.testId,style:{"--index":y,"--toasts-before":y,"--z-index":v.length-y,"--offset":`${Z?ce:et.current}px`,"--initial-height":$?"auto":`${ve}px`,...M,...f.style},onDragEnd:()=>{F(!1),B(null),qe.current=null},onPointerDown:Je=>{Je.button!==2&&(it||!ae||(De.current=new Date,_e(et.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(F(!0),qe.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,Ot,jt;if(se||!ae)return;qe.current=null;const at=Number(((Je=Ae.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=Ae.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((jt=De.current)==null?void 0:jt.getTime()),St=P==="x"?at:wt,Qe=Math.abs(St)/bt;if(Math.abs(St)>=GI||Qe>.11){_e(et.current),f.onDismiss==null||f.onDismiss.call(f,f),G(P==="x"?at>0?"right":"left":wt>0?"down":"up"),Ct(),re(!0);return}else{var Ht,wn;(Ht=Ae.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(wn=Ae.current)==null||wn.style.setProperty("--swipe-amount-y","0px")}oe(!1),F(!1),B(null)},onPointerMove:Je=>{var Ot,jt,at;if(!qe.current||!ae||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Je.clientY-qe.current.y,St=Je.clientX-qe.current.x;var Qe;const Ht=(Qe=e.swipeDirections)!=null?Qe:KI(j);!P&&(Math.abs(St)>1||Math.abs(bt)>1)&&B(Math.abs(St)>Math.abs(bt)?"x":"y");let wn={x:0,y:0};const Kn=Bn=>1/(1.5+Math.abs(Bn)/20);if(P==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&bt<0||Ht.includes("bottom")&&bt>0)wn.y=bt;else{const Bn=bt*Kn(bt);wn.y=Math.abs(Bn)<Math.abs(bt)?Bn:bt}}else if(P==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&St<0||Ht.includes("right")&&St>0)wn.x=St;else{const Bn=St*Kn(St);wn.x=Math.abs(Bn)<Math.abs(St)?Bn:St}(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&oe(!0),(jt=Ae.current)==null||jt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(at=Ae.current)==null||at.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},nt&&!f.jsx&&be!=="loading"?Ie.createElement("button",{"aria-label":H,"data-disabled":it,"data-close-button":!0,onClick:it||!ae?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Rs(V?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=q?.close)!=null?vt:DI):null,(be||f.icon||f.promise)&&f.icon!==null&&(q?.[be]!==null||f.icon)?Ie.createElement("div",{"data-icon":"",className:Rs(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"?tn:null):null,Ie.createElement("div",{"data-content":"",className:Rs(V?.content,f==null||(u=f.classNames)==null?void 0:u.content)},Ie.createElement("div",{"data-title":"",className:Rs(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?Ie.createElement("div",{"data-description":"",className:Rs(z,Re,V?.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),Ie.isValidElement(f.cancel)?f.cancel:f.cancel&&Jf(f.cancel)?Ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Je=>{Jf(f.cancel)&&ae&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Je),Ct())},className:Rs(V?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Ie.isValidElement(f.action)?f.action:f.action&&Jf(f.action)?Ie.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:Je=>{Jf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Je),!Je.defaultPrevented&&Ct())},className:Rs(V?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function SC(){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 XI(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?UI:FI;function c(d){["top","right","bottom","left"].forEach(p=>{n[`${h}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?c(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]}):c(a)}),n}const QI=Ie.forwardRef(function(t,n){const{id:s,invert:o,position:u="bottom-right",hotkey:h=["altKey","KeyT"],expand:a,closeButton:c,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:b,duration:w,style:C,visibleToasts:_=VI,toastOptions:y,dir:v=SC(),gap:S=qI,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=Ie.useState([]),L=Ie.useMemo(()=>s?A.filter(K=>K.toasterId===s):A.filter(K=>!K.toasterId),[A,s]),D=Ie.useMemo(()=>Array.from(new Set([u].concat(L.filter(K=>K.position).map(K=>K.position)))),[L,u]),[U,z]=Ie.useState([]),[W,j]=Ie.useState(!1),[Y,$]=Ie.useState(!1),[V,q]=Ie.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Ie.useRef(null),P=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=Ie.useRef(null),I=Ie.useRef(!1),G=Ie.useCallback(K=>{M(J=>{var Z;return(Z=J.find(ee=>ee.id===K.id))!=null&&Z.delete||pr.dismiss(K.id),J.filter(({id:ee})=>ee!==K.id)})},[]);return Ie.useEffect(()=>pr.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{M(J=>J.map(Z=>Z.id===K.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{s3.flushSync(()=>{M(J=>{const Z=J.findIndex(ee=>ee.id===K.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...K},...J.slice(Z+1)]:[K,...J]})})})}),[A]),Ie.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:J})=>{q(J?"dark":"light")})}catch{K.addListener(({matches:Z})=>{try{q(Z?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),Ie.useEffect(()=>{A.length<=1&&j(!1)},[A]),Ie.useEffect(()=>{const K=J=>{var Z;if(h.every(F=>J[F]||J.code===F)){var X;j(!0),(X=H.current)==null||X.focus()}J.code==="Escape"&&(document.activeElement===H.current||(Z=H.current)!=null&&Z.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[h]),Ie.useEffect(()=>{if(H.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,I.current=!1)}},[H.current]),Ie.createElement("section",{ref:n,"aria-label":`${T} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((K,J)=>{var Z;const[ee,X]=K.split("-");return L.length?Ie.createElement("ol",{key:K,dir:v==="auto"?SC():v,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":ee,"data-x-position":X,style:{"--front-toast-height":`${((Z=U[0])==null?void 0:Z.height)||0}px`,"--width":`${WI}px`,"--gap":`${S}px`,...C,...XI(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:()=>{Y||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===K).map((F,se)=>{var re,ne;return Ie.createElement(YI,{key:F.id,icons:E,index:se,toast:F,defaultRichColors:b,duration:(re=y?.duration)!=null?re:w,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:o,visibleToasts:_,closeButton:(ne=y?.closeButton)!=null?ne:c,interacting:Y,position:K,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:G,toasts:L.filter(oe=>oe.position==F.position),heights:U.filter(oe=>oe.position==F.position),setHeights:z,expandByDefault:a,gap:S,expanded:W,swipeDirections:t.swipeDirections})})):null}))});function ZI(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const JI=10,ej=2e3;function tj(){const e=Gn(),t=k.useRef(null),n=k.useRef(void 0),s=k.useRef(0),o=k.useRef(void 0),u=k.useCallback(a=>{try{const c=JSON.parse(a.data);if(c.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(c.type==="notification"&&"payload"in c){const{title:d,message:p,notificationType:f}=c.payload;switch(f){case"success":Mr.success(d,{description:p});break;case"error":Mr.error(d,{description:p});break;case"warning":Mr.warning(d,{description:p});break;default:Mr.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 c=ZI(),d=new WebSocket(c);t.current=d,d.onopen=()=>{s.current=0},d.onmessage=u,d.onclose=()=>{t.current===d&&(t.current=null),s.current<JI&&(s.current++,n.current=setTimeout(()=>{o.current?.()},ej))},d.onerror=()=>{}},[u]);o.current=h,k.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const ZR=k.createContext(null);function nj({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]),c=k.useMemo(()=>({terminalFocused:t,setTerminalFocused:u,modalOpen:s,setModalOpen:h,shortcutsEnabled:a}),[t,u,s,h,a]);return x.jsx(ZR.Provider,{value:c,children:e})}function B0(){const e=k.useContext(ZR);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function rj(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function JR(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 sj(e,t){const n=JR(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 ek(e){const t=JR(e),n=[],s=rj();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 ij(e){if(!e||!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return!!(t==="input"||t==="textarea"||e.isContentEditable)}function mi(e,t,n={}){const{shortcutsEnabled:s}=B0(),{ignoreContext:o=!1,allowInInput:u=!1,deps:h=[],enabled:a=!0}=n,c=k.useRef(t);c.current=t;const d=Array.isArray(e)?e:[e],p=k.useCallback(f=>{!o&&!s||!a||!u&&ij(f.target)&&!d.some(w=>w.toLowerCase()==="escape")||!d.some(b=>sj(f,b))||(f.preventDefault(),f.stopPropagation(),c.current(f))},[s,o,u,a,...d,...h]);k.useEffect(()=>(document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}),[p])}function xC(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 oj(e,t){return t.trim()?e.map(s=>{let o=xC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=xC(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 aj(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 lj={navigation:"Navigation",actions:"Actions"},cj={activeTabId:null,focusedTerminals:{}};function tk(){const e=Gn(),t=k.useRef(void 0),n=k.useRef({}),{data:s=cj,isLoading:o}=$n({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=Nn({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,b={activeTabId:g.activeTabId!==void 0?g.activeTabId:s.activeTabId,focusedTerminals:{...s.focusedTerminals,...g.focusedTerminals}};e.setQueryData(["terminal-view-state"],b),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]),c=k.useCallback((p,f)=>{if(f===null){const{[p]:g,...b}=s.focusedTerminals;h({focusedTerminals:b})}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:c}}function uj({onNewTask:e,onShowShortcuts:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(""),[h,a]=k.useState(0),c=k.useRef(null),d=k.useRef(null),p=vo(),{setActiveTab:f}=tk(),g=k.useMemo(()=>[{id:"goto-tasks",label:"Go to Tasks",shortcut:"meta+1",keywords:["kanban","board","home"],category:"navigation",icon:x.jsx(Ce,{icon:Lh,size:16,strokeWidth:2}),action:()=>{p({to:"/tasks"}),s(!1)}},{id:"goto-terminals",label:"Go to Terminals",shortcut:"meta+2",keywords:["shell","console","cli"],category:"navigation",icon:x.jsx(Ce,{icon:X_,size:16,strokeWidth:2}),action:()=>{p({to:"/terminals"}),s(!1)}},{id:"goto-task-terminals",label:"Go to Task Terminals",shortcut:"shift+meta+t",keywords:["tasks","shell","console","cli"],category:"navigation",icon:x.jsx(Ce,{icon:Lh,size:16,strokeWidth:2}),action:()=>{f("all-tasks"),p({to:"/terminals"}),s(!1)}},{id:"goto-worktrees",label:"Go to Worktrees",shortcut:"meta+3",keywords:["git","branches"],category:"navigation",icon:x.jsx(Ce,{icon:H2,size:16,strokeWidth:2}),action:()=>{p({to:"/worktrees"}),s(!1)}},{id:"goto-repositories",label:"Go to Repositories",shortcut:"meta+4",keywords:["repos","git","projects"],category:"navigation",icon:x.jsx(Ce,{icon:N2,size:16,strokeWidth:2}),action:()=>{p({to:"/repositories"}),s(!1)}},{id:"goto-settings",label:"Go to Settings",shortcut:"meta+,",keywords:["preferences","config","configuration"],category:"navigation",icon:x.jsx(Ce,{icon:F2,size:16,strokeWidth:2}),action:()=>{p({to:"/settings"}),s(!1)}},{id:"new-task",label:"New Task",shortcut:"meta+n",keywords:["create","add"],category:"actions",icon:x.jsx(Ce,{icon:ec,size:16,strokeWidth:2}),action:()=>{s(!1),e?.()}},{id:"show-shortcuts",label:"Keyboard Shortcuts",shortcut:"meta+/",keywords:["help","hotkeys","keys"],category:"actions",icon:x.jsx(Ce,{icon:GM,size:16,strokeWidth:2}),action:()=>{s(!1),t?.()}}],[p,e,t,f]),b=k.useMemo(()=>oj(g,o),[g,o]),w=k.useMemo(()=>aj(b),[b]),C=k.useMemo(()=>{const v=[],S=["navigation","actions"];for(const E of S){const T=w.get(E);T&&v.push(...T)}return v},[w]);k.useEffect(()=>{a(0)},[o]),k.useEffect(()=>{if(!d.current)return;const v=d.current.querySelector('[data-selected="true"]');v&&v.scrollIntoView({block:"nearest"})},[h]),mi("meta+k",()=>s(!0),{allowInInput:!0}),mi("meta+1",()=>p({to:"/tasks"}),{allowInInput:!0}),mi("meta+2",()=>p({to:"/terminals"}),{allowInInput:!0}),mi("shift+meta+t",()=>{f("all-tasks"),p({to:"/terminals"})},{allowInInput:!0}),mi("meta+3",()=>p({to:"/worktrees"}),{allowInInput:!0}),mi("meta+4",()=>p({to:"/repositories"}),{allowInInput:!0}),mi("meta+,",()=>p({to:"/settings"}),{allowInInput:!0}),mi("meta+n",()=>{e?.()},{allowInInput:!1,deps:[e]}),mi("meta+/",()=>{t?.()},{allowInInput:!0,deps:[t]});const _=k.useCallback(v=>{switch(v.key){case"ArrowDown":v.preventDefault(),a(S=>Math.min(S+1,C.length-1));break;case"ArrowUp":v.preventDefault(),a(S=>Math.max(S-1,0));break;case"Enter":v.preventDefault(),C[h]&&C[h].action();break;case"Escape":v.preventDefault(),s(!1);break}},[C,h]);k.useEffect(()=>{n&&(u(""),a(0),setTimeout(()=>c.current?.focus(),50))},[n]);let y=0;return x.jsx(Ms,{open:n,onOpenChange:s,children:x.jsxs(Ds,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",showCloseButton:!1,onKeyDown:_,children:[x.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[x.jsx("span",{className:"text-muted-foreground mr-2",children:">"}),x.jsx(qt,{ref:c,value:o,onChange:v=>u(v.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"}),x.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"})]}),x.jsx("div",{ref:d,className:"max-h-80 overflow-y-auto p-2",children:b.length===0?x.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No commands found."}):x.jsx(x.Fragment,{children:["navigation","actions"].map(v=>{const S=w.get(v);return!S||S.length===0?null:x.jsxs("div",{className:"mb-2 last:mb-0",children:[x.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:lj[v]}),S.map(E=>{const T=y++,A=T===h;return x.jsxs("button",{"data-selected":A,onClick:()=>E.action(),onMouseEnter:()=>a(T),className:Be("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",A?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[E.icon&&x.jsx("span",{className:"text-muted-foreground",children:E.icon}),x.jsx("span",{className:"flex-1 text-left",children:E.label}),E.shortcut&&x.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:ek(E.shortcut)})]},E.id)})]},v)})})})]})})}const dj=[{title:"Navigation",items:[{label:"Go to Tasks",shortcut:"meta+1"},{label:"Go to Terminals",shortcut:"meta+2"},{label:"Go to Task Terminals",shortcut:"shift+meta+t"},{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+n"},{label:"Keyboard Shortcuts",shortcut:"meta+/"}]},{title:"General",items:[{label:"Close Modal",shortcut:"escape"}]}];function fj({open:e,onOpenChange:t}){return x.jsx(Ms,{open:e,onOpenChange:t,children:x.jsxs(Ds,{className:"sm:max-w-md",children:[x.jsx(vi,{children:x.jsx(_i,{children:"Keyboard Shortcuts"})}),x.jsx("div",{className:"space-y-4 mt-2",children:dj.map(n=>x.jsxs("div",{children:[x.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:n.title}),x.jsx("div",{className:"space-y-1",children:n.items.map(s=>x.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[x.jsx("span",{className:"text-sm",children:s.label}),x.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:ek(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const hj=({...e})=>x.jsx(QI,{theme:"dark",className:"toaster group",icons:{success:x.jsx(Ce,{icon:HM,strokeWidth:2,className:"size-4"}),info:x.jsx(Ce,{icon:YM,strokeWidth:2,className:"size-4"}),warning:x.jsx(Ce,{icon:Jl,strokeWidth:2,className:"size-4"}),error:x.jsx(Ce,{icon:JM,strokeWidth:2,className:"size-4"}),loading:x.jsx(Ce,{icon:Jr,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}),Us=m3({component:mj});function pj(){return tj(),null}function mj(){const[e,t]=k.useState(null),[n,s]=k.useState(!1),o=k.useCallback(a=>{t(()=>a)},[]),u=k.useCallback(()=>{e?.()},[e]),h=k.useCallback(()=>{s(!0)},[]);return x.jsx(nj,{children:x.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground",children:[x.jsx(pj,{}),x.jsx(wI,{onNewTaskRef:o}),x.jsx("main",{className:"isolate flex-1 overflow-hidden",children:x.jsx(Zw,{})}),x.jsx(uj,{onNewTask:u,onShowShortcuts:h}),x.jsx(fj,{open:n,onOpenChange:s}),x.jsx(hj,{position:"bottom-right"})]})})}const gj=vs("/")({beforeLoad:()=>{throw jw({to:"/tasks"})}}),nk="";async function vj(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function _j(){const[e,t]=k.useState(new Map),[n,s]=k.useState(null),[o,u]=k.useState(!0),[h,a]=k.useState(!1),[c,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 w=new EventSource(`${nk}/api/worktrees`);p.current=w,w.addEventListener("worktree:basic",C=>{const _=JSON.parse(C.data);f.current=_.length,t(new Map(_.map(y=>[y.path,{...y,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(_.length>0)}),w.addEventListener("worktree:details",C=>{const _=JSON.parse(C.data);t(y=>{const v=new Map(y),S=v.get(_.path);return S&&v.set(_.path,{...S,size:_.size,sizeFormatted:_.sizeFormatted,branch:_.branch}),v}),f.current--,f.current<=0&&a(!1)}),w.addEventListener("worktree:complete",C=>{const _=JSON.parse(C.data);s(_),a(!1),w.close()}),w.addEventListener("worktree:error",C=>{const{path:_}=JSON.parse(C.data);console.error(`Error loading worktree details for ${_}`),f.current--,f.current<=0&&a(!1)}),w.onerror=()=>{d(new Error("Connection lost")),u(!1),a(!1),w.close()}},[]);return k.useEffect(()=>(g(),()=>{p.current?.close()}),[g]),{worktrees:k.useMemo(()=>Array.from(e.values()).sort((C,_)=>C.isOrphaned!==_.isOrphaned?C.isOrphaned?-1:1:new Date(_.lastModified).getTime()-new Date(C.lastModified).getTime()),[e]),summary:n,isLoading:o,isLoadingDetails:h,error:c,refetch:g}}function yj(){const e=Gn();return Nn({mutationFn:({worktreePath:t,repoPath:n})=>vj(`${nk}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const bj=Xl("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 ga({className:e,variant:t="default",render:n,...s}){return B9({defaultTagName:"span",props:zs({className:Be(bj({className:e,variant:t}))},s),render:n,state:{slot:"badge",variant:t}})}function lc({className:e,size:t="default",...n}){return x.jsx("div",{"data-slot":"card","data-size":t,className:Be("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function Sj({className:e,...t}){return x.jsx("div",{"data-slot":"card-header",className:Be("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function xj({className:e,...t}){return x.jsx("div",{"data-slot":"card-title",className:Be("text-sm font-medium",e),...t})}function cc({className:e,...t}){return x.jsx("div",{"data-slot":"card-content",className:Be("px-4 group-data-[size=sm]/card:px-3",e),...t})}function Cj({className:e,...t}){return x.jsx("div",{"data-slot":"card-footer",className:Be("rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3 flex items-center",e),...t})}function id({...e}){return x.jsx(yP,{"data-slot":"alert-dialog",...e})}function od({...e}){return x.jsx(JE,{"data-slot":"alert-dialog-trigger",...e})}function wj({...e}){return x.jsx(YE,{"data-slot":"alert-dialog-portal",...e})}function Ej({className:e,...t}){return x.jsx(W2,{"data-slot":"alert-dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function ad({className:e,size:t="default",...n}){return x.jsxs(wj,{children:[x.jsx(Ej,{}),x.jsx(KE,{"data-slot":"alert-dialog-content","data-size":t,className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function ld({className:e,...t}){return x.jsx("div",{"data-slot":"alert-dialog-header",className:Be("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function cd({className:e,...t}){return x.jsx("div",{"data-slot":"alert-dialog-footer",className:Be("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function ud({className:e,...t}){return x.jsx(ZE,{"data-slot":"alert-dialog-title",className:Be("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function dd({className:e,...t}){return x.jsx($2,{"data-slot":"alert-dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function rk({className:e,...t}){return x.jsx(ze,{"data-slot":"alert-dialog-action",className:Be(e),...t})}function fd({className:e,variant:t="outline",size:n="default",...s}){return x.jsx(up,{"data-slot":"alert-dialog-cancel",className:Be(e),render:x.jsx(ze,{variant:t,size:n}),...s})}const sk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},d_={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"},Rj=vs("/worktrees/")({component:Aj});function kj(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 CC({className:e}){return x.jsx("span",{className:`inline-block animate-pulse rounded bg-muted ${e}`})}function Tj({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 x.jsx(lc,{className:"transition-colors hover:border-border/80",children:x.jsxs(cc,{className:"flex items-start justify-between gap-4 py-4",children:[x.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"truncate font-medium",children:e.name}),e.isOrphaned?x.jsx(ga,{className:Be("shrink-0",d_.ORPHANED),children:"Orphaned"}):e.taskStatus?x.jsx(ga,{className:Be("shrink-0",d_[e.taskStatus]),children:sk[e.taskStatus]}):null]}),x.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:_s,size:12,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{className:"truncate font-mono",children:e.path})]}),x.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:Jv,size:12,strokeWidth:2,className:"shrink-0"}),e.branch==="..."?x.jsx(CC,{className:"h-3 w-16"}):x.jsx("span",{className:"font-mono",children:e.branch})]}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:qM,size:12,strokeWidth:2,className:"shrink-0"}),e.sizeFormatted==="..."?x.jsx(CC,{className:"h-3 w-12"}):x.jsx("span",{children:e.sizeFormatted})]}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:BM,size:12,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{children:kj(e.lastModified)})]})]}),e.taskId&&e.taskTitle&&x.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:x.jsxs(Wn,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[x.jsx("span",{className:"truncate",children:e.taskTitle}),x.jsx(Ce,{icon:P2,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),x.jsxs(id,{open:n,onOpenChange:s,children:[x.jsx(od,{render:x.jsx(ze,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:h}),children:x.jsx(Ce,{icon:qu,size:14,strokeWidth:2})}),x.jsxs(ad,{children:[x.jsxs(ld,{children:[x.jsx(ud,{children:"Delete Worktree"}),x.jsxs(dd,{children:["This will permanently delete the worktree directory at"," ",x.jsx("span",{className:"font-mono",children:e.name}),".",!e.isOrphaned&&x.jsxs(x.Fragment,{children:[" ","The linked task ",x.jsxs("span",{className:"font-medium",children:['"',e.taskTitle,'"']})," will also be deleted."]})," ","This action cannot be undone."]})]}),x.jsxs(cd,{children:[x.jsx(fd,{disabled:o,children:"Cancel"}),x.jsxs(ze,{variant:"destructive",onClick:a,disabled:o,className:"gap-2",children:[o&&x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})})}const Lj=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function Aj(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=_j(),h=yj(),[a,c]=k.useState(new Set),d=b=>{c(w=>{const C=new Set(w);return C.has(b)?C.delete(b):C.add(b),C})},p=()=>{c(new Set)},f=k.useMemo(()=>a.size===0?e:e.filter(b=>!!(b.isOrphaned&&a.has("ORPHANED")||b.taskStatus&&a.has(b.taskStatus))),[e,a]),g=async b=>{await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath}),u()};return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-2",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx("h1",{className:"text-sm font-medium",children:"Worktrees"}),(t||e.length>0)&&x.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[x.jsxs("span",{children:[t?.total??e.length," total"]}),(t?.orphaned??e.filter(b=>b.isOrphaned).length)>0&&x.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(b=>b.isOrphaned).length," orphaned"]}),s?x.jsx("span",{className:"animate-pulse",children:"calculating..."}):t?x.jsx("span",{children:t.totalSizeFormatted}):null]})]}),a.size>0&&x.jsxs(ze,{variant:"ghost",size:"sm",onClick:p,className:"gap-1.5 text-xs",children:[x.jsx(Ce,{icon:go,size:12,strokeWidth:2}),"Clear filters"]})]}),x.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:Lj.map(b=>{const w=a.has(b);return x.jsx("button",{onClick:()=>d(b),className:Be("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",w?d_[b]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:sk[b]},b)})})]}),x.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[n&&x.jsx("div",{className:"flex items-center justify-center py-12",children:x.jsx(Ce,{icon:Jr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),o&&x.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[x.jsx(Ce,{icon:Jl,size:20,strokeWidth:2}),x.jsxs("span",{className:"text-sm",children:["Failed to load worktrees: ",o.message]})]}),!n&&!o&&f.length===0&&x.jsx("div",{className:"py-12 text-muted-foreground",children:x.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 with branches."})}),!n&&x.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:f.map(b=>x.jsx(Tj,{worktree:b,onDelete:g},b.path))})]})]})}function Gt(e,t="Assertion error"){if(!e)throw Error(t)}function Gl({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 f_(e,t){return t.sort(e==="horizontal"?Oj:Mj)}function Oj(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Mj(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function ik(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 Dj({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:c}=ik(s,h),d=e==="horizontal"?a:c;d<u&&(u=d,o=h)}return Gt(o,"No rect found"),o}function ok(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=f_(n,Array.from(t.children).filter(p=>p instanceof HTMLElement).map(p=>({element:p}))).map(({element:p})=>p),h=[];let a=!1,c,d=[];for(const p of u)if(p.hasAttribute("data-panel")){const f=s.find(g=>g.element===p);if(f){if(c){const g=c.element.getBoundingClientRect(),b=p.getBoundingClientRect();let w;if(a){const C=n==="horizontal"?new DOMRect(g.right,g.top,0,g.height):new DOMRect(g.left,g.bottom,g.width,0),_=n==="horizontal"?new DOMRect(b.left,b.top,0,b.height):new DOMRect(b.left,b.top,b.width,0);switch(d.length){case 0:{w=[C,_];break}case 1:{const y=d[0],v=Dj({orientation:n,rects:[g,b],targetRect:y.element.getBoundingClientRect()});w=[y,v===g?_:C];break}default:{w=d;break}}}else d.length?w=d:w=[n==="horizontal"?new DOMRect(g.right,b.top,b.left-g.right,b.height):new DOMRect(b.left,g.bottom,b.width,b.top-g.bottom)];for(const C of w)h.push({group:e,groupSize:Gl({group:e}),panels:[c,f],separator:"width"in C?void 0:C,rect:"width"in C?C:C.element.getBoundingClientRect()})}a=!1,c=f,d=[]}}else if(p.hasAttribute("data-separator")){const f=o.find(g=>g.element===p);f?d.push(f):(c=void 0,d=[])}else a=!0;return h}function Pj(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function Ij(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function jj(e){return e/100*window.innerHeight}function Nj(e){return e/100*window.innerWidth}function Bj(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 eh({groupSize:e,panelElement:t,styleProp:n}){let s;const[o,u]=Bj(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=Ij(t,o);break}case"em":{s=Pj(t,o);break}case"vh":{s=jj(o);break}case"vw":{s=Nj(o);break}}return s}function gs(e){return parseFloat(e.toFixed(3))}function wC(e){const{panels:t}=e,n=Gl({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=eh({groupSize:n,panelElement:o,styleProp:u.collapsedSize});h=gs(p/n*100)}let a;if(u.defaultSize){const p=eh({groupSize:n,panelElement:o,styleProp:u.defaultSize});a=gs(p/n*100)}let c=0;if(u.minSize){const p=eh({groupSize:n,panelElement:o,styleProp:u.minSize});c=gs(p/n*100)}let d=100;if(u.maxSize){const p=eh({groupSize:n,panelElement:o,styleProp:u.maxSize});d=gs(p/n*100)}return{collapsedSize:h,collapsible:u.collapsible===!0,defaultSize:a,minSize:c,maxSize:d,panelId:s.id}})}class zj{#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 c=h[a];try{c.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 sr(e,t,n=0){return Math.abs(gs(e)-gs(t))<=n}let Kr={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const va=new zj;function Ws(){return Kr}function rs(e){const t=typeof e=="function"?e(Kr):e;if(Kr===t)return Kr;const n=Kr;return Kr={...Kr,...t},t.cursorFlags!==void 0&&va.emit("cursorFlagsChange",Kr.cursorFlags),t.interactionState!==void 0&&va.emit("interactionStateChange",Kr.interactionState),t.mountedGroups!==void 0&&(Kr.mountedGroups.forEach((s,o)=>{s.derivedPanelConstraints.forEach(u=>{if(u.collapsible){const{layout:h}=n.mountedGroups.get(o)??{};if(h){const a=sr(u.collapsedSize,s.layout[u.panelId]),c=sr(u.collapsedSize,h[u.panelId]);a&&!c&&(o.inMemoryLastExpandedPanelSizes[u.panelId]=h[u.panelId])}}})}),va.emit("mountedGroupsChange",Kr.mountedGroups)),Kr}const Hj=e=>e,yv=()=>{},ak=1,lk=2,ck=4,uk=8,EC={coarse:10,precise:5};function Vj({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&ak)!==0,h=(e&lk)!==0,a=(e&ck)!==0,c=(e&uk)!==0;if(e){if(u)return a?"se-resize":c?"ne-resize":"e-resize";if(h)return a?"sw-resize":c?"nw-resize":"w-resize";if(a)return"s-resize";if(c)return"n-resize"}break}}return s>0&&o>0?"move":s>0?"ew-resize":"ns-resize"}let bv,ks;function z0(){ks===void 0&&(ks=new CSSStyleSheet,document.adoptedStyleSheets=[ks]);const{cursorFlags:e,interactionState:t}=Ws();switch(t.state){case"active":case"hover":{const n=Vj({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(bv===s)return;bv=s,n?ks.cssRules.length===0?ks.insertRule(s):ks.replaceSync(s):ks.cssRules.length===1&&ks.deleteRule(0);break}case"inactive":{bv=void 0,ks.cssRules.length===1&&ks.deleteRule(0);break}}}function Fj(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 ju(e,t){return sr(e,t)?0:e>t?1:-1}function wl({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:s,maxSize:o=100,minSize:u=0}=e;if(ju(t,u)<0)if(s){const h=(n+u)/2;ju(t,h)<0?t=n:t=u}else t=u;return t=Math.min(o,t),t=gs(t),t}function Nu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:u}){if(sr(e,0))return t;const h=Object.values(t),a=Object.values(o),c=[...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 w=e<0?p:d,C=n[w];Gt(C,`Panel constraints not found for index ${w}`);const{collapsedSize:_=0,collapsible:y,minSize:v=0}=C;if(y){const S=h[w];if(Gt(S!=null,`Previous layout not found for panel index ${w}`),sr(S,_)){const E=v-S;ju(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}{const w=e<0?d:p,C=n[w];Gt(C,`No panel constraints found for index ${w}`);const{collapsedSize:_=0,collapsible:y,minSize:v=0}=C;if(y){const S=h[w];if(Gt(S!=null,`Previous layout not found for panel index ${w}`),sr(S,v)){const E=S-_;ju(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}}{const w=e<0?1:-1;let C=e<0?p:d,_=0;for(;;){const v=h[C];Gt(v!=null,`Previous layout not found for panel index ${C}`);const S=wl({panelConstraints:n[C],size:100})-v;if(_+=S,C+=w,C<0||C>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(_));e=e<0?0-y:y}{let w=e<0?d:p;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(f),_=h[w];Gt(_!=null,`Previous layout not found for panel index ${w}`);const y=_-C,v=wl({panelConstraints:n[w],size:y});if(!sr(_,v)&&(f+=_-v,c[w]=v,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(Fj(a,c))return o;{const w=e<0?p:d,C=h[w];Gt(C!=null,`Previous layout not found for panel index ${w}`);const _=C+f,y=wl({panelConstraints:n[w],size:_});if(c[w]=y,!sr(y,_)){let v=_-y,S=e<0?p:d;for(;S>=0&&S<n.length;){const E=c[S];Gt(E!=null,`Previous layout not found for panel index ${S}`);const T=E+v,A=wl({panelConstraints:n[S],size:T});if(sr(E,A)||(v-=A-E,c[S]=A),sr(v,0))break;e>0?S--:S++}}}const g=Object.values(c).reduce((w,C)=>C+w,0);if(!sr(g,100,.1))return o;const b=Object.keys(o);return c.reduce((w,C,_)=>(w[b[_]]=C,w),{})}function uc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||ju(e[n],t[n])!==0)return!1;return!0}function dk({event:e,hitRegions:t,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:o}){let u=0;const h=new Map(s);t.forEach(a=>{const{group:c,groupSize:d}=a,{disableCursor:p,orientation:f,panels:g}=c;let b=0;o?f==="horizontal"?b=(e.clientX-o.x)/d*100:b=(e.clientY-o.y)/d*100:f==="horizontal"?b=e.clientX<0?-100:100:b=e.clientY<0?-100:100;const w=n.get(c),{defaultLayoutDeferred:C,derivedPanelConstraints:_,layout:y,separatorToPanels:v}=s.get(c)??{defaultLayoutDeferred:!1};if(_&&w&&y&&v){const S=Nu({delta:b,initialLayout:w,panelConstraints:_,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:y,trigger:"mouse-or-touch"});if(uc(S,y)){if(b!==0&&!p)switch(f){case"horizontal":{u|=b<0?ak:lk;break}case"vertical":{u|=b<0?ck:uk;break}}}else{h.set(a.group,{defaultLayoutDeferred:C,derivedPanelConstraints:_,layout:S,separatorToPanels:v});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=S}}}),rs({cursorFlags:u,mountedGroups:h}),z0()}function RC(e){if(e.defaultPrevented||e.relatedTarget!==null||e.clientX===0&&e.clientY===0)return;const{interactionState:t,mountedGroups:n}=Ws();t.state==="active"&&t.hitRegions.forEach(s=>{e.currentTarget===s.group.element&&dk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})})}function ph(e){const t=e.parentElement;Gt(t,"Parent group element not found");const{mountedGroups:n}=Ws();for(const[s]of n)if(s.element===t)return s;throw Error("Could not find parent Group for separator element")}function Ea({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(!sr(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 c=100/s*a;n[h]=c}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 c=wl({panelConstraints:t[h],size:a});a!=c&&(o+=a-c,n[h]=c)}if(!sr(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 c=a+o,d=wl({panelConstraints:t[h],size:c});if(a!==d&&(o-=d-a,n[h]=d,sr(o,0)))break}const u=Object.keys(e);return n.reduce((h,a,c)=>(h[u[c]]=a,h),{})}function fk({groupId:e}){const t=()=>{const{mountedGroups:n}=Ws();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(),c=Ea({layout:n,panelConstraints:o});return s?h:(uc(h,c)||rs(d=>({mountedGroups:new Map(d.mountedGroups).set(u,{defaultLayoutDeferred:s,derivedPanelConstraints:o,layout:c,separatorToPanels:a})})),c)}}}function hk(e){const{mountedGroups:t}=Ws(),n=t.get(e);return Gt(n,`Mounted Group ${e.id} not found`),n}function Go(e,t){const n=ph(e),s=hk(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=fk({groupId:n.id}).getLayout(),c=Nu({delta:t,initialLayout:a,panelConstraints:s.derivedPanelConstraints,pivotIndices:h,prevLayout:a,trigger:"keyboard"}),d=Ea({layout:c,panelConstraints:s.derivedPanelConstraints});uc(a,d)||rs(p=>({mountedGroups:new Map(p.mountedGroups).set(n,{defaultLayoutDeferred:s.defaultLayoutDeferred,derivedPanelConstraints:s.derivedPanelConstraints,layout:d,separatorToPanels:s.separatorToPanels})}))}function kC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=ph(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Go(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Go(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Go(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Go(t,-5);break}case"End":{e.preventDefault(),Go(t,100);break}case"Enter":{e.preventDefault();const s=ph(t),{derivedPanelConstraints:o,layout:u,separatorToPanels:h}=hk(s),a=s.separators.find(f=>f.element===t);Gt(a,"Matching separator not found");const c=h.get(a);Gt(c,"Matching panels not found");const d=c[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;Go(t,g-f)}break}case"F6":{e.preventDefault();const s=ph(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(),Go(t,-100);break}}}function Uj(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=ik(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 th;function Wj(){return th===void 0&&(typeof matchMedia=="function"?th=!!matchMedia("(pointer:coarse)").matches:th=!1),th}function qj(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:AC(e),b:AC(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:LC(TC(n.a)),b:LC(TC(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 c=u[a];if(c===h.a)return 1;if(c===h.b)return-1}}return Math.sign(o.a-o.b)}const Gj=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $j(e){const t=getComputedStyle(pk(e)??e).display;return t==="flex"||t==="inline-flex"}function Kj(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||$j(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"||Gj.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function TC(e){let t=e.length;for(;t--;){const n=e[t];if(Gt(n,"Missing node"),Kj(n))return n}return null}function LC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function AC(e){const t=[];for(;e;)t.push(e),e=pk(e);return t}function pk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function Yj(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 Xj({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(qj(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(Yj(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function mk(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=Wj()?EC.coarse:EC.precise,h=ok(o),a=Uj(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&Xj({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function OC(e){if(e.defaultPrevented)return;const{mountedGroups:t}=Ws(),n=mk(e,t),s=new Set,o=new Set,u=new Set,h=new Map;let a=!1;n.forEach(c=>{s.add(c.group),c.panels.forEach(p=>{o.add(p)}),c.separator&&(u.add(c.separator),a||(a=!0,c.separator.element.focus()));const d=t.get(c.group);d&&h.set(c.group,d.layout)}),rs({interactionState:{hitRegions:n,initialLayoutMap:h,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function MC(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Ws();switch(t.state){case"active":{if(e.type!=="pointerleave"&&e.buttons===0){rs(s=>s.interactionState.state==="inactive"?s:{cursorFlags:0,interactionState:{state:"inactive"}});return}dk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=mk(e,n);s.length===0?t.state!=="inactive"&&rs({interactionState:{state:"inactive"}}):rs({interactionState:{hitRegions:s,state:"hover"}}),z0();break}}}function DC(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=Ws();t.state==="active"&&(rs({cursorFlags:0,interactionState:{state:"inactive"}}),z0())}function PC(e){let t=0,n=0;const s={};for(const u of e)if(u.defaultSize!==void 0){t++;const h=gs(u.defaultSize);n+=h,s[u.panelId]=h}else s[u.panelId]=void 0;const o=e.length-t;if(o!==0){const u=gs((100-n)/o);for(const h of e)h.defaultSize===void 0&&(s[h.panelId]=u)}return s}function Qj(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=Gl({group:e});o.onResize({asPercentage:gs(s.inlineSize/u*100),inPixels:s.inlineSize},o.id)}function Zj(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 Jj(e){let t=!0;const n=new Set,s=new Set,o=new ResizeObserver(b=>{for(const w of b){const{borderBoxSize:C,target:_}=w;if(_===e.element){if(t){if(Gl({group:e})===0)return;rs(y=>{const v=y.mountedGroups.get(e);if(v){const S=wC(e),E=v.defaultLayoutDeferred?PC(S):v.layout,T=Ea({layout:E,panelConstraints:S});return!v.defaultLayoutDeferred&&uc(E,T)&&Zj(v.derivedPanelConstraints,S)?y:{mountedGroups:new Map(y.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,layout:T,separatorToPanels:v.separatorToPanels})}}return y})}}else Qj(e,_,C)}});o.observe(e.element),e.panels.forEach(b=>{Gt(!n.has(b.id),`Panel ids must be unique; id "${b.id}" was used more than once`),n.add(b.id),b.onResize&&o.observe(b.element)});const u=Gl({group:e}),h=wC(e),a=e.panels.map(({id:b})=>b).join(",");let c=e.defaultLayout;c&&e.panels.length!==Object.keys(c).length&&(c=void 0);const d=e.inMemoryLayouts[a]??c??PC(h),p=Ea({layout:d,panelConstraints:h}),f=ok(e),g=rs(b=>{const w=new Map;return f.forEach(C=>{C.separator&&w.set(C.separator,C.panels)}),{mountedGroups:new Map(b.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:h,layout:p,separatorToPanels:w})}});return e.element.addEventListener("pointerleave",RC),e.separators.forEach(b=>{Gt(!s.has(b.id),`Separator ids must be unique; id "${b.id}" was used more than once`),s.add(b.id),b.element.addEventListener("keydown",kC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",OC),window.addEventListener("pointermove",MC),window.addEventListener("pointerup",DC)),function(){t=!1;const b=rs(w=>{const C=new Map(w.mountedGroups);return C.delete(e),{mountedGroups:C}});e.element.removeEventListener("pointerleave",RC),e.separators.forEach(w=>{w.element.removeEventListener("keydown",kC)}),b.mountedGroups.size===0&&(window.removeEventListener("pointerdown",OC),window.removeEventListener("pointermove",MC),window.removeEventListener("pointerup",DC)),o.disconnect()}}function H0(e){const t=k.useId();return`${e??t}`}const ja=typeof window<"u"?k.useLayoutEffect:k.useEffect;function V0(e){const t=k.useRef(e);return ja(()=>{t.current=e},[e]),k.useCallback(n=>t.current?.(n),[t])}function F0(...e){return V0(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function eN(e){const t=k.useRef({...e});return ja(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const gk="--react-resizable-panels--panel--pointer-events";function vk(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 _k=k.createContext(null);function tN(e,t){const n=k.useRef({getLayout:()=>({}),setLayout:Hj});k.useImperativeHandle(t,()=>n.current,[]),ja(()=>{Object.assign(n.current,fk({groupId:e}))})}function nN({children:e,className:t,defaultLayout:n,disableCursor:s,disabled:o,elementRef:u,groupRef:h,id:a,onLayoutChange:c,orientation:d="horizontal",style:p,...f}){const g=k.useRef({}),b=V0($=>{uc(g.current,$)||(g.current=$,c?.($))}),w=H0(a),[C,_]=k.useState(!1),[y,v]=k.useState(null),[S,E]=k.useState(n??{}),[T,A]=k.useState([]),[M,L]=k.useState([]),D=k.useRef({lastExpandedPanelSizes:{},layouts:{}}),U=F0(v,u);tN(w,h);const z=k.useMemo(()=>({id:w,orientation:d,registerPanel:$=>(A(V=>f_(d,[...V,$])),()=>{A(V=>V.filter(q=>q!==$))}),registerSeparator:$=>(L(V=>f_(d,[...V,$])),()=>{L(V=>V.filter(q=>q!==$))})}),[w,d]),W=eN({defaultLayout:n,disableCursor:s}),j=k.useRef(null);ja(()=>{if(y===null)return;const $={defaultLayout:W.defaultLayout,disableCursor:!!W.disableCursor,disabled:!!o,element:y,id:w,inMemoryLastExpandedPanelSizes:D.current.lastExpandedPanelSizes,inMemoryLayouts:D.current.layouts,orientation:d,panels:T,separators:M};j.current=$;const V=Jj($),q=Ws().mountedGroups.get($);if(q){const{defaultLayoutDeferred:B,derivedPanelConstraints:I,layout:G}=q;!B&&I.length>0&&(E(G),b?.(G))}const H=va.addListener("interactionStateChange",B=>{B.state==="active"?_(B.hitRegions.some(I=>I.group===$)):_(!1)}),P=va.addListener("mountedGroupsChange",B=>{const I=B.get($);if(I){const{defaultLayoutDeferred:G,derivedPanelConstraints:K,layout:J}=I;if(G||K.length===0)return;E(J),b?.(J)}});return()=>{j.current=null,V(),H(),P()}},[o,y,w,b,d,T,M,W]),k.useEffect(()=>{const $=j.current;$&&($.defaultLayout=n,$.disableCursor=!!s)});const Y={[gk]:C?"none":void 0};for(const $ in S){const V=vk(w,$),q=S[$];Y[V]=q}return x.jsx(_k.Provider,{value:z,children:x.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":w,id:w,ref:U,style:{...p,...Y,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function U0(){const e=k.useContext(_k);return Gt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function rN({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Ws();for(const[c,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,separatorToPanels:g}]of a)if(c.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:c,layout:f,separatorToPanels:g};throw Error(`Group ${e} not found`)},s=()=>{const a=n().derivedPanelConstraints.find(c=>c.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(c=>c.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 c=u();if(a===c)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,layout:g,separatorToPanels:b}=n(),w=f.panels.findIndex(v=>v.id===t),C=w===f.panels.length-1,_=Nu({delta:C?c-a:a-c,initialLayout:g,panelConstraints:p,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:g,trigger:"imperative-api"}),y=Ea({layout:_,panelConstraints:p});uc(g,y)||rs(v=>({mountedGroups:new Map(v.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:y,separatorToPanels:b})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:c}=s(),d=u();a&&d!==c&&h(c)},expand:()=>{const{collapsible:a,collapsedSize:c,minSize:d}=s(),p=u();a&&p===c&&h(d)},getSize:()=>{const{group:a}=n(),c=u(),{element:d}=o(),p=a.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:c,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:c}=s(),d=u();return a&&sr(c,d)},resize:a=>{if(u()!==a){let c;switch(typeof a){case"number":{const{group:d}=n(),p=Gl({group:d});c=gs(a/p*100);break}case"string":{c=parseFloat(a);break}}h(c)}}}}function sN(e,t){const{id:n}=U0(),s=k.useRef({collapse:yv,expand:yv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:yv});k.useImperativeHandle(t,()=>s.current,[]),ja(()=>{Object.assign(s.current,rN({groupId:n,panelId:e}))})}function iN({children:e,className:t,collapsedSize:n="0%",collapsible:s=!1,defaultSize:o,elementRef:u,id:h,maxSize:a="100%",minSize:c="0%",onResize:d,panelRef:p,style:f,...g}){const b=!!h,w=H0(h),[C,_]=k.useState(null),y=F0(_,u),{id:v,registerPanel:S}=U0(),E=d!==null,T=V0(M=>{d?.(M,h)});ja(()=>{if(C!==null)return S({element:C,id:w,idIsStable:b,onResize:E?T:void 0,panelConstraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:a,minSize:c}})},[n,s,o,C,E,w,b,a,c,T,S]),sN(w,p);const A=vk(v,w);return x.jsx("div",{...g,"data-panel":!0,"data-testid":w,id:w,ref:y,style:{...oN,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${gk})`},children:x.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const oN={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 aN({layout:e,panelConstraints:t,panelId:n,panelIndex:s}){let o,u;const h=e[n],a=t.find(c=>c.panelId===n);if(a){const c=a.maxSize,d=u=a.collapsible?a.collapsedSize:a.minSize,p=[s,s+1];u=Ea({layout:Nu({delta:d-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=Ea({layout:Nu({delta:c-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:u,valueNow:h}}function lN({children:e,className:t,elementRef:n,id:s,style:o,...u}){const h=H0(s),[a,c]=k.useState({}),[d,p]=k.useState("inactive"),[f,g]=k.useState(null),b=F0(g,n),{id:w,orientation:C,registerSeparator:_}=U0(),y=C==="horizontal"?"vertical":"horizontal";return ja(()=>{if(f!==null){const v={element:f,id:h},S=_(v),E=va.addListener("interactionStateChange",A=>{p(A.state!=="inactive"&&A.hitRegions.some(M=>M.separator===v)?A.state:"inactive")}),T=va.addListener("mountedGroupsChange",A=>{A.forEach(({derivedPanelConstraints:M,layout:L,separatorToPanels:D},U)=>{if(U.id===w){const z=D.get(v);if(z){const W=z[0],j=U.panels.indexOf(W);c(aN({layout:L,panelConstraints:M,panelId:W.id,panelIndex:j}))}}})});return()=>{E(),T(),S()}}},[f,w,h,_]),x.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:b,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}function Qo({className:e,direction:t,...n}){return x.jsx(nN,{"data-slot":"resizable-panel-group",orientation:t,className:Be("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function Qr({...e}){return x.jsx(iN,{"data-slot":"resizable-panel",...e})}function Zo({withHandle:e,className:t,...n}){return x.jsx(lN,{"data-slot":"resizable-handle",className:Be("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 [&[data-orientation=vertical]>div]:rotate-90",t),...n,children:e&&x.jsx("div",{className:"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"})})}var Sv={exports:{}},IC;function cN(){return IC||(IC=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=c(9042),g=c(9924),b=c(844),w=c(4725),C=c(2585),_=c(3656);let y=a.AccessibilityManager=class extends b.Disposable{constructor(v,S,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,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let S=0;S<v;S++)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,S){this._liveRegionDebouncer.refresh(v,S,this._terminal.rows)}_renderRows(v,S){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=v;A<=S;A++){const M=E.lines.get(E.ydisp+A),L=[],D=M?.translateToString(!0,void 0,void 0,L)||"",U=(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",U),z.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,S){const E=v.target,T=this._rowElements[S===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==T)return;let A,M;if(S===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),S===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(S===0?-1:1),this._rowElements[S===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 S={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((S.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===E.node&&S.offset>E.offset)&&([S,E]=[E,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.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:U})=>{const z=D instanceof Text?D.parentNode:D;let W=parseInt(z?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))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 Y=U<j.length?j[U]:j.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++W,Y=0),{row:W,column:Y}},M=A(S),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 S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);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,C.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],y)},3614:(h,a)=>{function c(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function p(g,b,w,C){g=d(g=c(g),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(g,!0),b.value=""}function f(g,b,w){const C=w.getBoundingClientRect(),_=g.clientX-C.left-10,y=g.clientY-C.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${_}px`,b.style.top=`${y}px`,b.style.zIndex="1000",b.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=c,a.bracketTextForPaste=d,a.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,b,w,C){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),b,w,C)},a.paste=p,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(g,b,w,C,_){f(g,b,w),_&&C.rightClickSelect(g),b.value=C.selectionText,b.select()}},7239:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=c(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(c,d,p,f){c.addEventListener(d,p,f);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(d,p,f))}}}},3551:function(h,a,c){var d=this&&this.__decorate||function(y,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,S,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(y,v){return function(S,E){v(S,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=c(3656),g=c(8460),b=c(844),w=c(2585),C=c(4725);let _=a.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(y,v,S,E,T){super(),this._element=y,this._mouseService=v,this._renderService=S,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,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.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 S=y.composedPath();for(let E=0;E<S.length;E++){const T=S[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 S=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(E)&&(S=this._checkLinkProviderResult(E,y,S)):T.provideLinks(y.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),S=this._checkLinkProviderResult(E,y,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,v){const S=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 U=L;U<=D;U++){if(S.has(U)){T.splice(A--,1);break}S.add(U)}}}}_checkLinkProviderResult(y,v,S){if(!this._activeProviderReplies)return S;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&&(S=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,v)));if(M){S=!0,this._handleNewLink(M);break}}return S}_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,b.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:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const E=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+S.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,S){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(S,v.text)}_fireUnderlineEvent(y,v){const S=y.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-E-1,S.end.x,S.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(y,v,S){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(S,v.text)}_linkAtPosition(y,v){const S=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 S<=T&&T<=E}_positionFromMouseEvent(y,v,S){const E=S.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,S,E,T){return{x1:y,y1:v,x2:S,y2:E,cols:this._bufferService.cols,fg:T}}};a.Linkifier=_=d([p(1,C.IMouseService),p(2,C.IRenderService),p(3,w.IBufferService),p(4,C.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,c){var d=this&&this.__decorate||function(C,_,y,v){var S,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,_,y,v);else for(var A=C.length-1;A>=0;A--)(S=C[A])&&(T=(E<3?S(T):E>3?S(_,y,T):S(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(C,_){return function(y,v){_(y,v,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=c(511),g=c(2585);let b=a.OscLinkProvider=class{constructor(C,_,y){this._bufferService=C,this._optionsService=_,this._oscLinkService=y}provideLinks(C,_){const y=this._bufferService.buffer.lines.get(C-1);if(!y)return void _(void 0);const v=[],S=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 U=this._oscLinkService.getLinkData(A)?.uri;if(U){const z={start:{x:M+1,y:C},end:{x:D+(L||D!==T-1?0:1),y:C}};let W=!1;if(!S?.allowNonHttpProtocols)try{const j=new URL(U);["http:","https:"].includes(j.protocol)||(W=!0)}catch{W=!0}W||v.push({text:U,range:z,activate:(j,Y)=>S?S.activate(j,Y,z):w(0,Y),hover:(j,Y)=>S?.hover?.(j,Y,z),leave:(j,Y)=>S?.leave?.(j,Y,z)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=D,A=E.extended.urlId):(M=-1,A=-1)}}_(v)}};function w(C,_){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=b=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],b)},6193:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,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 c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=c(3614),p=c(3656),f=c(3551),g=c(9042),b=c(3730),w=c(1680),C=c(3107),_=c(5744),y=c(2950),v=c(1296),S=c(428),E=c(4269),T=c(5114),A=c(8934),M=c(3230),L=c(9312),D=c(4725),U=c(6731),z=c(8055),W=c(8969),j=c(8460),Y=c(844),$=c(6114),V=c(8437),q=c(2584),H=c(7399),P=c(5941),B=c(9074),I=c(2585),G=c(5435),K=c(4567),J=c(779);class Z extends W.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 Y.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(b.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,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const F of X){let se,re="";switch(F.index){case 256:se="foreground",re="10";break;case 257:se="background",re="11";break;case 258:se="cursor",re="12";break;default:se="ansi",re="4;"+F.index}switch(F.type){case 0:const ne=z.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${re};${(0,P.toRgbString)(ne)}${q.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((ce=>ce[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(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.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(q.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),re=this._renderService.dimensions.css.cell.height,ne=F.getWidth(se),oe=this._renderService.dimensions.css.cell.width*ne,ce=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=ce+"px",this.textarea.style.width=oe+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"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(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.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(w.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(C.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(K.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 ce=X._mouseService.getMouseReportCoords(oe,X.screenElement);if(!ce)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:ce.col,row:ce.row,x:ce.x,y:ce.y,button:_e,action:ve,ctrl:oe.ctrlKey,alt:oe.altKey,shift:oe.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ne={mouseup:oe=>(se(oe),oe.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.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?re.mousemove||(F.addEventListener("mousemove",ne.mousemove),re.mousemove=ne.mousemove):(F.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&oe?re.wheel||(F.addEventListener("wheel",ne.wheel,{passive:!1}),re.wheel=ne.wheel):(F.removeEventListener("wheel",re.wheel),re.wheel=null),2&oe?re.mouseup||(re.mouseup=ne.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&oe?re.mousedrag||(re.mousedrag=ne.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.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),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(oe)}))),this.register((0,p.addDisposableDomListener)(F,"wheel",(oe=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(oe)===!1)return!1;if(!this.buffer.hasScrollback){const ce=this.viewport.getLinesScrolled(oe);if(ce===0)return;const _e=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ve="";for(let he=0;he<Math.abs(ce);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,H.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const re=this.rows-1;return this.scrollLines(se.type===2?-re:re),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!==q.C0.ETX&&se.key!==q.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(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case G.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(`${q.C0.ESC}[4;${se};${F}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ne=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${ne};${re}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(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,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,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(h,a,c){var d=this&&this.__decorate||function(y,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,S,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(y,v){return function(S,E){v(S,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=c(3656),g=c(4725),b=c(8460),w=c(844),C=c(2585);let _=a.Viewport=class extends w.Disposable{constructor(y,v,S,E,T,A,M,L){super(),this._viewportElement=y,this._scrollArea=v,this._bufferService=S,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 b.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 S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&S<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 S,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 U=M.get(L+1)?.isWrapped;if(E+=D.translateToString(!U),!U||L===M.length-1){const z=document.createElement("div");z.textContent=E,T.push(z),E.length>0&&(S=z),E=""}}return{bufferElements:T,cursorElement:S}}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 S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&v.altKey||S==="ctrl"&&v.ctrlKey||S==="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,C.IBufferService),p(3,C.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],_)},3107:function(h,a,c){var d=this&&this.__decorate||function(C,_,y,v){var S,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,_,y,v);else for(var A=C.length-1;A>=0;A--)(S=C[A])&&(T=(E<3?S(T):E>3?S(_,y,T):S(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(C,_){return function(y,v){_(y,v,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=c(4725),g=c(844),b=c(2585);let w=a.BufferDecorationRenderer=class extends g.Disposable{constructor(C,_,y,v,S){super(),this._screenElement=C,this._bufferService=_,this._coreBrowserService=y,this._decorationService=v,this._renderService=S,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((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 C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",C?.options?.layer==="top"),_.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(C.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=C.options.x??0;return y&&y>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(C,_),_}_refreshStyle(C){const _=C.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let y=this._decorationElements.get(C);y||(y=this._createElement(C),C.element=y,this._decorationElements.set(C,y),this._container.appendChild(y),C.onDispose((()=>{this._decorationElements.delete(C),y.remove()}))),y.style.top=_*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(y)}}_refreshXPosition(C,_=C.element){if(!_)return;const y=C.options.x??0;(C.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(C){this._decorationElements.get(C)?.remove(),this._decorationElements.delete(C),C.dispose()}};a.BufferDecorationRenderer=w=d([p(1,b.IBufferService),p(2,f.ICoreBrowserService),p(3,b.IDecorationService),p(4,f.IRenderService)],w)},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(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,p){return d>=c.startBufferLine-this._linePadding[p||"full"]&&d<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(h,a,c){var d=this&&this.__decorate||function(S,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(S,E,T,A);else for(var U=S.length-1;U>=0;U--)(M=S[U])&&(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(S,E){return function(T,A){E(T,A,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=c(5871),g=c(4725),b=c(844),w=c(2585),C={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 b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,E,T,A,M,L,D){super(),this._viewportElement=S,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 U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.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 S=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=S,_.center=E,_.right=S,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=_.left,y.right=_.left+_.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);C.left=E,C.center=E,C.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.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 S=this._colorZoneStore.zones;for(const E of S)E.position!=="full"&&this._renderColorZone(E);for(const E of S)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(y[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-C[S.position||"full"]/2),_[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[S.position||"full"]))}_queueRefresh(S,E){this._shouldUpdateDimensions=S||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,w.IBufferService),p(3,w.IDecorationService),p(4,g.IRenderService),p(5,w.IOptionsService),p(6,g.ICoreBrowserService)],v)},2950:function(h,a,c){var d=this&&this.__decorate||function(C,_,y,v){var S,E=arguments.length,T=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,_,y,v);else for(var A=C.length-1;A>=0;A--)(S=C[A])&&(T=(E<3?S(T):E>3?S(_,y,T):S(_,y))||T);return E>3&&T&&Object.defineProperty(_,y,T),T},p=this&&this.__param||function(C,_){return function(y,v){_(y,v,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=c(4725),g=c(2585),b=c(2584);let w=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,_,y,v,S,E){this._textarea=C,this._compositionView=_,this._bufferService=y,this._optionsService=v,this._coreService=S,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(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){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 C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,y=_.replace(C,"");this._dataAlreadySent=y,_.length>C.length?this._coreService.triggerDataEvent(y,!0):_.length<C.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):_.length===C.length&&_!==C&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(C){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,S=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"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=S+"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"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=w=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,f.IRenderService)],w)},9806:(h,a)=>{function c(d,p,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),w=parseInt(b.getPropertyValue("padding-left")),C=parseInt(b.getPropertyValue("padding-top"));return[p.clientX-g.left-w,p.clientY-g.top-C]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(d,p,f,g,b,w,C,_,y){if(!w)return;const v=c(d,p,f);return v?(v[0]=Math.ceil((v[0]+(y?C/2:0))/C),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),b),v):void 0}},9504:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=c(2584);function p(_,y,v,S){const E=_-f(_,v),T=y-f(y,v),A=Math.abs(E-T)-(function(M,L,D){let U=0;const z=M-f(M,D),W=L-f(L,D);for(let j=0;j<Math.abs(z-W);j++){const Y=g(M,L)==="A"?-1:1;D.buffer.lines.get(z+Y*j)?.isWrapped&&U++}return U})(_,y,v);return C(A,w(g(_,y),S))}function f(_,y){let v=0,S=y.buffer.lines.get(_),E=S?.isWrapped;for(;E&&_>=0&&_<y.rows;)v++,S=y.buffer.lines.get(--_),E=S?.isWrapped;return v}function g(_,y){return _>y?"A":"B"}function b(_,y,v,S,E,T){let A=_,M=y,L="";for(;A!==v||M!==S;)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 w(_,y){const v=y?"O":"[";return d.C0.ESC+v+_}function C(_,y){_=Math.floor(_);let v="";for(let S=0;S<_;S++)v+=y;return v}a.moveToCellSequence=function(_,y,v,S){const E=v.buffer.x,T=v.buffer.y;if(!v.buffer.hasScrollback)return(function(L,D,U,z,W,j){return p(D,z,W,j).length===0?"":C(b(L,D,L,D-f(D,W),!1,W).length,w("D",j))})(E,T,0,y,v,S)+p(T,y,v,S)+(function(L,D,U,z,W,j){let Y;Y=p(D,z,W,j).length>0?z-f(z,W):D;const $=z,V=(function(q,H,P,B,I,G){let K;return K=p(P,B,I,G).length>0?B-f(B,I):H,q<P&&K<=B||q>=P&&K<B?"C":"D"})(L,D,U,z,W,j);return C(b(L,Y,U,$,V==="C",W).length,w(V,j))})(E,T,_,y,v,S);let A;if(T===y)return A=E>_?"D":"C",C(Math.abs(E-_),w(A,S));A=T>y?"D":"C";const M=Math.abs(T-y);return C((function(L,D){return D.cols-L})(T>y?_:E,v)+(M-1)*v.cols+1+((T>y?E:_)-1),w(A,S))}},1296:function(h,a,c){var d=this&&this.__decorate||function(j,Y,$,V){var q,H=arguments.length,P=H<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,$):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(j,Y,$,V);else for(var B=j.length-1;B>=0;B--)(q=j[B])&&(P=(H<3?q(P):H>3?q(Y,$,P):q(Y,$))||P);return H>3&&P&&Object.defineProperty(Y,$,P),P},p=this&&this.__param||function(j,Y){return function($,V){Y($,V,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=c(3787),g=c(2550),b=c(2223),w=c(6171),C=c(6052),_=c(4725),y=c(8055),v=c(8460),S=c(844),E=c(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",D="xterm-focus",U="xterm-selection";let z=1,W=a.DomRenderer=class extends S.Disposable{constructor(j,Y,$,V,q,H,P,B,I,G,K,J,Z){super(),this._terminal=j,this._document=Y,this._element=$,this._screenElement=V,this._viewportElement=q,this._helperContainer=H,this._linkifier2=P,this._charSizeService=I,this._optionsService=G,this._bufferService=K,this._coreBrowserService=J,this._themeService=Z,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,C.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(U),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.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,S.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 Y=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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 Y=`${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}`;Y+=`${this._terminalSelector} .${A} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,Y+=`${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}`,q=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${q} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,Y+=`${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: ${q} 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);}`,Y+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[H,P]of j.ansi.entries())Y+=`${this._terminalSelector} .${M}${H} { color: ${P.css}; }${this._terminalSelector} .${M}${H}.xterm-dim { color: ${y.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${L}${H} { background-color: ${P.css}; }`;Y+=`${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${L}${b.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=Y}_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,Y){for(let $=this._rowElements.length;$<=Y;$++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,Y){this._refreshRowElements(j,Y),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,Y,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,Y,$),this.renderRows(0,this._bufferService.rows-1),!j||!Y)return;this._selectionRenderModel.update(this._terminal,j,Y,$);const V=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||P<0)return;const B=this._document.createDocumentFragment();if($){const I=j[0]>Y[0];B.appendChild(this._createSelectionElement(H,I?Y[0]:j[0],I?j[0]:Y[0],P-H+1))}else{const I=V===H?j[0]:0,G=H===q?Y[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(H,I,G));const K=P-H-1;if(B.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,K)),H!==P){const J=q===P?Y[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(P,0,J))}}this._selectionContainer.appendChild(B)}_createSelectionElement(j,Y,$,V=1){const q=this._document.createElement("div"),H=Y*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*($-Y);return H+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-H),q.style.height=V*this.dimensions.css.cell.height+"px",q.style.top=j*this.dimensions.css.cell.height+"px",q.style.left=`${H}px`,q.style.width=`${P}px`,q}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,Y){const $=this._bufferService.buffer,V=$.ybase+$.y,q=Math.min($.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=j;I<=Y;I++){const G=I+$.ydisp,K=this._rowElements[I],J=$.lines.get(G);if(!K||!J)break;K.replaceChildren(...this._rowFactory.createRow(J,G,G===V,P,B,q,H,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,Y,$,V,q,H){$<0&&(j=0),V<0&&(Y=0);const P=this._bufferService.rows-1;$=Math.max(Math.min($,P),0),V=Math.max(Math.min(V,P),0),q=Math.min(q,this._bufferService.cols);const B=this._bufferService.buffer,I=B.ybase+B.y,G=Math.min(B.x,q-1),K=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,G,K,this.dimensions.css.cell.width,this._widthCache,H?ee===$?j:0:-1,H?(ee===V?Y:q)-1:-1))}}};a.DomRenderer=W=d([p(7,E.IInstantiationService),p(8,_.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,_.ICoreBrowserService),p(12,_.IThemeService)],W)},3787:function(h,a,c){var d=this&&this.__decorate||function(A,M,L,D){var U,z=arguments.length,W=z<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(A,M,L,D);else for(var j=A.length-1;j>=0;j--)(U=A[j])&&(W=(z<3?U(W):z>3?U(M,L,W):U(M,L))||W);return z>3&&W&&Object.defineProperty(M,L,W),W},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=c(2223),g=c(643),b=c(511),w=c(2585),C=c(8055),_=c(4725),y=c(4269),v=c(6171),S=c(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,D,U,z,W){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=D,this._coreService=U,this._decorationService=z,this._themeService=W,this._workCell=new b.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,U,z,W,j,Y,$,V){const q=[],H=this._characterJoinerService.getJoinedCharacters(M),P=this._themeService.colors;let B,I=A.getNoBgTrimmedLength();L&&I<z+1&&(I=z+1);let G=0,K="",J=0,Z=0,ee=0,X=!1,F=0,se=!1,re=0;const ne=[],oe=$!==-1&&V!==-1;for(let ce=0;ce<I;ce++){A.loadCell(ce,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let ve=!1,he=ce,fe=this._workCell;if(H.length>0&&ce===H[0][0]){ve=!0;const qe=H.shift();fe=new y.JoinedCellData(this._workCell,A.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),he=qe[1]-1,_e=fe.getWidth()}const De=this._isCellInSelection(ce,M),Ae=L&&ce===z,Pe=oe&&ce>=$&&ce<=V;let Se=!1;this._decorationService.forEachDecorationAtCell(ce,M,void 0,(qe=>{Se=!0}));let be=fe.getChars()||g.WHITESPACE_CELL_CHAR;if(be===" "&&(fe.isUnderline()||fe.isOverline())&&(be=" "),re=_e*j-Y.get(be,fe.isBold(),fe.isItalic()),B){if(G&&(De&&se||!De&&!se&&fe.bg===J)&&(De&&se&&P.selectionForeground||fe.fg===Z)&&fe.extended.ext===ee&&Pe===X&&re===F&&!Ae&&!ve&&!Se){fe.isInvisible()?K+=g.WHITESPACE_CELL_CHAR:K+=be,G++;continue}G&&(B.textContent=K),B=this._document.createElement("span"),G=0,K=""}else B=this._document.createElement("span");if(J=fe.bg,Z=fe.fg,ee=fe.extended.ext,X=Pe,F=re,se=De,ve&&z>=ce&&z<=he&&(z=ce),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(ne.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&ne.push("xterm-cursor-blink"),ne.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":ne.push("xterm-cursor-outline");break;case"block":ne.push("xterm-cursor-block");break;case"bar":ne.push("xterm-cursor-bar");break;case"underline":ne.push("xterm-cursor-underline")}}if(fe.isBold()&&ne.push("xterm-bold"),fe.isItalic()&&ne.push("xterm-italic"),fe.isDim()&&ne.push("xterm-dim"),K=fe.isInvisible()?g.WHITESPACE_CELL_CHAR:fe.getChars()||g.WHITESPACE_CELL_CHAR,fe.isUnderline()&&(ne.push(`xterm-underline-${fe.extended.underlineStyle}`),K===" "&&(K=" "),!fe.isUnderlineColorDefault()))if(fe.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(fe.getUnderlineColor()).join(",")})`;else{let qe=fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&fe.isBold()&&qe<8&&(qe+=8),B.style.textDecorationColor=P.ansi[qe].css}fe.isOverline()&&(ne.push("xterm-overline"),K===" "&&(K=" ")),fe.isStrikethrough()&&ne.push("xterm-strikethrough"),Pe&&(B.style.textDecoration="underline");let ae=fe.getFgColor(),xe=fe.getFgColorMode(),Re=fe.getBgColor(),Ue=fe.getBgColorMode();const nt=!!fe.isInverse();if(nt){const qe=ae;ae=Re,Re=qe;const $e=xe;xe=Ue,Ue=$e}let He,st,et,ht=!1;switch(this._decorationService.forEachDecorationAtCell(ce,M,void 0,(qe=>{qe.options.layer!=="top"&&ht||(qe.backgroundColorRGB&&(Ue=50331648,Re=qe.backgroundColorRGB.rgba>>8&16777215,He=qe.backgroundColorRGB),qe.foregroundColorRGB&&(xe=50331648,ae=qe.foregroundColorRGB.rgba>>8&16777215,st=qe.foregroundColorRGB),ht=qe.options.layer==="top")})),!ht&&De&&(He=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,Re=He.rgba>>8&16777215,Ue=50331648,ht=!0,P.selectionForeground&&(xe=50331648,ae=P.selectionForeground.rgba>>8&16777215,st=P.selectionForeground)),ht&&ne.push("xterm-decoration-top"),Ue){case 16777216:case 33554432:et=P.ansi[Re],ne.push(`xterm-bg-${Re}`);break;case 50331648:et=C.channels.toColor(Re>>16,Re>>8&255,255&Re),this._addStyle(B,`background-color:#${T((Re>>>0).toString(16),"0",6)}`);break;default:nt?(et=P.foreground,ne.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):et=P.background}switch(He||fe.isDim()&&(He=C.color.multiplyOpacity(et,.5)),xe){case 16777216:case 33554432:fe.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(B,et,P.ansi[ae],fe,He,void 0)||ne.push(`xterm-fg-${ae}`);break;case 50331648:const qe=C.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(B,et,qe,fe,He,st)||this._addStyle(B,`color:#${T(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,et,P.foreground,fe,He,st)||nt&&ne.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ne.length&&(B.className=ne.join(" "),ne.length=0),Ae||ve||Se?B.textContent=K:G++,re!==this.defaultSpacing&&(B.style.letterSpacing=`${re}px`),q.push(B),ce=he}return B&&G&&(B.textContent=K),q}_applyMinimumContrast(A,M,L,D,U,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const W=this._getContrastCache(D);let j;if(U||z||(j=W.getColor(M.rgba,L.rgba)),j===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);j=C.color.ensureContrastRatio(U||M,z||L,Y),W.setColor((U||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,w.IOptionsService),p(3,_.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,_.IThemeService)],E)},2550:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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=c.createElement("span");p.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[p,f,g,b],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),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(c,d,p,f){c===this._font&&d===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=c,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(c,d,p){let f=0;if(!d&&!p&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const w=this._measure(c,0);return w>0&&(this._flat[f]=w),w}let g=c;d&&(g+="B"),p&&(g+="I");let b=this._holey.get(g);if(b===void 0){let w=0;d&&(w|=1),p&&(w|=2),b=this._measure(c,w),b>0&&this._holey.set(g,b)}return b}_measure(c,d){const p=this._measureElements[d];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(h,a)=>{function c(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=c,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=d,a.allowRescaling=function(p,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&p!==void 0&&p>255&&!d(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return c(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 c{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,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const w=p.buffers.active.ydisp,C=f[1]-w,_=g[1]-w,y=Math.max(C,0),v=Math.min(_,p.rows-1);y>=p.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=C,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 c}},456:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=c(2585),g=c(8460),b=c(844);let w=a.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,S,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,S,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=w=d([p(2,f.IOptionsService)],w);class C extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,E){S!==void 0&&S>0&&E!==void 0&&E>0&&(this._result.width=S,this._result.height=E)}}class _ extends C{constructor(S,E,T){super(),this._document=S,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 C{constructor(S){super(),this._optionsService=S,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 S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(h,a,c){var d=this&&this.__decorate||function(y,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,S,E);else for(var L=y.length-1;L>=0;L--)(T=y[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(y,v){return function(S,E){v(S,E,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=c(3734),g=c(643),b=c(511),w=c(2585);class C extends f.AttributeData{constructor(v,S,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=S,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=C;let _=a.CharacterJoinerService=class yk{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(v){const S={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(S),S.id}deregister(v){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===v)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(v);if(!S||S.length===0)return[];const E=[],T=S.translateToString(!0);let A=0,M=0,L=0,D=S.getFg(0),U=S.getBg(0);for(let z=0;z<S.getTrimmedLength();z++)if(S.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==U){if(z-A>1){const W=this._getJoinedRanges(T,L,M,S,A);for(let j=0;j<W.length;j++)E.push(W[j])}A=z,L=M,D=this._workCell.fg,U=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,S,A);for(let W=0;W<z.length;W++)E.push(z[W])}return E}_getJoinedRanges(v,S,E,T,A){const M=v.substring(S,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 U=this._characterJoiners[D].handler(M);for(let z=0;z<U.length;z++)yk._mergeRanges(L,U[z])}catch(U){console.error(U)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(v,S,E){let T=0,A=!1,M=0,L=v[T];if(L){for(let D=E;D<this._bufferService.cols;D++){const U=S.getWidth(D),z=S.getString(D).length||g.WHITESPACE_CELL_CHAR.length;if(U!==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,S){let E=!1;for(let T=0;T<v.length;T++){const A=v[T];if(E){if(S[1]<=A[0])return v[T-1][1]=S[1],v;if(S[1]<=A[1])return v[T-1][1]=Math.max(S[1],A[1]),v.splice(T,1),v;v.splice(T,1),T--}else{if(S[1]<=A[0])return v.splice(T,0,S),v;if(S[1]<=A[1])return A[0]=Math.min(S[0],A[0]),v;S[0]<A[1]&&(A[0]=Math.min(S[0],A[0]),E=!0)}}return E?v[v.length-1][1]=S[1]:v.push(S),v}};a.CharacterJoinerService=_=d([p(0,w.IBufferService)],_)},5114:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=c(844),p=c(8460),f=c(3656);class g extends d.Disposable{constructor(C,_,y){super(),this._textarea=C,this._window=_,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(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(C){this._window!==C&&(this._window=C,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 b extends d.Disposable{constructor(C){super(),this._parentWindow=C,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(C){this._parentWindow=C,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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=c(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 b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}a.LinkProviderService=p},8934:function(h,a,c){var d=this&&this.__decorate||function(w,C,_,y){var v,S=arguments.length,E=S<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,C,_,y);else for(var T=w.length-1;T>=0;T--)(v=w[T])&&(E=(S<3?v(E):S>3?v(C,_,E):v(C,_))||E);return S>3&&E&&Object.defineProperty(C,_,E),E},p=this&&this.__param||function(w,C){return function(_,y){C(_,y,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=c(4725),g=c(9806);let b=a.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,_,y,v){return(0,g.getCoords)(window,w,C,_,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(w,C){const _=(0,g.getCoordsRelativeToElement)(window,w,C);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=b=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],b)},3230:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=c(6193),g=c(4725),b=c(8460),w=c(844),C=c(7226),_=c(2585);let y=a.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,S,E,T,A,M,L,D){super(),this._rowCount=v,this._charSizeService=T,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((U,z)=>this._renderRows(U,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,S),this.register(L.onWindowChange((U=>this._registerIntersectionObserver(U,S))))}_registerIntersectionObserver(v,S){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(S),this._observerDisposable.value=(0,w.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,S,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,S,this._rowCount))}_renderRows(v,S){this._renderer.value&&(v=Math.min(v,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(v,S),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:S}),this._onRender.fire({start:v,end:S}),this._isNextRenderRedrawOnly=!0)}resize(v,S){this._rowCount=S,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((S=>this.refreshRows(S.start,S.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,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(v,S))):this._renderer.value.handleResize(v,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(v,S,E){this._selectionState.start=v,this._selectionState.end=S,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(v,S,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,c){var d=this&&this.__decorate||function(L,D,U,z){var W,j=arguments.length,Y=j<3?D:z===null?z=Object.getOwnPropertyDescriptor(D,U):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(L,D,U,z);else for(var $=L.length-1;$>=0;$--)(W=L[$])&&(Y=(j<3?W(Y):j>3?W(D,U,Y):W(D,U))||Y);return j>3&&Y&&Object.defineProperty(D,U,Y),Y},p=this&&this.__param||function(L,D){return function(U,z){D(U,z,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=c(9806),g=c(9504),b=c(456),w=c(4725),C=c(8460),_=c(844),y=c(6114),v=c(4841),S=c(511),E=c(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends _.Disposable{constructor(L,D,U,z,W,j,Y,$,V){super(),this._element=L,this._screenElement=D,this._linkifier=U,this._bufferService=z,this._coreService=W,this._mouseService=j,this._optionsService=Y,this._renderService=$,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((q=>this._handleTrim(q))),this.register(this._bufferService.buffers.onBufferActivate((q=>this._handleBufferActivate(q)))),this.enable(),this._model=new b.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 U=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(L[0]===D[0])return"";const W=L[0]<D[0]?L[0]:D[0],j=L[0]<D[0]?D[0]:L[0];for(let Y=L[1];Y<=D[1];Y++){const $=U.translateBufferLineToString(Y,!0,W,j);z.push($)}}else{const W=L[1]===D[1]?D[0]:void 0;z.push(U.translateBufferLineToString(L[1],!0,L[0],W));for(let j=L[1]+1;j<=D[1]-1;j++){const Y=U.lines.get(j),$=U.translateBufferLineToString(j,!0);Y?.isWrapped?z[z.length-1]+=$:z.push($)}if(L[1]!==D[1]){const j=U.lines.get(D[1]),Y=U.translateBufferLineToString(D[1],!0,0,D[0]);j&&j.isWrapped?z[z.length-1]+=Y:z.push(Y)}}return z.map((W=>W.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),U=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(U&&z&&D)&&this._areCoordsInSelection(D,U,z)}isCellInSelection(L,D){const U=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!U||!z)&&this._areCoordsInSelection([L,D],U,z)}_areCoordsInSelection(L,D,U){return L[1]>D[1]&&L[1]<U[1]||D[1]===U[1]&&L[1]===D[1]&&L[0]>=D[0]&&L[0]<U[0]||D[1]<U[1]&&L[1]===U[1]&&L[0]<U[0]||D[1]<U[1]&&L[1]===D[1]&&L[0]>=D[0]}_selectWordAtCursor(L,D){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(U,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 U=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=U?0:(D>U&&(D-=U),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 U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const z=U.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 U=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const z=(0,g.moveToCellSequence)(U[0]-1,U[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,U=!(!L||!D||L[0]===D[0]&&L[1]===D[1]);U?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,U)):this._oldHasSelection&&this._fireOnSelectionChange(L,D,U)}_fireOnSelectionChange(L,D,U){this._oldSelectionStart=L,this._oldSelectionEnd=D,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(L,D){let U=D;for(let z=0;D>=z;z++){const W=L.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:W>1&&D!==z&&(U+=W-1)}return U}setSelection(L,D,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,D],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,D,U=!0,z=!0){if(L[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,j=W.lines.get(L[1]);if(!j)return;const Y=W.translateBufferLineToString(L[1],!1);let $=this._convertViewportColToCharacterIndex(j,L[0]),V=$;const q=L[0]-$;let H=0,P=0,B=0,I=0;if(Y.charAt($)===" "){for(;$>0&&Y.charAt($-1)===" ";)$--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let J=L[0],Z=L[0];j.getWidth(J)===0&&(H++,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?(H++,J--):X>1&&(B+=X-1,$-=X-1),$--,J--}for(;Z<j.length&&V+1<Y.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 G=$+q-H+B,K=Math.min(this._bufferService.cols,V-$+H+P-B-I);if(D||Y.slice($,V).trim()!==""){if(U&&G===0&&j.getCodePoint(0)!==32){const J=W.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;G-=ee,K+=ee}}}if(z&&G+K===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const J=W.lines.get(L[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const Z=this._getWordAt([0,L[1]+1],!1,!1,!0);Z&&(K+=Z.length)}}return{start:G,length:K}}}_selectWordAt(L,D){const U=this._getWordAt(L,D);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[U.start,L[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(L){const D=this._getWordAt(L,!0);if(D){let U=L[1];for(;D.start<0;)D.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,U]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const D=this._bufferService.buffer.getWrappedRangeForLine(L),U={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)(U,this._bufferService.cols)}};a.SelectionService=M=d([p(3,E.IBufferService),p(4,E.ICoreService),p(5,w.IMouseService),p(6,E.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],M)},4725:(h,a,c)=>{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=c(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,c){var d=this&&this.__decorate||function(M,L,D,U){var z,W=arguments.length,j=W<3?L:U===null?U=Object.getOwnPropertyDescriptor(L,D):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,L,D,U);else for(var Y=M.length-1;Y>=0;Y--)(z=M[Y])&&(j=(W<3?z(j):W>3?z(L,D,j):z(L,D))||j);return W>3&&j&&Object.defineProperty(L,D,j),j},p=this&&this.__param||function(M,L){return function(D,U){L(D,U,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),g=c(8055),b=c(8460),w=c(844),C=c(2585),_=g.css.toColor("#ffffff"),y=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),S=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 U=L[D/36%6|0],z=L[D/6%6|0],W=L[D%6];M.push({css:g.channels.toCss(U,z,W),rgba:g.channels.toRgba(U,z,W)})}for(let D=0;D<24;D++){const U=8+10*D;M.push({css:g.channels.toCss(U,U,U),rgba:g.channels.toRgba(U,U,U)})}return M})());let T=a.ThemeService=class extends w.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 b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:y,cursor:v,cursorAccent:S,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,S),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 U=0;U<D;U++)L.ansi[U+16]=A(M.extendedAnsi[U],a.DEFAULT_ANSI_COLORS[U+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,C.IOptionsService)],T)},6349:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=c(8460),p=c(844);class f extends p.Disposable{constructor(b){super(),this._maxLength=b,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(b){if(this._maxLength===b)return;const w=new Array(b);for(let C=0;C<Math.min(b,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,w,...C){if(w){for(let _=b;_<this._length-w;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}for(let _=this._length-1;_>=b;_--)this._array[this._getCyclicIndex(_+C.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<C.length;_++)this._array[this._getCyclicIndex(b+_)]=C[_];if(C.length&&this.onInsertEmitter.fire({index:b,amount:C.length}),this._length+C.length>this._maxLength){const _=this._length+C.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=C.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,w,C){if(!(w<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let y=w-1;y>=0;y--)this.set(b+y+C,this.get(b+y));const _=b+w+C-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<w;_++)this.set(b+_+C,this.get(b+_))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}a.CircularList=f},1439:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(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]&&c(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 c=0,d=0,p=0,f=0;var g,b,w,C,_;function y(S){const E=S.toString(16);return E.length<2?"0"+E:E}function v(S,E){return S<E?(E+.05)/(S+.05):(S+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(E,T,A,M){return M!==void 0?`#${y(E)}${y(T)}${y(A)}${y(M)}`:`#${y(E)}${y(T)}${y(A)}`},S.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},S.toColor=function(E,T,A,M){return{css:S.toCss(E,T,A,M),rgba:S.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(S){function E(T,A){return f=Math.round(255*A),[c,d,p]=_.toChannels(T.rgba),{css:g.toCss(c,d,p,f),rgba:g.toRgba(c,d,p,f)}}S.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,U=T.rgba>>24&255,z=T.rgba>>16&255,W=T.rgba>>8&255;return c=U+Math.round((M-U)*f),d=z+Math.round((L-z)*f),p=W+Math.round((D-W)*f),{css:g.toCss(c,d,p),rgba:g.toRgba(c,d,p)}},S.isOpaque=function(T){return(255&T.rgba)==255},S.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)},S.opaque=function(T){const A=(255|T.rgba)>>>0;return[c,d,p]=_.toChannels(A),{css:g.toCss(c,d,p),rgba:A}},S.opacity=E,S.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},S.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(b||(a.color=b={})),(function(S){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{}S.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return c=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(c,d,p);case 5:return c=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(c,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 c=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(c,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),[c,d,p,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,d,p,f),css:A}}})(w||(a.css=w={})),(function(S){function E(T,A,M){const L=T/255,D=A/255,U=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*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}S.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},S.relativeLuminance2=E})(C||(a.rgb=C={})),(function(S){function E(A,M,L){const D=A>>24&255,U=A>>16&255,z=A>>8&255;let W=M>>24&255,j=M>>16&255,Y=M>>8&255,$=v(C.relativeLuminance2(W,j,Y),C.relativeLuminance2(D,U,z));for(;$<L&&(W>0||j>0||Y>0);)W-=Math.max(0,Math.ceil(.1*W)),j-=Math.max(0,Math.ceil(.1*j)),Y-=Math.max(0,Math.ceil(.1*Y)),$=v(C.relativeLuminance2(W,j,Y),C.relativeLuminance2(D,U,z));return(W<<24|j<<16|Y<<8|255)>>>0}function T(A,M,L){const D=A>>24&255,U=A>>16&255,z=A>>8&255;let W=M>>24&255,j=M>>16&255,Y=M>>8&255,$=v(C.relativeLuminance2(W,j,Y),C.relativeLuminance2(D,U,z));for(;$<L&&(W<255||j<255||Y<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),j=Math.min(255,j+Math.ceil(.1*(255-j))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),$=v(C.relativeLuminance2(W,j,Y),C.relativeLuminance2(D,U,z));return(W<<24|j<<16|Y<<8|255)>>>0}S.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,D=M>>16&255,U=M>>8&255,z=A>>24&255,W=A>>16&255,j=A>>8&255;return c=z+Math.round((L-z)*f),d=W+Math.round((D-W)*f),p=j+Math.round((U-j)*f),g.toRgba(c,d,p)},S.ensureContrastRatio=function(A,M,L){const D=C.relativeLuminance(A>>8),U=C.relativeLuminance(M>>8);if(v(D,U)<L){if(U<D){const j=E(A,M,L),Y=v(D,C.relativeLuminance(j>>8));if(Y<L){const $=T(A,M,L);return Y>v(D,C.relativeLuminance($>>8))?j:$}return j}const z=T(A,M,L),W=v(D,C.relativeLuminance(z>>8));if(W<L){const j=E(A,M,L);return W>v(D,C.relativeLuminance(j>>8))?z:j}return z}},S.reduceLuminance=E,S.increaseLuminance=T,S.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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=c(844),p=c(2585),f=c(4348),g=c(7866),b=c(744),w=c(7302),C=c(6975),_=c(8460),y=c(1753),v=c(1480),S=c(7994),E=c(9282),T=c(5435),A=c(5981),M=c(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 W in z)this.optionsService.options[W]=z[W]}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 w.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.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(C.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(S.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((W=>{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((W=>{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(((W,j)=>this._inputHandler.parse(W,j)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,W){this._writeBuffer.write(z,W)}writeSync(z,W){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(z,W)}input(z,W=!0){this.coreService.triggerDataEvent(z,W)}resize(z,W){isNaN(z)||isNaN(W)||(z=Math.max(z,b.MINIMUM_COLS),W=Math.max(W,b.MINIMUM_ROWS),this._bufferService.resize(z,W))}scroll(z,W=!1){this._bufferService.scroll(z,W)}scrollLines(z,W,j){this._bufferService.scrollLines(z,W,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 W=z-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(z,W){return this._inputHandler.registerEscHandler(z,W)}registerDcsHandler(z,W){return this._inputHandler.registerDcsHandler(z,W)}registerCsiHandler(z,W){return this._inputHandler.registerCsiHandler(z,W)}registerOscHandler(z,W){return this._inputHandler.registerOscHandler(z,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?z=W.backend==="conpty"&&W.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 W of z)W.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=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,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,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,d){return c((p=>d.fire(p)))},a.runAndSubscribe=function(c,d){return d(void 0),c((p=>d(p)))}},5435:function(h,a,c){var d=this&&this.__decorate||function(H,P,B,I){var G,K=arguments.length,J=K<3?P:I===null?I=Object.getOwnPropertyDescriptor(P,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(H,P,B,I);else for(var Z=H.length-1;Z>=0;Z--)(G=H[Z])&&(J=(K<3?G(J):K>3?G(P,B,J):G(P,B))||J);return K>3&&J&&Object.defineProperty(P,B,J),J},p=this&&this.__param||function(H,P){return function(B,I){P(B,I,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=c(2584),g=c(7116),b=c(2015),w=c(844),C=c(482),_=c(8437),y=c(8460),v=c(643),S=c(511),E=c(3734),T=c(2585),A=c(1480),M=c(6242),L=c(6351),D=c(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function W(H,P){if(H>24)return P.setWinLines||!1;switch(H){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(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(a.WindowsOptionsReportType=j={}));let Y=0;class $ extends w.Disposable{getAttrData(){return this._curAttrData}constructor(P,B,I,G,K,J,Z,ee,X=new b.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=B,this._coreService=I,this._logService=G,this._optionsService=K,this._oscLinkService=J,this._coreMouseService=Z,this._unicodeService=ee,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new S.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,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:se,data:re})})),this._parser.setDcsHandlerFallback(((F,se,re)=>{se==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:se,payload:re})})),this._parser.setPrintHandler(((F,se,re)=>this.print(F,se,re))),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,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=I,this._parseStack.position=G}_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,G=this._activeBuffer.x,K=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;G=this._parseStack.cursorStartX,K=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,re=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,re))return this._preserveStack(G,K,re,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(G,K,F,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===G&&this._activeBuffer.y===K||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 G,K;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 re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-B>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let ne=this._parser.precedingJoinState;for(let oe=B;oe<I;++oe){if(G=P[oe],G<127&&J){const he=J[String.fromCharCode(G)];he&&(G=he.charCodeAt(0))}const ce=this._unicodeService.charProperties(G,ne);K=A.UnicodeService.extractWidth(ce);const _e=A.UnicodeService.extractShouldJoin(ce),ve=_e?A.UnicodeService.extractWidth(ne):0;if(ne=ce,Z&&this._onA11yChar.fire((0,C.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-ve>ee){if(X){const he=re;let fe=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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ve>0&&re instanceof _.BufferLine&&re.copyCellsFrom(he,fe,0,ve,!1);fe<ee;)he.setCellFromCodepoint(fe++,0,1,se)}else if(this._activeBuffer.x=ee-1,K===2)continue}if(_e&&this._activeBuffer.x){const he=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-he,G,K);for(let fe=K-ve;--fe>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(F&&(re.insertCells(this._activeBuffer.x,K-ve,this._activeBuffer.getNullCell(se)),re.getWidth(ee-1)===2&&re.setCellFromCodepoint(ee-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,se)),re.setCellFromCodepoint(this._activeBuffer.x++,G,K,se),K>0)for(;--K;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=ne,this._activeBuffer.x<ee&&I-B>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.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=>!W(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,G=!1,K=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);J.replaceCells(B,I,this._activeBuffer.getNullCell(this._eraseAttrData()),K),G&&(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 G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,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,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;B--;)this._activeBuffer.lines.splice(K-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 G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;B--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(G,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 G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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,G=A.UnicodeService.extractWidth(B),K=this._activeBuffer.x-G,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),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:G,activeEncoding:K}=this._coreMouseService,J=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:X,alt:F}=Z,se=this._optionsService.rawOptions,re=_e=>_e?1:2,ne=P.params[0];return oe=ne,ce=B?ne===2?4:ne===4?re(J.modes.insertMode):ne===12?3:ne===20?re(se.convertEol):0:ne===1?re(I.applicationCursorKeys):ne===3?se.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ne===6?re(I.origin):ne===7?re(I.wraparound):ne===8?3:ne===9?re(G==="X10"):ne===12?re(se.cursorBlink):ne===25?re(!J.isCursorHidden):ne===45?re(I.reverseWraparound):ne===66?re(I.applicationKeypad):ne===67?4:ne===1e3?re(G==="VT200"):ne===1002?re(G==="DRAG"):ne===1003?re(G==="ANY"):ne===1004?re(I.sendFocus):ne===1005?4:ne===1006?re(K==="SGR"):ne===1015?4:ne===1016?re(K==="SGR_PIXELS"):ne===1048?1:ne===47||ne===1047||ne===1049?re(X===F):ne===2004?re(I.bracketedPasteMode):0,J.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${oe};${ce}$y`),!0;var oe,ce}_updateAttrColor(P,B,I,G,K){return B===2?(P|=50331648,P&=-16777216,P|=E.AttributeData.fromColorRGB([I,G,K])):B===5&&(P&=-50331904,P|=33554432|255&I),P}_extractColor(P,B,I){const G=[0,0,-1,0,0,0];let K=0,J=0;do{if(G[J+K]=P.params[B+J],P.hasSubParams(B+J)){const Z=P.getSubParams(B+J);let ee=0;do G[1]===5&&(K=1),G[J+ee+1+K]=Z[ee];while(++ee<Z.length&&ee+J+1+K<G.length);break}if(G[1]===5&&J+K>=2||G[1]===2&&J+K>=5)break;G[1]&&(K=1)}while(++J+B<P.length&&J+K<G.length);for(let Z=2;Z<G.length;++Z)G[Z]===-1&&(G[Z]=0);switch(G[0]){case 38:I.fg=this._updateAttrColor(I.fg,G[1],G[3],G[4],G[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,G[1],G[3],G[4],G[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,G[1],G[3],G[4],G[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 G=this._curAttrData;for(let K=0;K<B;K++)I=P.params[K],I>=30&&I<=37?(G.fg&=-50331904,G.fg|=16777216|I-30):I>=40&&I<=47?(G.bg&=-50331904,G.bg|=16777216|I-40):I>=90&&I<=97?(G.fg&=-50331904,G.fg|=16777224|I-90):I>=100&&I<=107?(G.bg&=-50331904,G.bg|=16777224|I-100):I===0?this._processSGR0(G):I===1?G.fg|=134217728:I===3?G.bg|=67108864:I===4?(G.fg|=268435456,this._processUnderline(P.hasSubParams(K)?P.getSubParams(K)[0]:1,G)):I===5?G.fg|=536870912:I===7?G.fg|=67108864:I===8?G.fg|=1073741824:I===9?G.fg|=2147483648:I===2?G.bg|=134217728:I===21?this._processUnderline(2,G):I===22?(G.fg&=-134217729,G.bg&=-134217729):I===23?G.bg&=-67108865:I===24?(G.fg&=-268435457,this._processUnderline(0,G)):I===25?G.fg&=-536870913:I===27?G.fg&=-67108865:I===28?G.fg&=-1073741825:I===29?G.fg&=2147483647:I===39?(G.fg&=-67108864,G.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):I===49?(G.bg&=-67108864,G.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?K+=this._extractColor(P,K,G):I===53?G.bg|=1073741824:I===55?G.bg&=-1073741825:I===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):I===100?(G.fg&=-67108864,G.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.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(!W(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 G=I.shift(),K=I.shift();if(/^\d+$/.exec(G)){const J=parseInt(G);if(q(J))if(K==="?")B.push({type:0,index:J});else{const Z=(0,D.parseColor)(K);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 G;const K=I.findIndex((J=>J.startsWith("id=")));return K!==-1&&(G=I[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,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 G=0;G<I.length&&!(B>=this._specialColors.length);++G,++B)if(I[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const K=(0,D.parseColor)(I[G]);K&&this._onColor.fire([{type:1,index:this._specialColors[B],color:K}])}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 G=0;G<I.length;++G)if(/^\d+$/.exec(I[G])){const K=parseInt(I[G]);q(K)&&B.push({type:2,index:K})}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(U[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 S.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,G=this._activeBuffer.lines.get(I);G&&(G.fill(P),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,B){const I=this._bufferService.buffer,G=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${K}${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}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,B){this._dirtyRowTracker.markRangeDirty(P,B)}}a.InputHandler=$;let V=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,P){H>P&&(Y=H,H=P,P=Y),H<this.start&&(this.start=H),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(H){return 0<=H&&H<256}V=d([p(0,T.IBufferService)],V)},844:(h,a)=>{function c(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=c,a.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{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=c,a.FourKeyMap=class{constructor(){this._data=new c}set(d,p,f,g,b){this._data.get(d,p)||this._data.set(d,p,new c),this._data.get(d,p).set(f,g,b)}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 c=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=c.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(c)},6106:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,p){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===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 b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let w=0,C=0,_=b.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),y=b.timeRemaining(),1.5*C>y)return _-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-w))}ms`),void this._start();_=y}this.clear()}}class f extends p{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=c(643);a.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=f?.get(p.cols-1),b=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);b&&g&&(b.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 c{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 c;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=c;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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=c(6349),p=c(7226),f=c(3734),g=c(8437),b=c(4634),w=c(511),C=c(643),_=c(4863),y=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,S,E){this._hasScrollback=v,this._optionsService=S,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=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.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,S){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),S)}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 S=v+this._optionsService.rawOptions.scrollback;return S>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:S}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)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,S){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(S);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<S)for(let L=this._rows;L<S;L++)this.lines.length<S+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>S;L--)this.lines.length>S+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,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(v,S),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=S,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 S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>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,S){this._cols!==v&&(v>this._cols?this._reflowLarger(v,S):this._reflowSmaller(v,S))}_reflowLarger(v,S){const E=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,b.reflowLargerCreateNewLayout)(this.lines,E);(0,b.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(v,S,T.countRemoved)}}_reflowLargerAdjustViewport(v,S,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<S&&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,S){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 U=this.ybase+this.y;if(U>=M&&U<M+D.length)continue;const z=D[D.length-1].getTrimmedLength(),W=(0,b.reflowSmallerGetNewLineLengths)(D,this._cols,v),j=W.length-D.length;let Y;Y=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 G=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);$.push(G)}$.length>0&&(T.push({start:M+D.length+A,newLines:$}),A+=$.length),D.push(...$);let V=W.length-1,q=W[V];q===0&&(V--,q=W[V]);let H=D.length-j-1,P=z;for(;H>=0;){const I=Math.min(P,q);if(D[V]===void 0)break;if(D[V].copyCellsFrom(D[H],P-I,q-I,I,!0),q-=I,q===0&&(V--,q=W[V]),P-=I,P===0){H--;const G=Math.max(H,0);P=(0,b.getWrappedLineTrimmedLength)(D,G,this._cols)}}for(let I=0;I<D.length;I++)W[I]<v&&D[I].setCell(W[I],E);let B=j-Y;for(;B-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+S-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 U=D-1,z=0,W=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(W&&W.start>U+j){for(let q=W.newLines.length-1;q>=0;q--)this.lines.set(V--,W.newLines[q]);V++,M.push({index:U+1,amount:W.newLines.length}),j+=W.newLines.length,W=T[++z]}else this.lines.set(V,L[U--]);let Y=0;for(let V=M.length-1;V>=0;V--)M[V].index+=Y,this.lines.onInsertEmitter.fire(M[V]),Y+=M[V].amount;const $=Math.max(0,D+A-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(v,S,E=0,T){const A=this.lines.get(v);return A?A.translateToString(S,E,T):""}getWrappedRangeForLine(v){let S=v,E=v;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:S,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 S=0;S<this.markers.length;S++)this.markers[S].line===v&&(this.markers[S].dispose(),this.markers.splice(S--,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 S=new _.Marker(v);return this.markers.push(S),S.register(this.lines.onTrim((E=>{S.line-=E,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((E=>{S.line>=E.index&&(S.line+=E.amount)}))),S.register(this.lines.onDelete((E=>{S.line>=E.index&&S.line<E.index+E.amount&&S.dispose(),S.line>E.index&&(S.line-=E.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=c(3734),p=c(511),f=c(643),g=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class w{constructor(_,y,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const S=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,S);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 b=3*_,y.content=this._data[b+0],y.fg=this._data[b+1],y.bg=this._data[b+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,S){268435456&S.bg&&(this._extendedAttrs[_]=S.extended),this._data[3*_+0]=y|v<<22,this._data[3*_+1]=S.fg,this._data[3*_+2]=S.bg}addCodepointToCell(_,y,v){let S=this._data[3*_+0];2097152&S?this._combined[_]+=(0,g.stringFromCodePoint)(y):2097151&S?(this._combined[_]=(0,g.stringFromCodePoint)(2097151&S)+(0,g.stringFromCodePoint)(y),S&=-2097152,S|=2097152):S=y|4194304,v&&(S&=-12582913,S|=v<<22),this._data[3*_+0]=S}insertCells(_,y,v){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length-_){const S=new p.CellData;for(let E=this.length-_-y-1;E>=0;--E)this.setCell(_+y+E,this.loadCell(_+E,S));for(let E=0;E<y;++E)this.setCell(_+E,v)}else for(let S=_;S<this.length;++S)this.setCell(S,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 S=new p.CellData;for(let E=0;E<this.length-_-y;++E)this.setCell(_+E,this.loadCell(_+y+E,S));for(let E=this.length-y;E<this.length;++E)this.setCell(E,v)}else for(let S=_;S<this.length;++S)this.setCell(S,v);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,v)}replaceCells(_,y,v,S=!1){if(S)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 S=new Uint32Array(v);S.set(this._data),this._data=S}for(let S=this.length;S<_;++S)this.setCell(S,y)}else{this._data=this._data.subarray(0,v);const S=Object.keys(this._combined);for(let T=0;T<S.length;T++){const A=parseInt(S[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 w(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,S,E){const T=_._data;if(E)for(let M=S-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<S;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,S){y=y??0,v=v??this.length,_&&(v=Math.min(v,this.getTrimmedLength())),S&&(S.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,S)for(let L=0;L<M.length;++L)S.push(y);y+=T>>22||1}return S&&S.push(y),E}}a.BufferLine=w},4841:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(h,a)=>{function c(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,b=d[p+1].getWidth(0)===2;return g&&b?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,b){const w=[];for(let C=0;C<d.length-1;C++){let _=C,y=d.get(++_);if(!y.isWrapped)continue;const v=[d.get(C)];for(;_<d.length&&y.isWrapped;)v.push(y),y=d.get(++_);if(g>=C&&g<_){C+=v.length-1;continue}let S=0,E=c(v,S,p),T=1,A=0;for(;T<v.length;){const L=c(v,T,p),D=L-A,U=f-E,z=Math.min(D,U);v[S].copyCellsFrom(v[T],A,E,z,!1),E+=z,E===f&&(S++,E=0),A+=z,A===L&&(T++,A=0),E===0&&S!==0&&v[S-1].getWidth(f-1)===2&&(v[S].copyCellsFrom(v[S-1],f-1,E++,1,!1),v[S-1].setCell(f-1,b))}v[S].replaceCells(E,f,b);let M=0;for(let L=v.length-1;L>0&&(L>S||v[L].getTrimmedLength()===0);L--)M++;M>0&&(w.push(C+v.length-M),w.push(M)),C+=v.length-1}return w},a.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,b=p[g],w=0;for(let C=0;C<d.length;C++)if(b===C){const _=p[++g];d.onDeleteEmitter.fire({index:C-w,amount:_}),C+=_-1,w+=_,b=p[++g]}else f.push(C);return{layout:f,countRemoved:w}},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=[],b=d.map(((y,v)=>c(d,v,p))).reduce(((y,v)=>y+v));let w=0,C=0,_=0;for(;_<b;){if(b-_<f){g.push(b-_);break}w+=f;const y=c(d,C,p);w>y&&(w-=y,C++);const v=d[C].getWidth(w-1)===2;v&&w--;const S=v?f-1:f;g.push(S),_+=S}return g},a.getWrappedLineTrimmedLength=c},5295:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=c(8460),p=c(844),f=c(9092);class g extends p.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=g},511:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=c(482),p=c(643),f=c(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(w){const C=new g;return C.setFromCharData(w),C}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(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const _=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const y=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(_-55296)+y-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=c(8460),p=c(844);class f{get id(){return this._id}constructor(b){this.line=b,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(b){return this._disposables.push(b),b}}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 c,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=""})(c||(a.C0=c={})),(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=`${c.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=c(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,b,w){const C={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"?C.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?C.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?C.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(C.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:C.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(C.key=d.C0.ESC+C.key);break;case 9:if(f.shiftKey){C.key=d.C0.ESC+"[Z";break}C.key=d.C0.HT,C.cancel=!0;break;case 13:C.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,C.cancel=!0;break;case 27:C.key=d.C0.ESC,f.altKey&&(C.key=d.C0.ESC+d.C0.ESC),C.cancel=!0;break;case 37:if(f.metaKey)break;_?(C.key=d.C0.ESC+"[1;"+(_+1)+"D",C.key===d.C0.ESC+"[1;3D"&&(C.key=d.C0.ESC+(b?"b":"[1;5D"))):C.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(C.key=d.C0.ESC+"[1;"+(_+1)+"C",C.key===d.C0.ESC+"[1;3C"&&(C.key=d.C0.ESC+(b?"f":"[1;5C"))):C.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(C.key=d.C0.ESC+"[1;"+(_+1)+"A",b||C.key!==d.C0.ESC+"[1;3A"||(C.key=d.C0.ESC+"[1;5A")):C.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;_?(C.key=d.C0.ESC+"[1;"+(_+1)+"B",b||C.key!==d.C0.ESC+"[1;3B"||(C.key=d.C0.ESC+"[1;5B")):C.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(C.key=d.C0.ESC+"[2~");break;case 46:C.key=_?d.C0.ESC+"[3;"+(_+1)+"~":d.C0.ESC+"[3~";break;case 36:C.key=_?d.C0.ESC+"[1;"+(_+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:C.key=_?d.C0.ESC+"[1;"+(_+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?C.type=2:f.ctrlKey?C.key=d.C0.ESC+"[5;"+(_+1)+"~":C.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?C.type=3:f.ctrlKey?C.key=d.C0.ESC+"[6;"+(_+1)+"~":C.key=d.C0.ESC+"[6~";break;case 112:C.key=_?d.C0.ESC+"[1;"+(_+1)+"P":d.C0.ESC+"OP";break;case 113:C.key=_?d.C0.ESC+"[1;"+(_+1)+"Q":d.C0.ESC+"OQ";break;case 114:C.key=_?d.C0.ESC+"[1;"+(_+1)+"R":d.C0.ESC+"OR";break;case 115:C.key=_?d.C0.ESC+"[1;"+(_+1)+"S":d.C0.ESC+"OS";break;case 116:C.key=_?d.C0.ESC+"[15;"+(_+1)+"~":d.C0.ESC+"[15~";break;case 117:C.key=_?d.C0.ESC+"[17;"+(_+1)+"~":d.C0.ESC+"[17~";break;case 118:C.key=_?d.C0.ESC+"[18;"+(_+1)+"~":d.C0.ESC+"[18~";break;case 119:C.key=_?d.C0.ESC+"[19;"+(_+1)+"~":d.C0.ESC+"[19~";break;case 120:C.key=_?d.C0.ESC+"[20;"+(_+1)+"~":d.C0.ESC+"[20~";break;case 121:C.key=_?d.C0.ESC+"[21;"+(_+1)+"~":d.C0.ESC+"[21~";break;case 122:C.key=_?d.C0.ESC+"[23;"+(_+1)+"~":d.C0.ESC+"[23~";break;case 123:C.key=_?d.C0.ESC+"[24;"+(_+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!w||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?C.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(C.key=d.C0.US),f.key==="@"&&(C.key=d.C0.NUL)):f.keyCode===65&&(C.type=1);else{const y=p[f.keyCode],v=y?.[f.shiftKey?1:0];if(v)C.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const S=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(S);f.shiftKey&&(E=E.toUpperCase()),C.key=d.C0.ESC+E}else if(f.keyCode===32)C.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let S=f.code.slice(3,4);f.shiftKey||(S=S.toLowerCase()),C.key=d.C0.ESC+S,C.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?C.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?C.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?C.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?C.key=d.C0.DEL:f.keyCode===219?C.key=d.C0.ESC:f.keyCode===220?C.key=d.C0.FS:f.keyCode===221&&(C.key=d.C0.GS)}return C}},482:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,d=0,p=c.length){let f="";for(let g=d;g<p;++g){let b=c[g];b>65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const p=c.length;if(!p)return 0;let f=0,g=0;if(this._interim){const b=c.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b<p;++b){const w=c.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=p)return this._interim=w,f;const C=c.charCodeAt(b);56320<=C&&C<=57343?d[f++]=1024*(w-55296)+C-56320+65536:(d[f++]=w,d[f++]=C)}else w!==65279&&(d[f++]=w)}return f}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const p=c.length;if(!p)return 0;let f,g,b,w,C=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=c[y++],(192&A)!=128){y--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?y--:d[C++]=T:L===3?T<2048||T>=55296&&T<=57343||T===65279||(d[C++]=T):T<65536||T>1114111||(d[C++]=T)),this.interim.fill(0)}const v=p-4;let S=y;for(;S<p;){for(;!(!(S<v)||128&(f=c[S])||128&(g=c[S+1])||128&(b=c[S+2])||128&(w=c[S+3]));)d[C++]=f,d[C++]=g,d[C++]=b,d[C++]=w,S+=4;if(f=c[S++],f<128)d[C++]=f;else if((224&f)==192){if(S>=p)return this.interim[0]=f,C;if(g=c[S++],(192&g)!=128){S--;continue}if(_=(31&f)<<6|63&g,_<128){S--;continue}d[C++]=_}else if((240&f)==224){if(S>=p)return this.interim[0]=f,C;if(g=c[S++],(192&g)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,C;if(b=c[S++],(192&b)!=128){S--;continue}if(_=(15&f)<<12|(63&g)<<6|63&b,_<2048||_>=55296&&_<=57343||_===65279)continue;d[C++]=_}else if((248&f)==240){if(S>=p)return this.interim[0]=f,C;if(g=c[S++],(192&g)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,C;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,C;if(w=c[S++],(192&w)!=128){S--;continue}if(_=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&w,_<65536||_>1114111)continue;d[C++]=_}}return C}}},225:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=c(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 b=0;b<p.length;++b)g.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(w,C){let _,y=0,v=C.length-1;if(w<C[0][0]||w>C[v][1])return!1;for(;v>=y;)if(_=y+v>>1,w>C[_][1])y=_+1;else{if(!(w<C[_][0]))return!0;v=_-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let C=this.wcwidth(b),_=C===0&&w!==0;if(_){const y=d.UnicodeService.extractWidth(w);y===0?_=!1:y>C&&(C=y)}return d.UnicodeService.createPropertyValue(0,C,_)}}},5981:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=c(8460),p=c(844);class f extends p.Disposable{constructor(b){super(),this._action=b,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(b,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,w){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const C=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],y=this._action(_,w);if(y){const S=E=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(C,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(S)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-C>=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 c=/^([\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 b=f.toString(16),w=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=c.exec(g);if(b){const w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,w=[0,0,0];for(let C=0;C<3;++C){const _=parseInt(g.slice(b*C,b*C+b),16);w[C]=b===1?_<<4:b===2?_:b===3?_>>4:_>>8}return w}},a.toRgbString=function(f,g=16){const[b,w,C]=f;return`rgb:${p(b,g)}/${p(w,g)}/${p(C,g)}`}},5770:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=c(482),p=c(8742),f=c(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(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const _=this._handlers[w];return _.push(C),{dispose:()=>{const y=_.indexOf(C);y!==-1&&_.splice(y,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||g,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(w,C,_);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,C,_))}unhook(w,C=!0){if(this._active.length){let _=!1,y=this._active.length-1,v=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=C,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;y>=0&&(_=this._active[y].unhook(w),_!==!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",w);this._active=g,this._ident=0}};const b=new p.Params;b.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,C,_){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,C,_),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((_=>(this._params=b,this._data="",this._hitLimit=!1,_)));return this._params=b,this._data="",this._hitLimit=!1,C}}},2015:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=c(844),p=c(8742),f=c(6242),g=c(6351);class b{constructor(y){this.table=new Uint8Array(y)}setDefault(y,v){this.table.fill(y<<4|v)}add(y,v,S,E){this.table[v<<8|y]=S<<4|E}addMany(y,v,S,E){for(let T=0;T<y.length;T++)this.table[v<<8|y[T]]=S<<4|E}}a.TransitionTable=b;const w=160;a.VT500_TRANSITION_TABLE=(function(){const _=new b(4095),y=Array.apply(null,Array(256)).map(((M,L)=>L)),v=(M,L)=>y.slice(M,L),S=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(S,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(S,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(S,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(S,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(w,0,2,0),_.add(w,8,5,8),_.add(w,6,0,6),_.add(w,11,0,11),_.add(w,13,13,13),_})();class C 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,S,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,S)=>{},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 S=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=y.prefix.charCodeAt(0),S&&60>S||S>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");S<<=8,S|=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 S<<=8,S|=E,S}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 S=this._identifier(y,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const E=this._escHandlers[S];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 S=this._identifier(y);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const E=this._csiHandlers[S];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,S,E,T){this._parseStack.state=y,this._parseStack.handlers=v,this._parseStack.handlerPos=S,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(y,v,S){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(S===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(S===!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(S===!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,S),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,S),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:w)],A>>4){case 2:for(let j=L+1;;++j){if(j>=v||(T=y[j])<32||T>126&&T<w){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<w){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<w){this._printHandler(y,L,j),L=j-1;break}if(++j>=v||(T=y[j])<32||T>126&&T<w){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 U=D?D.length-1:-1;for(;U>=0&&(E=D[U](this._params),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(3,D,U,A,L),E;U<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 W=z?z.length-1:-1;for(;W>=0&&(E=z[W](),E!==!0);W--)if(E instanceof Promise)return this._preserveStack(4,z,W,A,L),E;W<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<w){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<w){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=C},6242:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=c(5770),p=c(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,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const w=this._handlers[g];return w.push(b),{dispose:()=>{const C=w.indexOf(b);C!==-1&&w.splice(C,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,b,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(g,b,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,b,w))}start(){this.reset(),this._state=1}put(g,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){const C=g[b++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-b>0&&this._put(g,b,w)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,_=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=b,_=this._stack.fallThrough,this._stack.paused=!1),!_&&w===!1){for(;C>=0&&(w=this._active[C].end(g),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}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,b,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,b,w),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b<f.length;++b){const w=f[b];if(Array.isArray(w))for(let C=0;C<w.length;++C)g.addSubParam(w[C]);else g.addParam(w)}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 b=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,w))}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>c?c: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>c?c: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,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,w=255&this._subParamsIdx[g];w-b>0&&(f[g]=this._subParams.slice(b,w))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,w=b[g-1];b[g-1]=~w?Math.min(10*w+f,c):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 c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=c(3785),p=c(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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=c(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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=c(8771),p=c(8460),f=c(844);class g extends f.Disposable{constructor(w){super(),this._core=w,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(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(p=>d(p.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((p,f)=>d(p,f.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(h,a,c){var d=this&&this.__decorate||function(_,y,v,S){var E,T=arguments.length,A=T<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,y,v,S);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,S){y(v,S,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=c(8460),g=c(844),b=c(5295),w=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let C=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 b.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 S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===_.fg&&S.getBg(0)===_.bg||(S=v.getBlankLine(_,y),this._cachedBlankLine=S),S.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(S):v.lines.push(S.clone()):v.lines.splice(T+1,0,S.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,S.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(_,y,v){const S=this.buffer;if(_<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else _+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const E=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+_,S.ybase),0),E!==S.ydisp&&(y||this._onScroll.fire(S.ydisp))}};a.BufferService=C=d([p(0,w.IOptionsService)],C)},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(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(h,a,c){var d=this&&this.__decorate||function(S,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(S,E,T,A);else for(var U=S.length-1;U>=0;U--)(M=S[U])&&(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(S,E){return function(T,A){E(T,A,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=c(2585),g=c(8460),b=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function C(S,E){let T=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(T|=64,T|=S.action):(T|=3&S.button,4&S.button&&(T|=64),8&S.button&&(T|=128),S.action===32?T|=32:S.action!==0||E||(T|=3)),T}const _=String.fromCharCode,y={DEFAULT:S=>{const E=[C(S,!1)+32,S.col+32,S.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${_(E[0])}${_(E[1])}${_(E[2])}`},SGR:S=>{const E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${C(S,!0)};${S.col};${S.row}${E}`},SGR_PIXELS:S=>{const E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${C(S,!0)};${S.x};${S.y}${E}`}};let v=a.CoreMouseService=class extends b.Disposable{constructor(S,E){super(),this._bufferService=S,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(w))this.addProtocol(T,w[T]);for(const T of Object.keys(y))this.addEncoding(T,y[T]);this.reset()}addProtocol(S,E){this._protocols[S]=E}addEncoding(S,E){this._encodings[S]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const E=this._encodings[this._activeEncoding](S);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,E,T){if(T){if(S.x!==E.x||S.y!==E.y)return!1}else if(S.col!==E.col||S.row!==E.row)return!1;return S.button===E.button&&S.action===E.action&&S.ctrl===E.ctrl&&S.alt===E.alt&&S.shift===E.shift}};a.CoreMouseService=v=d([p(0,f.IBufferService),p(1,f.ICoreService)],v)},6975:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=c(1439),g=c(8460),b=c(844),w=c(2585),C=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 b.Disposable{constructor(v,S,E){super(),this._bufferService=v,this._logService=S,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)(C),this.decPrivateModes=(0,f.clone)(_)}reset(){this.modes=(0,f.clone)(C),this.decPrivateModes=(0,f.clone)(_)}triggerDataEvent(v,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),S&&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((S=>S.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=y=d([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],y)},9074:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=c(8055),p=c(8460),f=c(844),g=c(6106);let b=0,w=0;class C 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 S=new _(v);if(S){const E=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),E.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,S,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(S))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,S,E,T){this._decorations.forEachByKey(S,(A=>{b=A.options.x??0,w=b+(A.options.width??1),v>=b&&v<w&&(!E||(A.options.layer??"bottom")===E)&&T(A)}))}}a.DecorationService=C;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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=c(2585),p=c(8343);class f{constructor(...b){this._entries=new Map;for(const[w,C]of b)this.set(w,C)}set(b,w){const C=this._entries.get(b);return this._entries.set(b,w),C}forEach(b){for(const[w,C]of this._entries.entries())b(w,C)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const w=(0,p.getServiceDependencies)(g).sort(((y,v)=>y.index-v.index)),C=[];for(const y of w){const v=this._services.get(y.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${y.id}.`);C.push(v)}const _=w.length>0?w[0].index:b.length;if(b.length!==_)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${_+1} conflicts with ${b.length} static arguments`);return new g(...b,...C)}}},7866:function(h,a,c){var d=this&&this.__decorate||function(_,y,v,S){var E,T=arguments.length,A=T<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(_,y,v,S);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,S){y(v,S,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=c(844),g=c(2585),b={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 w,C=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()))),w=this}_updateLogLevel(){this._logLevel=b[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=C=d([p(0,g.IOptionsService)],C),a.setTraceLogger=function(_){w=_},a.traceCall=function(_,y,v){if(typeof v.value!="function")throw new Error("not supported");const S=v.value;v.value=function(...E){if(w.logLevel!==g.LogLevelEnum.TRACE)return S.apply(this,E);w.trace(`GlyphRenderer#${S.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=S.apply(this,E);return w.trace(`GlyphRenderer#${S.name} return`,T),T}}},7302:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=c(8460),p=c(844),f=c(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 b extends p.Disposable{constructor(C){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...a.DEFAULT_OPTIONS};for(const y in C)if(y in _)try{const v=C[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(C,_){return this.onOptionChange((y=>{y===C&&_(this.rawOptions[C])}))}onMultipleOptionChange(C,_){return this.onOptionChange((y=>{C.indexOf(y)!==-1&&_()}))}_setupOptions(){const C=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:C.bind(this,y),set:_.bind(this,y)};Object.defineProperty(this.options,y,v)}}_sanitizeAndValidateOption(C,_){switch(C){case"cursorStyle":if(_||(_=a.DEFAULT_OPTIONS[C]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${C}`);break;case"wordSeparator":_||(_=a.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=g.includes(_)?_:a.DEFAULT_OPTIONS[C];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${C} 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(`${C} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${C} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}a.OptionsService=b},2660:function(h,a,c){var d=this&&this.__decorate||function(b,w,C,_){var y,v=arguments.length,S=v<3?w:_===null?_=Object.getOwnPropertyDescriptor(w,C):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,w,C,_);else for(var E=b.length-1;E>=0;E--)(y=b[E])&&(S=(v<3?y(S):v>3?y(w,C,S):y(w,C))||S);return v>3&&S&&Object.defineProperty(w,C,S),S},p=this&&this.__param||function(b,w){return function(C,_){w(C,_,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=c(2585);let g=a.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const w=this._bufferService.buffer;if(b.id===void 0){const E=w.addMarker(w.ybase+w.y),T={data:b,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const C=b,_=this._getEntryIdKey(C),y=this._entriesWithId.get(_);if(y)return this.addLineToLink(y.id,w.ybase+w.y),y.id;const v=w.addMarker(w.ybase+w.y),S={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(S,v))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(b,w){const C=this._dataByLinkId.get(b);if(C&&C.lines.every((_=>_.line!==w))){const _=this._bufferService.buffer.addMarker(w);C.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(C,_)))}}getLinkData(b){return this._dataByLinkId.get(b)?.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,w){const C=b.lines.indexOf(w);C!==-1&&(b.lines.splice(C,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.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 c="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,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,_,y){_[c]===_?_[d].push({id:C,index:y}):(_[d]=[{id:C,index:y}],_[c]=_)})(f,g,w)};return f.toString=()=>p,a.serviceRegistry.set(p,f),f}},2585:(h,a,c)=>{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=c(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,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=c(8460),p=c(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,C=!1){return(16777215&b)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,C=0;const _=b.length;for(let y=0;y<_;++y){let v=b.charCodeAt(y);if(55296<=v&&v<=56319){if(++y>=_)return w+this.wcwidth(v);const T=b.charCodeAt(y);56320<=T&&T<=57343?v=1024*(v-55296)+T-56320+65536:w+=this.wcwidth(T)}const S=this.charProperties(v,C);let E=f.extractWidth(S);f.extractShouldJoin(S)&&(E-=f.extractWidth(C)),w+=E,C=S}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}a.UnicodeService=f}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var c=s[h]={exports:{}};return n[h].call(c.exports,c,c.exports,o),c.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.Terminal=void 0;const a=o(9042),c=o(3236),d=o(844),p=o(5741),f=o(8285),g=o(7975),b=o(7090),w=["cols","rows"];class C extends d.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],S=(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:S.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(y){if(w.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 b.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,S){this._verifyIntegers(y,v,S),this._core.select(y,v,S)}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=C})(),u})()))})(Sv)),Sv.exports}var bk=cN(),xv={exports:{}},jC;function uN(){return jC||(jC=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),c=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=c-(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})()))})(xv)),xv.exports}var Sk=uN(),Cv={exports:{}},NC;function dN(){return NC||(NC=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={6:(h,a)=>{function c(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,b={}){this._terminal=p,this._regex=f,this._handler=g,this._options=b}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,b)=>{if(this._options.hover){const{range:w}=f;this._options.hover(g,b,w)}},f)))}};class d{static computeLink(f,g,b,w){const C=new RegExp(g.source,(g.flags||"")+"g"),[_,y]=d._getWindowedLineStrings(f-1,b),v=_.join("");let S;const E=[];for(;S=C.exec(v);){const T=S[0];if(!c(T))continue;const[A,M]=d._mapStrIdx(b,y,0,S.index),[L,D]=d._mapStrIdx(b,A,M,T.length);if(A===-1||M===-1||L===-1||D===-1)continue;const U={start:{x:M+1,y:A+1},end:{x:D,y:L+1}};E.push({range:U,text:T,activate:w})}return E}static _getWindowedLineStrings(f,g){let b,w=f,C=f,_=0,y="";const v=[];if(b=g.buffer.active.getLine(f)){const S=b.translateToString(!0);if(b.isWrapped&&S[0]!==" "){for(_=0;(b=g.buffer.active.getLine(--w))&&_<2048&&(y=b.translateToString(!0),_+=y.length,v.push(y),b.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(S),_=0;(b=g.buffer.active.getLine(++C))&&b.isWrapped&&_<2048&&(y=b.translateToString(!0),_+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,w]}static _mapStrIdx(f,g,b,w){const C=f.buffer.active,_=C.getNullCell();let y=b;for(;w;){const v=C.getLine(g);if(!v)return[-1,-1];for(let S=y;S<v.length;++S){v.getCell(S,_);const E=_.getChars();if(_.getWidth()&&(w-=E.length||1,S===v.length-1&&E==="")){const T=C.getLine(g+1);T&&T.isWrapped&&(T.getCell(0,_),_.getWidth()===2&&(w+=1))}if(w<0)return[g,S]}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 c=s[h]={exports:{}};return n[h](c,c.exports,o),c.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.WebLinksAddon=void 0;const a=o(6),c=/(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||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,f))}dispose(){this._linkProvider?.dispose()}}})(),u})()))})(Cv)),Cv.exports}var xk=dN();function fN({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:c}=B0();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 bk.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 Sk.FitAddon,b=new xk.WebLinksAddon;f.loadAddon(g),f.loadAddon(b),f.open(o.current),u.current=f,h.current=g,requestAnimationFrame(()=>{d(),t?.(f),o.current&&s?.(o.current)});const w=()=>c(!0),C=()=>c(!1);f.textarea&&(f.textarea.addEventListener("focus",w),f.textarea.addEventListener("blur",C));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 S=new ResizeObserver(y);S.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),S.disconnect(),E.disconnect(),f.textarea&&(f.textarea.removeEventListener("focus",w),f.textarea.removeEventListener("blur",C)),c(!1),f.dispose(),u.current=null,h.current=null}},[d,t,s,c]);const p=k.useCallback(()=>{u.current?.scrollToBottom()},[]);return x.jsxs("div",{className:"relative h-full w-full",children:[x.jsx("div",{ref:o,className:Be("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),x.jsx("button",{onClick:p,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:x.jsx(Ce,{icon:D2,size:20,strokeWidth:2})})]})}function hN({name:e,status:t,exitCode:n,className:s,onRename:o}){const[u,h]=k.useState(!1),[a,c]=k.useState(e),d=k.useRef(null);k.useEffect(()=>{u&&d.current&&(d.current.focus(),d.current.select())},[u]);const p=()=>{o&&(c(e),h(!0))},f=()=>{const b=a.trim();b&&b!==e&&o&&o(b),h(!1)},g=b=>{b.key==="Enter"?f():b.key==="Escape"&&h(!1)};return x.jsxs("div",{className:Be("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[x.jsx("span",{className:Be("h-2 w-2 shrink-0 rounded-full",{"bg-green-500":t==="running","bg-zinc-500":t==="exited"&&n===0,"bg-red-500":t==="exited"&&n!==0,"bg-yellow-500":t==="error"})}),u?x.jsx("input",{ref:d,type:"text",value:a,onChange:b=>c(b.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"}):x.jsx("span",{className:Be("font-medium text-foreground",o&&"cursor-pointer hover:text-primary"),onDoubleClick:p,title:o?"Double-click to rename":void 0,children:e}),t==="exited"&&n!==void 0&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),x.jsxs("span",{className:Be({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}const pN="";function Ck(){return Nn({mutationFn:async e=>{const t=await fetch(`${pN}/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 mN="";function wk(){return Nn({mutationFn:async e=>{const t=await fetch(`${mN}/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 gN="";function Ek(){return Nn({mutationFn:async e=>{const t=await fetch(`${gN}/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 vN({repoPath:e,worktreePath:t,baseBranch:n,taskId:s}){const o=Ck(),u=wk(),h=Ek(),a=D0(),c=async()=>{try{await o.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Mr.success("Synced from main")}catch(f){const g=f instanceof Error?f.message:"Sync failed";Mr.error(g)}},d=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Mr.success("Merged to main"),a.mutate({taskId:s,updates:{status:"DONE"}})}catch(f){const g=f instanceof Error?f.message:"Merge failed";Mr.error(g)}},p=async()=>{try{await h.mutateAsync({repoPath:e,baseBranch:n}),Mr.success("Parent synced with origin")}catch(f){const g=f instanceof Error?f.message:"Sync parent failed";Mr.error(g)}};return x.jsxs(x.Fragment,{children:[x.jsx(ze,{variant:"ghost",size:"icon-xs",onClick:c,disabled:o.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:x.jsx(Ce,{icon:M2,size:12,strokeWidth:2,className:o.isPending?"animate-spin":""})}),x.jsx(ze,{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:x.jsx(Ce,{icon:j2,size:12,strokeWidth:2,className:u.isPending?"animate-pulse":""})}),x.jsx(ze,{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:x.jsx(Ce,{icon:V2,size:12,strokeWidth:2,className:h.isPending?"animate-spin":""})})]})}function _N({terminal:e,taskInfo:t,onClose:n,onReady:s,onResize:o,onRename:u,onContainerReady:h}){return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:[t?x.jsxs("div",{className:"flex flex-1 items-center gap-2 px-2 py-1",children:[x.jsxs(Wn,{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:[x.jsx(Ce,{icon:Z_,size:14,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{className:"truncate",children:t.title})]}),x.jsx(Wn,{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&&x.jsx("span",{className:"text-xs text-muted-foreground truncate",children:e.cwd.split("/").pop()}),x.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:x.jsx(vN,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId})})]}):x.jsx(hN,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:u}),n&&x.jsx(ze,{variant:"ghost",size:"icon-xs",onClick:n,className:"mr-1 h-5 w-5 text-muted-foreground hover:text-foreground",children:x.jsx(Ce,{icon:go,size:12,strokeWidth:2})})]}),x.jsx("div",{className:"flex-1",children:x.jsx(fN,{onReady:s,onResize:o,onContainerReady:h})})]})}function yN({onAdd:e}){return x.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?x.jsxs(ze,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[x.jsx(Ce,{icon:ec,size:14,strokeWidth:2}),"New Terminal"]}):x.jsx("p",{className:"text-xs text-muted-foreground",children:"No terminals"})})}function bN(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 SN({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,taskInfoByCwd:a}){if(e.length===0)return x.jsx(yN,{onAdd:n});const{rows:c,cols:d}=bN(e.length),p=[];for(let g=0;g<c;g++){const b=g*d,w=Math.min(b+d,e.length);b<e.length&&p.push(e.slice(b,w))}const f=g=>x.jsx(_N,{terminal:g,taskInfo:g.cwd?a?.get(g.cwd):void 0,onClose:t?()=>t(g.id):void 0,onReady:s?b=>s(g.id,b):void 0,onResize:o?(b,w)=>o(g.id,b,w):void 0,onRename:u?b=>u(g.id,b):void 0,onContainerReady:h?b=>h(g.id,b):void 0});return e.length===1?x.jsx("div",{className:"h-full",children:f(e[0])}):e.length===2?x.jsxs(Qo,{direction:"horizontal",className:"h-full",children:[x.jsx(Qr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),x.jsx(Zo,{}),x.jsx(Qr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id)]}):e.length===3?x.jsxs(Qo,{direction:"horizontal",className:"h-full",children:[x.jsx(Qr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),x.jsx(Zo,{}),x.jsx(Qr,{defaultSize:50,minSize:15,children:x.jsxs(Qo,{direction:"vertical",className:"h-full",children:[x.jsx(Qr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id),x.jsx(Zo,{}),x.jsx(Qr,{defaultSize:50,minSize:15,children:f(e[2])},e[2].id)]})})]}):x.jsx(Qo,{direction:"vertical",className:"h-full",children:p.map((g,b)=>x.jsxs(k.Fragment,{children:[b>0&&x.jsx(Zo,{}),x.jsx(Qr,{defaultSize:100/p.length,minSize:15,children:g.length===1?f(g[0]):x.jsx(Qo,{direction:"horizontal",className:"h-full",children:g.map((w,C)=>x.jsxs(k.Fragment,{children:[C>0&&x.jsx(Zo,{}),x.jsx(Qr,{defaultSize:100/d,minSize:15,children:f(w)})]},w.id))})})]},`row-${b}`))})}function xN({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:s,onTabCreate:o,onTabRename:u}){const[h,a]=k.useState(null),[c,d]=k.useState(""),p=k.useRef(null);k.useEffect(()=>{h&&p.current&&(p.current.focus(),p.current.select())},[h]);const f=w=>{a(w.id),d(w.name)},g=()=>{h&&c.trim()&&u(h,c.trim()),a(null)},b=w=>{w.key==="Enter"?g():w.key==="Escape"&&a(null)};return x.jsxs("div",{className:"flex items-center gap-1",children:[e.map(w=>x.jsx("button",{onClick:()=>n(w.id),onDoubleClick:()=>f(w),className:Be("group relative flex items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs transition-colors",w.id===t?"border-border bg-background text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:h===w.id?x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(qt,{ref:p,value:c,onChange:C=>d(C.target.value),onBlur:g,onKeyDown:b,className:"h-5 w-20 px-1 text-xs"}),x.jsx(ze,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:x.jsx(Ce,{icon:n4,size:12,strokeWidth:2})})]}):x.jsxs(x.Fragment,{children:[w.name,e.length>1&&x.jsx("button",{onClick:C=>{C.stopPropagation(),s(w.id)},className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:x.jsx(Ce,{icon:go,size:12,strokeWidth:2})})]})},w.id)),x.jsx(ze,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:x.jsx(Ce,{icon:ec,size:14,strokeWidth:2})})]})}async function CN(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 wN(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function W0(e={}){const{url:t=wN(),reconnectInterval:n=2e3,maxReconnectAttempts:s=10}=e,[o,u]=k.useState([]),[h,a]=k.useState(!1),[c,d]=k.useState([]),[p,f]=k.useState(!1),g=k.useRef(null),b=k.useRef(0),w=k.useRef(void 0),C=k.useRef(new Map),_=k.useRef(new Set),y=k.useRef(()=>{}),v=k.useCallback(q=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(q))},[]),S=k.useCallback(q=>{try{const H=JSON.parse(q.data);switch(H.type){case"terminals:list":u(H.payload.terminals),a(!0);break;case"terminal:created":u(P=>[...P,H.payload.terminal]),H.payload.isNew&&_.current.add(H.payload.terminal.id);break;case"terminal:output":{const P=C.current.get(H.payload.terminalId);P&&P.write(H.payload.data);break}case"terminal:attached":{const P=C.current.get(H.payload.terminalId);P&&H.payload.buffer&&P.write(H.payload.buffer);break}case"terminal:exit":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,status:"exited",exitCode:H.payload.exitCode}:B));break;case"terminal:error":console.error("Terminal error:",H.payload.error);break;case"terminal:renamed":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,name:H.payload.name}:B));break;case"terminal:destroyed":C.current.delete(H.payload.terminalId),u(P=>P.filter(B=>B.id!==H.payload.terminalId));break;case"terminal:tabAssigned":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,tabId:H.payload.tabId??void 0,positionInTab:H.payload.positionInTab}:B));break;case"tabs:list":d(H.payload.tabs);break;case"tab:created":d(P=>[...P,H.payload.tab].sort((B,I)=>B.position-I.position));break;case"tab:renamed":d(P=>P.map(B=>B.id===H.payload.tabId?{...B,name:H.payload.name}:B));break;case"tab:deleted":d(P=>P.filter(B=>B.id!==H.payload.tabId));break;case"tab:reordered":d(P=>P.map(B=>B.id===H.payload.tabId?{...B,position:H.payload.position}:B).sort((B,I)=>B.position-I.position));break}}catch(H){console.error("Failed to parse WebSocket message:",H)}},[]),E=k.useCallback(()=>{const q=g.current;if(q&&(q.readyState===WebSocket.CONNECTING||q.readyState===WebSocket.OPEN))return;const H=new WebSocket(t);g.current=H,H.onopen=()=>{f(!0),b.current=0},H.onmessage=S,H.onclose=()=>{f(!1),a(!1),g.current===H&&(g.current=null),b.current<s&&(b.current++,w.current=setTimeout(()=>y.current(),n))},H.onerror=()=>{}},[t,n,s,S]);y.current=E,k.useEffect(()=>(E(),()=>{w.current&&clearTimeout(w.current),g.current&&(g.current.close(),g.current=null)}),[E]);const T=k.useCallback(q=>{v({type:"terminal:create",payload:q})},[v]),A=k.useCallback(q=>{v({type:"terminal:destroy",payload:{terminalId:q}}),C.current.delete(q),u(H=>H.filter(P=>P.id!==q))},[v]),M=k.useCallback((q,H)=>{v({type:"terminal:input",payload:{terminalId:q,data:H}})},[v]),L=k.useCallback((q,H,P)=>{v({type:"terminal:resize",payload:{terminalId:q,cols:H,rows:P}})},[v]),D=k.useCallback((q,H)=>{v({type:"terminal:rename",payload:{terminalId:q,name:H}})},[v]),U=k.useCallback((q,H,P)=>{v({type:"terminal:assignTab",payload:{terminalId:q,tabId:H,positionInTab:P}})},[v]),z=k.useCallback((q,H)=>{v({type:"tab:create",payload:{name:q,position:H}})},[v]),W=k.useCallback((q,H)=>{v({type:"tab:rename",payload:{tabId:q,name:H}})},[v]),j=k.useCallback(q=>{v({type:"tab:delete",payload:{tabId:q}})},[v]),Y=k.useCallback((q,H)=>{v({type:"tab:reorder",payload:{tabId:q,position:H}})},[v]),$=k.useCallback((q,H)=>{C.current.set(q,H);const P=H.onData(B=>{M(q,B)});return v({type:"terminal:attach",payload:{terminalId:q}}),()=>{P.dispose(),C.current.delete(q)}},[v,M]),V=k.useCallback((q,H)=>{const P=async B=>{const I=B.clipboardData?.items;if(I){for(const G of I)if(G.type.startsWith("image/")){B.preventDefault(),B.stopPropagation();const K=G.getAsFile();if(!K)return;try{const J=await CN(K);M(H,J)}catch(J){console.error("Failed to upload image:",J)}return}}};return q.addEventListener("paste",P,!0),()=>{q.removeEventListener("paste",P,!0)}},[M]);return{terminals:o,terminalsLoaded:h,tabs:c,connected:p,newTerminalIds:_.current,createTerminal:T,destroyTerminal:A,writeToTerminal:M,resizeTerminal:L,renameTerminal:D,assignTerminalToTab:U,createTab:z,renameTab:W,deleteTab:j,reorderTab:Y,attachXterm:$,setupImagePaste:V}}const Ts="all-tasks",BC=["IN_PROGRESS","IN_REVIEW"],EN=vs("/terminals/")({component:RN});function RN(){const{terminals:e,tabs:t,connected:n,createTerminal:s,destroyTerminal:o,renameTerminal:u,assignTerminalToTab:h,createTab:a,renameTab:c,deleteTab:d,attachXterm:p,resizeTerminal:f,setupImagePaste:g}=W0(),{activeTabId:b,setActiveTab:w,isLoading:C}=tk();k.useEffect(()=>{if(t.length>0&&!C){const Z=t.map(ee=>ee.id);(!b||!Z.includes(b)&&b!==Ts)&&w(t[0].id)}},[t,b,C,w]);const{data:_=[]}=M0(),{data:y=[]}=j0(),{data:v}=P0(),[S,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=>BC.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=>BC.includes(ee.status)).map(ee=>ee.repoName));return Array.from(Z).sort()},[_]),U=k.useRef(new Map),z=k.useRef(new Map),W=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 Y=k.useMemo(()=>b===Ts?e.filter(Z=>Z.cwd&&A.has(Z.cwd)).filter(Z=>S?_.find(X=>X.worktreePath===Z.cwd)?.repoName===S:!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===b).sort((Z,ee)=>(Z.positionInTab??0)-(ee.positionInTab??0)),[b,e,A,S,_]),$=k.useCallback(()=>{j.current++;const ee=e.filter(X=>X.tabId===b).length;s({name:`Terminal ${j.current}`,cols:80,rows:24,tabId:b??void 0,positionInTab:ee})},[s,b,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=W.current.get(Z);if(!ee||z.current.has(Z))return;const X=g(ee,Z);z.current.set(Z,X)},[g]),q=k.useCallback(Z=>{const ee=U.current.get(Z);ee&&(ee(),U.current.delete(Z));const X=z.current.get(Z);X&&(X(),z.current.delete(Z)),W.current.delete(Z),o(Z)},[o]),H=k.useCallback((Z,ee)=>{const X=p(Z,ee);U.current.set(Z,X)},[p]),P=k.useCallback((Z,ee)=>{W.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]),G=k.useCallback(()=>{const Z=t.length;a(`Tab ${Z+1}`)},[a,t.length]),K=k.useCallback(Z=>{const ee=e.filter(X=>X.tabId===Z);for(const X of ee)q(X.id);d(Z)},[e,d,q]),J=t.map((Z,ee)=>({id:Z.id,name:Z.name,layout:"single",position:ee}));return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-2 py-1",children:[x.jsx(xN,{tabs:J,activeTabId:b??"",onTabSelect:w,onTabClose:K,onTabCreate:G,onTabRename:c}),x.jsxs("div",{className:"flex items-center gap-3",children:[b===Ts&&D.length>1&&x.jsxs(Ml,{value:S??"",onValueChange:Z=>E(Z||null),children:[x.jsxs(Pl,{size:"sm",className:"min-w-[120px]",children:[x.jsx(Ce,{icon:B2,size:12,strokeWidth:2,className:"text-muted-foreground"}),x.jsx(Dl,{children:S||"All Repos"})]}),x.jsxs(Il,{className:"min-w-[200px]",children:[x.jsx(hr,{value:"",children:"All Repos"}),D.map(Z=>x.jsx(hr,{value:Z,children:Z},Z))]})]}),x.jsxs("button",{onClick:()=>w(Ts),className:Be("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",b===Ts?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[x.jsx(Ce,{icon:Lh,size:12,strokeWidth:2}),"Task Terminals"]}),x.jsxs(ze,{variant:"outline",size:"sm",onClick:$,disabled:!n||e.length>=12||b===Ts,children:[x.jsx(Ce,{icon:ec,size:14,strokeWidth:2,"data-slot":"icon"}),"New Terminal"]})]})]}),x.jsx("div",{className:"pixel-grid flex-1 overflow-hidden",children:x.jsx(SN,{terminals:Y,onTerminalClose:b===Ts?void 0:q,onTerminalAdd:n&&b!==Ts?$:void 0,onTerminalReady:H,onTerminalResize:B,onTerminalRename:b===Ts?void 0:I,onTerminalContainerReady:P,taskInfoByCwd:b===Ts?L:void 0})})]})}function kN(e){if(Array.isArray(e))return e}function TN(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,o,u,h,a=[],c=!0,d=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(c=(s=u.call(n)).done)&&(a.push(s.value),a.length!==t);c=!0);}catch(p){d=!0,o=p}finally{try{if(!c&&n.return!=null&&(h=n.return(),Object(h)!==h))return}finally{if(d)throw o}}return a}}function h_(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 Rk(e,t){if(e){if(typeof e=="string")return h_(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)?h_(e,t):void 0}}function LN(){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 kk(e,t){return kN(e)||TN(e,t)||Rk(e,t)||LN()}var wv={},hu={},zC;function Tk(){if(zC)return hu;zC=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.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 hu.bind=e,hu}var $o={},HC;function AN(){if(HC)return $o;HC=1;var e=$o&&$o.__assign||function(){return e=Object.assign||function(u){for(var h,a=1,c=arguments.length;a<c;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($o,"__esModule",{value:!0}),$o.bindAll=void 0;var t=Tk();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 c=h.map(function(d){var p=s(d,a);return(0,t.bind)(u,p)});return function(){c.forEach(function(p){return p()})}}return $o.bindAll=o,$o}var VC;function ON(){return VC||(VC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=Tk();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=AN();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(wv)),wv}var $l=ON(),Lk="data-pdnd-honey-pot";function Ak(e){return e instanceof Element&&e.hasAttribute(Lk)}function Ok(e){var t=document.elementsFromPoint(e.x,e.y),n=kk(t,2),s=n[0],o=n[1];return s?Ak(s)?o??null:s:null}function Bu(e){"@babel/helpers - typeof";return Bu=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},Bu(e)}function MN(e,t){if(Bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Bu(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DN(e){var t=MN(e,"string");return Bu(t)=="symbol"?t:t+""}function hd(e,t,n){return(t=DN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mk=2147483647;function FC(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 UC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FC(Object(n),!0).forEach(function(s){hd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var zu=2,WC=zu/2;function PN(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function IN(e){return{x:e.x-WC,y:e.y-WC}}function jN(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function NN(e){return{x:Math.min(e.x,window.innerWidth-zu),y:Math.min(e.y,window.innerHeight-zu)}}function qC(e){var t=e.client,n=NN(jN(IN(PN(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:zu,height:zu})}function GC(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 BN(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 zN(e){var t=e.initial,n=document.createElement("div");n.setAttribute(Lk,"true");var s=qC({client:t});Object.assign(n.style,UC(UC({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},GC({clientRect:s})),{},{pointerEvents:"auto",zIndex:Mk})),document.body.appendChild(n);var o=$l.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=qC({client:a}),Object.assign(n.style,GC({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),BN({client:a,clientRect:s})){n.remove();return}function c(){d(),n.remove()}var d=$l.bindAll(window,[{type:"pointerdown",listener:c},{type:"pointermove",listener:c},{type:"focusin",listener:c},{type:"focusout",listener:c},{type:"dragstart",listener:c},{type:"dragenter",listener:c},{type:"dragover",listener:c}],{capture:!0})}}function HN(){var e=null;function t(){return e=null,$l.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 c=a.location.initial.input,d=e??{x:c.clientX,y:c.clientY};s=zN({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 VN(e){if(Array.isArray(e))return h_(e)}function FN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UN(){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 Dk(e){return VN(e)||FN(e)||Rk(e)||UN()}function Na(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 WN=Na(function(){return navigator.userAgent.includes("Firefox")}),pd=Na(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),p_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function qN(e){var t=e.dragLeave;return pd()?t.hasOwnProperty(p_.isLeavingWindow):!1}(function(){if(typeof window>"u"||!pd())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function s(){n=t()}$l.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[p_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[p_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function GN(e){return"nodeName"in e}function $N(e){return GN(e)&&e.ownerDocument!==document}function KN(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:pd()?qN({dragLeave:t}):s==null?!0:WN()?$N(s):s instanceof HTMLIFrameElement}function YN(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 Eu(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 XN=function(t){var n=[],s=null,o=function(){for(var h=arguments.length,a=new Array(h),c=0;c<h;c++)a[c]=arguments[c];n=a,!s&&(s=requestAnimationFrame(function(){s=null,t.apply(void 0,n)}))};return o.cancel=function(){s&&(cancelAnimationFrame(s),s=null)},o},Ev=XN(function(e){return e()}),nh=(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 QN(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(c){var d=c.nativeSetDragImage,p={current:n,previous:o,initial:n};u({eventName:"onGenerateDragPreview",payload:{source:t,location:p,nativeSetDragImage:d}}),nh.schedule(function(){u({eventName:"onDragStart",payload:{source:t,location:p}})})},dragUpdate:function(c){var d=c.current;nh.flush(),Ev.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(c){var d=c.current;Ev(function(){nh.flush();var p={initial:n,previous:o,current:d};u({eventName:"onDrag",payload:{source:t,location:p}})})},drop:function(c){var d=c.current,p=c.updatedSourcePayload;nh.flush(),Ev.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var m_={isActive:!1};function Pk(){return!m_.isActive}function ZN(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function JN(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 e7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!Pk())return;var u=t7({event:t,dragType:n,getDropTargetsOver:s});m_.isActive=!0;var h={current:u};Rv({event:t,current:u.dropTargets});var a=QN({source:n.payload,dispatchEvent:o,initial:u});function c(b){var w=JN({current:h.current.dropTargets,next:b.dropTargets});h.current=b,w&&a.dragUpdate({current:h.current})}function d(b){var w=Eu(b),C=Ak(b.target)?Ok({x:w.clientX,y:w.clientY}):b.target,_=s({target:C,input:w,source:n.payload,current:h.current.dropTargets});_.length&&(b.preventDefault(),Rv({event:b,current:_})),c({dropTargets:_,input:w})}function p(){h.current.dropTargets.length&&c({dropTargets:[],input:h.current.input}),a.drop({current:h.current,updatedSourcePayload:null}),f()}function f(){m_.isActive=!1,g()}var g=$l.bindAll(window,[{type:"dragover",listener:function(w){d(w),a.drag({current:h.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(w){KN({dragLeave:w})&&(c({input:h.current.input,dropTargets:[]}),n.startedFrom==="external"&&p())}},{type:"drop",listener:function(w){if(h.current={dropTargets:h.current.dropTargets,input:Eu(w)},!h.current.dropTargets.length){p();return}w.preventDefault(),Rv({event:w,current:h.current.dropTargets}),a.drop({current:h.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(w):null}),f()}},{type:"dragend",listener:function(w){h.current={dropTargets:h.current.dropTargets,input:Eu(w)},p()}}].concat(Dk(YN({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:ZN(t)})}function Rv(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 t7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=Eu(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 $C={canStart:Pk,start:e7},g_=new Map;function n7(e){var t=e.typeKey,n=e.mount,s=g_.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return g_.set(t,o),o}function r7(e){var t=n7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),g_.delete(e.typeKey))}}function Lp(){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 Ik(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function KC(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?KC(Object(n),!0).forEach(function(s){hd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function kv(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s7(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 s7(e,t){if(e){if(typeof e=="string")return YC(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)?YC(e,t):void 0}}function YC(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 Tv(e){return e.slice(0).reverse()}function i7(e){var t=e.typeKey,n=e.defaultDropEffect,s=new WeakMap,o="data-drop-target-for-".concat(t),u="[".concat(o,"]");function h(b){return s.set(b.element,b),function(){return s.delete(b.element)}}function a(b){var w=Lp(Ik(b.element,{attribute:o,value:"true"}),h(b));return Na(w)}function c(b){var w,C,_,y,v=b.source,S=b.target,E=b.input,T=b.result,A=T===void 0?[]:T;if(S==null)return A;if(!(S instanceof Element))return S instanceof Node?c({source:v,target:S.parentElement,input:E,result:A}):A;var M=S.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 c({source:v,target:L.element.parentElement,input:E,result:A});var U=(w=(C=L.getData)===null||C===void 0?void 0:C.call(L,D))!==null&&w!==void 0?w:{},z=(_=(y=L.getDropEffect)===null||y===void 0?void 0:y.call(L,D))!==null&&_!==void 0?_:n,W={data:U,element:L.element,dropEffect:z,isActiveDueToStickiness:!1};return c({source:v,target:L.element.parentElement,input:E,result:[].concat(Dk(A),[W])})}function d(b){var w=b.eventName,C=b.payload,_=kv(C.location.current.dropTargets),y;try{for(_.s();!(y=_.n()).done;){var v,S=y.value,E=s.get(S.element),T=Ji(Ji({},C),{},{self:S});E==null||(v=E[w])===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(w){var C=w.payload,_=new Set(C.location.current.dropTargets.map(function(q){return q.element})),y=new Set,v=kv(C.location.previous.dropTargets),S;try{for(v.s();!(S=v.n()).done;){var E,T=S.value;y.add(T.element);var A=s.get(T.element),M=_.has(T.element),L=Ji(Ji({},C),{},{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(q){v.e(q)}finally{v.f()}var U=kv(C.location.current.dropTargets),z;try{for(U.s();!(z=U.n()).done;){var W,j,Y=z.value;if(!y.has(Y.element)){var $=Ji(Ji({},C),{},{self:Y}),V=s.get(Y.element);V==null||(W=V.onDropTargetChange)===null||W===void 0||W.call(V,$),V==null||(j=V.onDragEnter)===null||j===void 0||j.call(V,$)}}}catch(q){U.e(q)}finally{U.f()}}};function f(b){p[b.eventName](b)}function g(b){var w=b.source,C=b.target,_=b.input,y=b.current,v=c({source:w,target:C,input:_});if(v.length>=y.length)return v;for(var S=Tv(y),E=Tv(v),T=[],A=0;A<S.length;A++){var M,L=S[A],D=E[A];if(D!=null){T.push(D);continue}var U=T[A-1],z=S[A-1];if(U?.element!==z?.element)break;var W=s.get(L.element);if(!W)break;var j={input:_,source:w,element:W.element};if(W.canDrop&&!W.canDrop(j)||!((M=W.getIsSticky)!==null&&M!==void 0&&M.call(W,j)))break;T.push(Ji(Ji({},L),{},{isActiveDueToStickiness:!0}))}return Tv(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function o7(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a7(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 a7(e,t){if(e){if(typeof e=="string")return XC(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)?XC(e,t):void 0}}function XC(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 QC(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 l7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QC(Object(n),!0).forEach(function(s){hd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function c7(){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=l7({},u);e.add(h),n(h);function a(){e.delete(h),t&&t.active.delete(h)}return Na(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 c=o7(e),d;try{for(c.s();!(d=c.n()).done;){var p=d.value;n(p)}}catch(_){c.e(_)}finally{c.f()}}if(t){for(var f=Array.from(t.active),g=0,b=f;g<b.length;g++){var w=b[g];if(t.active.has(w)){var C;(C=w[h])===null||C===void 0||C.call(w,a)}}h==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:o,monitorForConsumers:s}}function u7(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=c7(),a=i7({typeKey:t,defaultDropEffect:u});function c(f){s?.(f),a.dispatchEvent(f),h.dispatchEvent(f),o?.(f)}function d(f){var g=f.event,b=f.dragType;$C.start({event:g,dragType:b,getDropTargetsOver:a.getIsOver,dispatchEvent:c})}function p(){function f(){var g={canStart:$C.canStart,start:d};return n(g)}return r7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var jk=Na(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),d7="pdnd:android-fallback",ZC="text/plain",f7="text/uri-list",h7="application/vnd.pdnd",Wh=new WeakMap;function p7(e){return Wh.set(e.element,e),function(){Wh.delete(e.element)}}var JC=HN(),q0=u7({typeKey:"element",defaultDropEffect:"move",mount:function(t){return Lp(JC.bindEvents(),$l.bind(document,{type:"dragstart",listener:function(s){var o,u,h,a,c,d;if(t.canStart(s)&&!s.defaultPrevented&&s.dataTransfer){var p=s.target;if(p instanceof HTMLElement){var f=Wh.get(p);if(f){var g=Eu(s),b={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:g};if(f.canDrag&&!f.canDrag(b)){s.preventDefault();return}if(f.dragHandle){var w=Ok({x:g.clientX,y:g.clientY});if(!f.dragHandle.contains(w)){s.preventDefault();return}}var C=(u=(h=f.getInitialDataForExternal)===null||h===void 0?void 0:h.call(f,b))!==null&&u!==void 0?u:null;if(C)for(var _=0,y=Object.entries(C);_<y.length;_++){var v=kk(y[_],2),S=v[0],E=v[1];s.dataTransfer.setData(S,E??"")}jk()&&!s.dataTransfer.types.includes(ZC)&&!s.dataTransfer.types.includes(f7)&&s.dataTransfer.setData(ZC,d7),s.dataTransfer.setData(h7,"");var T={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,data:(c=(d=f.getInitialData)===null||d===void 0?void 0:d.call(f,b))!==null&&c!==void 0?c:{}},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=Wh.get(u.source.element))===null||n===void 0||(s=n[o])===null||s===void 0||s.call(n,u)},onPostDispatch:JC.getOnPostDispatch()}),G0=q0.dropTarget,Nk=q0.monitor;function m7(e){var t=Lp(q0.registerUsage(),p7(e),Ik(e.element,{attribute:"draggable",value:"true"}));return Na(t)}function ew(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 tw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ew(Object(n),!0).forEach(function(s){hd(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ew(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var g7={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)}},Bk=Symbol("closestEdge");function v7(e,t){var n,s,o=t.element,u=t.input,h=t.allowedEdges,a={x:u.clientX,y:u.clientY},c=o.getBoundingClientRect(),d=h.map(function(f){return{edge:f,value:g7[f](c,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 tw(tw({},e),{},hd({},Bk,p))}function v_(e){var t;return(t=e[Bk])!==null&&t!==void 0?t:null}function _7(){return{x:0,y:0}}function y7(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?_7:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:Mk,pointerEvents:"none"}),document.body.append(u);var h=t({container:u});queueMicrotask(function(){var d=o({container:u});if(pd()){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(){c(),h?.(),document.body.removeChild(u)}var c=Nk({onDragStart:a,onDrop:a})}var b7=Na(function(){return pd()&&"ontouchend"in document}),S7=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function x7(e){return function(n){var s=n.container;if(b7()||jk())return S7({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 zk=k.forwardRef(({className:e,...t},n)=>x.jsx(KP,{ref:n,className:Be("peer size-4 shrink-0 rounded border border-input ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-checked:bg-primary data-checked:border-primary data-checked:text-primary-foreground","flex items-center justify-center transition-colors",e),...t,children:x.jsx(YP,{className:"flex items-center justify-center",children:x.jsx(Ce,{icon:ka,size:12,strokeWidth:3})})}));zk.displayName="Checkbox";const Hk=k.createContext(null);function C7({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)},[]),c=k.useCallback(()=>{n(!1),o(new Set)},[]),d=k.useCallback(p=>s.has(p),[s]);return x.jsx(Hk.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:c,selectedCount:s.size},children:e})}function Vk(){const e=k.useContext(Hk);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const Fk=k.createContext(null);function w7({children:e}){const[t,n]=k.useState(null);return x.jsx(Fk.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function Uk(){const e=k.useContext(Fk);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function E7(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function Wk({task:e,open:t,onOpenChange:n}){const s=D0(),[o,u]=k.useState(e.title),[h,a]=k.useState(e.description||""),[c,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 w={},C=o.trim();if(!C)return;C!==e.title&&(w.title=C);const _=h.trim();_!==(e.description||"")&&(w.description=_);const y=c.trim();y!==(e.prUrl||"")&&(w.prUrl=y||null);const v=p.trim();v!==(e.linearTicketUrl||"")&&(w.linearTicketUrl=v||null,w.linearTicketId=v?E7(v):null),Object.keys(w).length>0&&s.mutate({taskId:e.id,updates:w}),n(!1)},b=w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return x.jsx(Ms,{open:t,onOpenChange:n,children:x.jsxs(Ds,{className:"sm:max-w-md",onKeyDown:b,children:[x.jsx(vi,{children:x.jsx(_i,{children:"Task Settings"})}),x.jsxs(Cp,{className:"mt-4",children:[x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"config-title",children:"Title"}),x.jsx(qt,{id:"config-title",value:o,onChange:w=>u(w.target.value),autoFocus:!0})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"config-description",children:"Description"}),x.jsx(xp,{id:"config-description",value:h,onChange:w=>a(w.target.value),rows:3})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),x.jsx(qt,{id:"config-pr-url",value:c,onChange:w=>d(w.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),x.jsx(qt,{id:"config-linear-url",value:p,onChange:w=>f(w.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]})]}),x.jsxs(pa,{className:"mt-4",children:[x.jsx(ze,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),x.jsx(ze,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function qk({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=Vk(),{setActiveTask:u}=Uk(),h=s(e.id),a=vo(),c=k.useRef(null),[d,p]=k.useState(!1),[f,g]=k.useState(null),[b,w]=k.useState(null),[C,_]=k.useState(!1),y=k.useRef(!1);k.useEffect(()=>{const T=c.current;if(!(!T||n||t))return Lp(m7({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{y7({nativeSetDragImage:A,getOffset:x7({x:"16px",y:"8px"}),render:({container:M})=>{w(M)}})},onDragStart:()=>{p(!0),u(e),y.current=!0},onDrop:()=>{p(!1),u(null),w(null)}}),G0({element:T,getData:({input:A,element:M})=>{const L={type:"task",taskId:e.id,status:e.status};return v7(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(v_(A.data))},onDrag:({self:A})=>{g(v_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const v=()=>{y.current=!1},S=T=>{if(n){T.preventDefault(),o(e.id);return}y.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),y.current=!1},E=x.jsxs(lc,{ref:t?void 0:c,onPointerDown:v,onClick:S,className:Be("transition-shadow hover:shadow-md relative",n?"cursor-pointer":"cursor-grab active:cursor-grabbing",d&&"opacity-50",h&&"ring-2 ring-primary"),children:[f&&x.jsx("div",{className:Be("absolute left-0 right-0 h-0.5 bg-primary z-10",f==="top"&&"-top-1",f==="bottom"&&"-bottom-1")}),n&&x.jsx("div",{className:"absolute right-2 top-2 z-10 cursor-pointer",onClick:T=>{T.stopPropagation(),o(e.id)},children:x.jsx(zk,{checked:h,className:"cursor-pointer pointer-events-none"})}),x.jsxs(Sj,{className:Be("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[x.jsx(xj,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!n&&!t&&x.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:x.jsx(Ce,{icon:U2,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),x.jsxs(cc,{className:"p-3 pt-1",children:[e.description&&x.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),x.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[x.jsx(Ce,{icon:_s,size:12,strokeWidth:2}),x.jsx("span",{children:e.repoName}),e.prUrl&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-muted-foreground/30",children:"•"}),x.jsx(Ce,{icon:Q_,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-muted-foreground/30",children:"•"}),x.jsx(Ce,{icon:Z_,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]});return x.jsxs(x.Fragment,{children:[E,b&&Jn.createPortal(x.jsx("div",{className:"w-72",children:x.jsx(qk,{task:e,isDragPreview:!0})}),b),x.jsx(Wk,{task:e,open:C,onOpenChange:_})]})}const R7={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},k7={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function nw({status:e,tasks:t,isMobile:n}){const s=k.useRef(null),[o,u]=k.useState(!1),h=[...t].sort((a,c)=>a.position-c.position);return k.useEffect(()=>{const a=s.current;if(a)return G0({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:c})=>c.data.type==="task",onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:()=>u(!1)})},[e]),x.jsxs("div",{ref:s,className:Be("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 flex-shrink-0",k7[e],o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[x.jsx("h3",{className:"text-sm font-medium",children:R7[e]}),x.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})]}),x.jsx(sd,{className:"flex-1",children:x.jsx("div",{className:"flex flex-col gap-2 p-2",children:h.map(a=>x.jsx(qk,{task:a},a.id))})})]})}const Lv=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],Gk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function T7({status:e}){const t=k.useRef(null),[n,s]=k.useState(!1);return k.useEffect(()=>{const o=t.current;if(o)return G0({element:o,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),x.jsx("div",{ref:t,className:Be("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",n?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:Gk[e]})}function L7({repoFilter:e}){const{data:t=[],isLoading:n}=M0(),s=J9(),{activeTask:o}=Uk(),[u,h]=k.useState("IN_PROGRESS"),a=k.useMemo(()=>e?t.filter(d=>d.repoName===e):t,[t,e]),c=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(()=>Nk({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,b=a.find(_=>_.id===g);if(!b)return;const w=f[0],C=w.data;if(C.type==="column"){const _=C.status;if(_!==b.status){const y=a.filter(v=>v.status===_);s.mutate({taskId:g,status:_,position:y.length})}}else if(C.type==="task"){const _=v_(w.data),y=C.status,v=a.filter(T=>T.status===y).sort((T,A)=>T.position-A.position),S=v.findIndex(T=>T.id===C.taskId);let E=S;_==="bottom"&&(E=S+1),b.status===y&&v.findIndex(A=>A.id===g)<S&&(E=Math.max(0,E-1)),(b.status!==y||E!==b.position)&&s.mutate({taskId:g,status:y,position:E})}}}),[a,s]),n?x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("div",{className:"border-b lg:hidden",children:x.jsx(wp,{value:u,onValueChange:d=>h(d),children:x.jsx(Ep,{variant:"line",className:"w-full justify-start px-4",children:Lv.map(d=>x.jsxs(po,{value:d,className:"gap-1.5",children:[x.jsx("span",{className:"truncate",children:Gk[d]}),x.jsx("span",{className:"text-muted-foreground",children:c[d]})]},d))})})}),x.jsx("div",{className:"pixel-grid hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:Lv.map(d=>x.jsx(nw,{status:d,tasks:a.filter(p=>p.status===d)},d))}),x.jsx("div",{className:"pixel-grid flex-1 overflow-y-auto p-4 lg:hidden",children:x.jsx(nw,{status:u,tasks:a.filter(d=>d.status===u),isMobile:!0})}),o&&x.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:Lv.filter(d=>d!==u).map(d=>x.jsx(T7,{status:d},d))})]})}function A7(e){return x.jsx(w7,{children:x.jsx(L7,{...e})})}const O7=vs("/tasks/")({component:M7});function M7(){return x.jsx(C7,{children:x.jsx(D7,{})})}function D7(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=Vk(),u=tI(),{data:h=[]}=M0(),[a,c]=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 x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:e?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-sm font-medium",children:s>0?`${s} selected`:"Select tasks"}),x.jsxs(ze,{variant:"ghost",size:"sm",onClick:o,children:[x.jsx(Ce,{icon:go,size:14,strokeWidth:2,"data-slot":"icon"}),"Cancel"]})]}),x.jsxs(id,{children:[x.jsxs(od,{render:x.jsx(ze,{variant:"destructive",size:"sm",disabled:u.isPending||s===0}),children:[x.jsx(Ce,{icon:qu,size:14,strokeWidth:2,"data-slot":"icon"}),u.isPending?"Deleting...":`Delete${s>0?` (${s})`:""}`]}),x.jsxs(ad,{children:[x.jsxs(ld,{children:[x.jsxs(ud,{children:["Delete ",s," Tasks"]}),x.jsx(dd,{children:"This will permanently delete the selected tasks and remove their worktrees. This action cannot be undone."})]}),x.jsxs(cd,{children:[x.jsx(fd,{children:"Cancel"}),x.jsx(rk,{onClick:p,variant:"destructive",disabled:u.isPending,children:u.isPending?"Deleting...":"Delete All"})]})]})]})]}):x.jsxs(x.Fragment,{children:[x.jsx("h1",{className:"text-sm font-medium",children:"Tasks"}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Ml,{value:a??"",onValueChange:f=>c(f||null),children:[x.jsxs(Pl,{size:"sm",className:"min-w-[120px]",children:[x.jsx(Ce,{icon:B2,size:12,strokeWidth:2,className:"text-muted-foreground"}),x.jsx(Dl,{children:a||"All Repos"})]}),x.jsxs(Il,{className:"min-w-[200px]",children:[x.jsx(hr,{value:"",children:"All Repos"}),d.map(f=>x.jsx(hr,{value:f,children:f},f))]})]}),x.jsxs(ze,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:[x.jsx(Ce,{icon:zM,size:14,strokeWidth:2,"data-slot":"icon"}),"Select"]})]})]})}),x.jsx("div",{className:"flex-1 overflow-hidden",children:x.jsx(A7,{repoFilter:a})})]})}const P7=vs("/settings/")({component:I7});function I7(){const{data:e,isLoading:t}=uI(),{data:n,isLoading:s}=P0(),{data:o,isLoading:u}=I0(),{data:h,isLoading:a}=$R(),{data:c,isLoading:d}=KR(),{data:p,isLoading:f}=YR(),{data:g,isLoading:b}=dI(),{data:w,isLoading:C}=fI(),{data:_,isLoading:y}=mI(),v=hI(),S=pI(),E=gI(),T=vI(),[A,M]=k.useState(""),[L,D]=k.useState(""),[U,z]=k.useState(""),[W,j]=k.useState(""),[Y,$]=k.useState(""),[V,q]=k.useState(""),[H,P]=k.useState(""),[B,I]=k.useState(!1),[G,K]=k.useState(!1),[J,Z]=k.useState(!1),[ee,X]=k.useState(!1),[F,se]=k.useState(!1),[re,ne]=k.useState(""),[oe,ce]=k.useState(!1),[_e,ve]=k.useState(""),[he,fe]=k.useState(!1),[De,Ae]=k.useState(""),[Pe,Se]=k.useState("");k.useEffect(()=>{e!==void 0&&M(String(e)),o!==void 0&&D(o),h!==void 0&&z(h),c!==void 0&&j(c),p!==void 0&&$(String(p)),g!==void 0&&q(g),w!==void 0&&P(w)},[e,o,h,c,p,g,w]),k.useEffect(()=>{_&&(Z(_.enabled),X(_.sound?.enabled??!1),se(_.slack?.enabled??!1),ne(_.slack?.webhookUrl??""),ce(_.discord?.enabled??!1),ve(_.discord?.webhookUrl??""),fe(_.pushover?.enabled??!1),Ae(_.pushover?.appToken??""),Se(_.pushover?.userKey??""))},[_]);const be=t||s||u||a||d||f||b||C||y,ae=_&&(J!==_.enabled||ee!==(_.sound?.enabled??!1)||F!==(_.slack?.enabled??!1)||re!==(_.slack?.webhookUrl??"")||oe!==(_.discord?.enabled??!1)||_e!==(_.discord?.webhookUrl??"")||he!==(_.pushover?.enabled??!1)||De!==(_.pushover?.appToken??"")||Pe!==(_.pushover?.userKey??"")),xe=A!==String(e)||L!==o||U!==h||W!==c||Y!==String(p)||V!==g||H!==w||ae,Re=async()=>{const ue=[];if(A!==String(e)){const je=parseInt(A,10);!isNaN(je)&&je>=1&&je<=65535&&ue.push(new Promise(rt=>{v.mutate({key:an.PORT,value:je},{onSettled:rt})}))}if(L!==o&&ue.push(new Promise(je=>{v.mutate({key:an.DEFAULT_GIT_REPOS_DIR,value:L},{onSettled:je})})),U!==h&&ue.push(new Promise(je=>{v.mutate({key:an.TASK_CREATION_COMMAND,value:U},{onSettled:je})})),W!==c&&ue.push(new Promise(je=>{v.mutate({key:an.HOSTNAME,value:W},{onSettled:je})})),Y!==String(p)){const je=parseInt(Y,10);!isNaN(je)&&je>=1&&je<=65535&&ue.push(new Promise(rt=>{v.mutate({key:an.SSH_PORT,value:je},{onSettled:rt})}))}V!==g&&ue.push(new Promise(je=>{v.mutate({key:an.LINEAR_API_KEY,value:V},{onSettled:je})})),H!==w&&ue.push(new Promise(je=>{v.mutate({key:an.GITHUB_PAT,value:H},{onSettled:je})})),ae&&ue.push(new Promise(je=>{E.mutate({enabled:J,sound:{enabled:ee},slack:{enabled:F,webhookUrl:re},discord:{enabled:oe,webhookUrl:_e},pushover:{enabled:he,appToken:De,userKey:Pe}},{onSettled:je})})),await Promise.all(ue),K(!0),setTimeout(()=>K(!1),2e3)},Ue=()=>{S.mutate(an.PORT,{onSuccess:ue=>{ue.value!==null&&M(String(ue.value))}})},nt=()=>{S.mutate(an.DEFAULT_GIT_REPOS_DIR,{onSuccess:ue=>{ue.value&&D(String(ue.value))}})},He=()=>{S.mutate(an.TASK_CREATION_COMMAND,{onSuccess:ue=>{ue.value!==null&&ue.value!==void 0&&z(String(ue.value))}})},st=()=>{S.mutate(an.HOSTNAME,{onSuccess:ue=>{ue.value!==null&&ue.value!==void 0&&j(String(ue.value))}})},et=()=>{S.mutate(an.SSH_PORT,{onSuccess:ue=>{ue.value!==null&&ue.value!==void 0&&$(String(ue.value))}})},ht=()=>{S.mutate(an.LINEAR_API_KEY,{onSuccess:ue=>{q(ue.value!==null&&ue.value!==void 0?String(ue.value):"")}})},qe=()=>{S.mutate(an.GITHUB_PAT,{onSuccess:ue=>{P(ue.value!==null&&ue.value!==void 0?String(ue.value):"")}})},$e=async ue=>{T.mutate(ue,{onSuccess:je=>{je.success?Mr.success(`${ue} test successful`):Mr.error(`${ue} test failed: ${je.error}`)},onError:je=>{Mr.error(`Test failed: ${je.message}`)}})};return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:x.jsx("h1",{className:"text-sm font-medium",children:"Settings"})}),x.jsx("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:x.jsx("div",{className:"mx-auto max-w-2xl",children:x.jsxs(lc,{children:[x.jsxs(cc,{className:"space-y-6 pt-6",children:[x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Server"}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Port"}),x.jsx(qt,{type:"number",min:1,max:65535,value:A,onChange:ue=>M(ue.target.value),placeholder:"3333",disabled:be,className:"w-24 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ue,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Requires server restart"})]})]}),x.jsx("div",{className:"border-t border-border"}),x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Paths"}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Worktree Directory"}),x.jsx(qt,{value:n,disabled:!0,className:"flex-1 font-mono text-sm bg-muted"})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Derived from VIBORA_DIR (read-only)"})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Git Repos Directory"}),x.jsx(qt,{value:L,onChange:ue=>D(ue.target.value),placeholder:"~/projects",disabled:be,className:"flex-1 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>I(!0),disabled:be,title:"Browse",children:x.jsx(Ce,{icon:_s,size:14,strokeWidth:2})}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:nt,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Starting directory for repo picker"})]})]}),x.jsx("div",{className:"border-t border-border"}),x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Task Defaults"}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Startup Command"}),x.jsx(qt,{value:U,onChange:ue=>z(ue.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:be,className:"flex-1 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:He,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Command to run when a new task terminal is created (leave empty to disable)"})]})]}),x.jsx("div",{className:"border-t border-border"}),x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Remote Access"}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Hostname"}),x.jsx(qt,{value:W,onChange:ue=>j(ue.target.value),placeholder:"e.g., citadel",disabled:be,className:"flex-1 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:st,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Remote machine hostname for VS Code SSH URLs (leave empty for local)"})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"SSH Port"}),x.jsx(qt,{type:"number",min:1,max:65535,value:Y,onChange:ue=>$(ue.target.value),placeholder:"22",disabled:be,className:"w-24 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:et,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"SSH port for VS Code remote connections"})]})]}),x.jsx("div",{className:"border-t border-border"}),x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Integrations"}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Linear API Key"}),x.jsx(qt,{type:"password",value:V,onChange:ue=>q(ue.target.value),placeholder:"lin_api_...",disabled:be,className:"flex-1 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ht,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Personal API key from Linear for syncing ticket status"})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"GitHub PAT"}),x.jsx(qt,{type:"password",value:H,onChange:ue=>P(ue.target.value),placeholder:"ghp_...",disabled:be,className:"flex-1 font-mono text-sm"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:qe,disabled:be||S.isPending,title:"Reset to default",children:x.jsx(Ce,{icon:Wo,size:14,strokeWidth:2})})]}),x.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Personal access token for GitHub API (Issues & PRs in Review)"})]})]}),x.jsx("div",{className:"border-t border-border"}),x.jsxs("div",{className:"space-y-4",children:[x.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Notifications"}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Enable Notifications"}),x.jsx(to,{checked:J,onCheckedChange:Z,disabled:be})]}),x.jsx("div",{className:"space-y-2 pl-4",children:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(to,{checked:ee,onCheckedChange:X,disabled:be||!J}),x.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e("sound"),disabled:be||!J||!ee||T.isPending,title:"Test sound",children:T.isPending?x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}):x.jsx(Ce,{icon:Bf,size:14,strokeWidth:2})})]})}),x.jsxs("div",{className:"space-y-2 pl-4",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(to,{checked:F,onCheckedChange:se,disabled:be||!J}),x.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e("slack"),disabled:be||!J||!F||!re||T.isPending,title:"Test Slack",children:T.isPending?x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}):x.jsx(Ce,{icon:Bf,size:14,strokeWidth:2})})]}),F&&x.jsx(qt,{type:"password",value:re,onChange:ue=>ne(ue.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:be||!J,className:"ml-6 flex-1 font-mono text-sm"})]}),x.jsxs("div",{className:"space-y-2 pl-4",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(to,{checked:oe,onCheckedChange:ce,disabled:be||!J}),x.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e("discord"),disabled:be||!J||!oe||!_e||T.isPending,title:"Test Discord",children:T.isPending?x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}):x.jsx(Ce,{icon:Bf,size:14,strokeWidth:2})})]}),oe&&x.jsx(qt,{type:"password",value:_e,onChange:ue=>ve(ue.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:be||!J,className:"ml-6 flex-1 font-mono text-sm"})]}),x.jsxs("div",{className:"space-y-2 pl-4",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(to,{checked:he,onCheckedChange:fe,disabled:be||!J}),x.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),x.jsx(ze,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>$e("pushover"),disabled:be||!J||!he||!De||!Pe||T.isPending,title:"Test Pushover",children:T.isPending?x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}):x.jsx(Ce,{icon:Bf,size:14,strokeWidth:2})})]}),he&&x.jsxs("div",{className:"ml-6 space-y-2",children:[x.jsx(qt,{type:"password",value:De,onChange:ue=>Ae(ue.target.value),placeholder:"App Token",disabled:be||!J,className:"flex-1 font-mono text-sm"}),x.jsx(qt,{type:"password",value:Pe,onChange:ue=>Se(ue.target.value),placeholder:"User Key",disabled:be||!J,className:"flex-1 font-mono text-sm"})]})]})]})]}),x.jsxs(Cj,{className:"flex items-center justify-end gap-2 border-t border-border",children:[G&&x.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[x.jsx(Ce,{icon:ka,size:12,strokeWidth:2}),"Saved"]}),x.jsx(ze,{size:"sm",onClick:Re,disabled:!xe||be||v.isPending,children:"Save Changes"})]})]})})}),x.jsx(N0,{open:B,onOpenChange:I,onSelect:ue=>D(ue),initialPath:L||void 0})]})}const Ap="";function j7(){return $n({queryKey:["github-user"],queryFn:async()=>{const e=await fetch(`${Ap}/api/github/user`);return e.ok?e.json():null},staleTime:600*1e3,retry:!1})}function N7(){return $n({queryKey:["github-orgs"],queryFn:async()=>{const e=await fetch(`${Ap}/api/github/orgs`);return e.ok?e.json():[]},staleTime:600*1e3})}function B7(e,t,n){return $n({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(`${Ap}/api/github/issues?${s}`);if(!o.ok)throw new Error("Failed to fetch issues");return o.json()},staleTime:300*1e3})}function z7(e,t,n){return $n({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(`${Ap}/api/github/prs?${s}`);if(!o.ok)throw new Error("Failed to fetch PRs");return o.json()},staleTime:300*1e3})}function H7({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=B7(e,t,n);if(o)return x.jsx("div",{className:"flex h-48 items-center justify-center",children:x.jsx(Ce,{icon:Jr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return x.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[x.jsx(Ce,{icon:Jl,size:24}),x.jsx("p",{className:"text-sm",children:"Failed to load issues"}),x.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?x.jsxs("div",{className:"space-y-4",children:[x.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),x.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=>x.jsx(V7,{issue:a},a.id))})]}):x.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[x.jsx(Ce,{icon:ka,size:24}),x.jsx("p",{className:"text-sm",children:h[e]})]})}function V7({issue:e}){return x.jsx(lc,{className:"transition-colors hover:border-border/80",children:x.jsx(cc,{className:"py-4",children:x.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[x.jsx("div",{className:"flex items-start gap-2",children:x.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),x.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:x.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]})}),e.labels.length>0&&x.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>x.jsx(ga,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&x.jsxs(ga,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}function F7({filter:e,viboraReposOnly:t,org:n}){const{data:s,isLoading:o,error:u}=z7(e,t,n);if(o)return x.jsx("div",{className:"flex h-48 items-center justify-center",children:x.jsx(Ce,{icon:Jr,size:24,className:"animate-spin text-muted-foreground"})});if(u)return x.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[x.jsx(Ce,{icon:Jl,size:24}),x.jsx("p",{className:"text-sm",children:"Failed to load pull requests"}),x.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?x.jsxs("div",{className:"space-y-4",children:[x.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.length," result",s.length!==1?"s":""]}),x.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=>x.jsx(U7,{pr:a},a.id))})]}):x.jsxs("div",{className:"flex h-48 flex-col items-center justify-center gap-2 text-muted-foreground",children:[x.jsx(Ce,{icon:ka,size:24}),x.jsx("p",{className:"text-sm",children:h[e]})]})}function U7({pr:e}){return x.jsx(lc,{className:"transition-colors hover:border-border/80",children:x.jsx(cc,{className:"py-4",children:x.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"block space-y-2",children:[x.jsx("div",{className:"flex items-start gap-2",children:x.jsx("span",{className:"line-clamp-2 text-sm font-medium",children:e.title})}),x.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[x.jsxs("span",{className:"font-mono",children:[e.repository.fullName,"#",e.number]}),e.draft&&x.jsx(ga,{variant:"secondary",className:Be("text-xs","bg-amber-400/20 text-amber-600 dark:text-amber-400"),children:"Draft"})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[e.author.avatarUrl&&x.jsx("img",{src:e.author.avatarUrl,alt:e.author.login,className:"h-4 w-4 rounded-full"}),x.jsx("span",{className:"text-xs text-muted-foreground",children:e.author.login})]}),e.labels.length>0&&x.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.labels.slice(0,3).map(t=>x.jsx(ga,{className:"text-xs",style:{backgroundColor:`#${t.color}20`,color:`#${t.color}`,borderColor:`#${t.color}40`},children:t.name},t.name)),e.labels.length>3&&x.jsxs(ga,{variant:"secondary",className:"text-xs",children:["+",e.labels.length-3]})]})]})})})}const W7=vs("/review/")({component:q7});function q7(){const[e,t]=k.useState("prs"),[n,s]=k.useState("review_requested"),[o,u]=k.useState("assigned"),[h,a]=k.useState(!1),[c,d]=k.useState(""),{data:p,isLoading:f}=j7(),{data:g=[]}=N7();return!f&&!p?x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("div",{className:"flex shrink-0 items-center border-b border-border px-4 py-2",children:x.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),x.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:x.jsxs("div",{className:"max-w-md space-y-4 text-center",children:[x.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:x.jsx(Ce,{icon:XM,size:24,className:"text-muted-foreground"})}),x.jsx("h2",{className:"text-lg font-medium",children:"GitHub Token Required"}),x.jsx("p",{className:"text-sm text-muted-foreground",children:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings."}),x.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 p-4 text-left",children:[x.jsx("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Required scopes:"}),x.jsxs("ul",{className:"space-y-1 text-xs text-muted-foreground",children:[x.jsxs("li",{children:["• ",x.jsx("code",{className:"rounded bg-muted px-1",children:"repo"})," (for private repositories)"]}),x.jsxs("li",{children:["• ",x.jsx("code",{className:"rounded bg-muted px-1",children:"read:user"})," (for user info)"]}),x.jsxs("li",{children:["• ",x.jsx("code",{className:"rounded bg-muted px-1",children:"read:org"})," (for organization list)"]})]})]}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,read:user,read:org&description=Vibora",target:"_blank",rel:"noopener noreferrer",children:x.jsxs(ze,{variant:"outline",size:"sm",className:"w-full",children:[x.jsx(Ce,{icon:QM,size:14,"data-slot":"icon"}),"Generate Token"]})}),x.jsx(Wn,{to:"/settings",children:x.jsx(ze,{size:"sm",className:"w-full",children:"Go to Settings"})})]})]})})]}):x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[x.jsx("div",{className:"flex items-center gap-4",children:x.jsx("h1",{className:"text-sm font-medium",children:"Review"})}),x.jsxs("div",{className:"flex items-center gap-4",children:[e==="prs"?x.jsxs(Ml,{value:n,onValueChange:b=>s(b),children:[x.jsx(Pl,{size:"sm",className:"min-w-[160px]",children:x.jsx(Dl,{})}),x.jsxs(Il,{children:[x.jsx(hr,{value:"created",children:"Created by me"}),x.jsx(hr,{value:"assigned",children:"Assigned to me"}),x.jsx(hr,{value:"review_requested",children:"Review requests"}),x.jsx(hr,{value:"mentioned",children:"Mentioned"})]})]}):x.jsxs(Ml,{value:o,onValueChange:b=>u(b),children:[x.jsx(Pl,{size:"sm",className:"min-w-[160px]",children:x.jsx(Dl,{})}),x.jsxs(Il,{children:[x.jsx(hr,{value:"assigned",children:"Assigned to me"}),x.jsx(hr,{value:"created",children:"Created by me"}),x.jsx(hr,{value:"mentioned",children:"Mentioned"})]})]}),x.jsxs(Ml,{value:c,onValueChange:b=>d(b||""),children:[x.jsx(Pl,{size:"sm",className:"min-w-[140px]",children:x.jsx(Dl,{children:c||"All Orgs"})}),x.jsxs(Il,{children:[x.jsx(hr,{value:"",children:"All Organizations"}),g.map(b=>x.jsx(hr,{value:b.login,children:b.login},b.login))]})]}),x.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[x.jsx(to,{checked:h,onCheckedChange:a,disabled:!!c}),x.jsx("span",{className:"text-muted-foreground",children:"Vibora repos only"})]})]})]}),x.jsxs(wp,{value:e,onValueChange:b=>t(b),className:"flex flex-1 flex-col overflow-hidden",children:[x.jsx("div",{className:"shrink-0 border-b border-border px-4",children:x.jsxs(Ep,{variant:"line",children:[x.jsx(po,{value:"prs",children:"Pull Requests"}),x.jsx(po,{value:"issues",children:"Issues"})]})}),x.jsx(ma,{value:"prs",className:"flex-1 overflow-auto p-4",children:x.jsx(F7,{filter:n,viboraReposOnly:h,org:c||void 0})}),x.jsx(ma,{value:"issues",className:"flex-1 overflow-auto p-4",children:x.jsx(H7,{filter:o,viboraReposOnly:h,org:c||void 0})})]})]})}const G7=vs("/repositories/")({component:Y7});function $7({repository:e,onDelete:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(!1),h=async a=>{a.preventDefault(),a.stopPropagation(),u(!0);try{await t(),s(!1)}catch{}finally{u(!1)}};return x.jsx(Wn,{to:"/repositories/$repoId",params:{repoId:e.id},children:x.jsx(lc,{className:"transition-colors hover:border-border/80 cursor-pointer",children:x.jsxs(cc,{className:"flex items-start justify-between gap-4 py-4",children:[x.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[x.jsx("div",{className:"flex items-center gap-2",children:x.jsx("span",{className:"truncate font-medium",children:e.displayName})}),x.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:_s,size:12,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{className:"truncate font-mono",children:e.path})]}),e.startupScript&&x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:X_,size:12,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{className:"truncate font-mono",children:e.startupScript})]}),e.copyFiles&&x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx(Ce,{icon:FM,size:12,strokeWidth:2,className:"shrink-0"}),x.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]}),x.jsx("div",{className:"flex items-center gap-1",onClick:a=>a.preventDefault(),children:x.jsxs(id,{open:n,onOpenChange:s,children:[x.jsx(od,{render:x.jsx(ze,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",onClick:a=>a.stopPropagation()}),children:x.jsx(Ce,{icon:qu,size:14,strokeWidth:2})}),x.jsxs(ad,{children:[x.jsxs(ld,{children:[x.jsx(ud,{children:"Delete Repository"}),x.jsxs(dd,{children:['This will remove "',e.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),x.jsxs(cd,{children:[x.jsx(fd,{disabled:o,children:"Cancel"}),x.jsxs(ze,{variant:"destructive",onClick:h,disabled:o,className:"gap-2",children:[o&&x.jsx(Ce,{icon:Jr,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})})]})})})}function K7(){const[e,t]=k.useState(!1),[n,s]=k.useState(!1),[o,u]=k.useState(""),[h,a]=k.useState(""),[c,d]=k.useState(""),[p,f]=k.useState(""),g=XR(),{data:b}=I0(),w=y=>{u(y),h||a(y.split("/").pop()||"")},C=y=>{y.preventDefault(),o.trim()&&g.mutate({path:o.trim(),displayName:h.trim()||o.split("/").pop()||"repo",startupScript:c.trim()||null,copyFiles:p.trim()||null},{onSuccess:()=>{t(!1),u(""),a(""),d(""),f("")}})},_=o?o.split("/").pop():"";return x.jsxs(x.Fragment,{children:[x.jsxs(Ms,{open:e,onOpenChange:t,children:[x.jsxs(eR,{render:x.jsx(ze,{size:"sm"}),children:[x.jsx(Ce,{icon:ec,size:16,strokeWidth:2,"data-slot":"icon"}),"Add Repository"]}),x.jsx(Ds,{className:"sm:max-w-md",children:x.jsxs("form",{onSubmit:C,children:[x.jsxs(vi,{children:[x.jsx(_i,{children:"Add Repository"}),x.jsx(ra,{children:"Add a git repository for quick access when creating tasks."})]}),x.jsxs(Cp,{className:"mt-4",children:[x.jsxs(In,{children:[x.jsx(jn,{children:"Repository Path"}),x.jsxs(ze,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>s(!0),children:[x.jsx(Ce,{icon:_s,size:14,strokeWidth:2,className:"mr-2"}),_?x.jsx("span",{className:"truncate",children:o}):x.jsx("span",{className:"text-muted-foreground",children:"Select repository..."})]})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"displayName",children:"Display Name"}),x.jsx(qt,{id:"displayName",value:h,onChange:y=>a(y.target.value),placeholder:_||"My Project"})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"startupScript",children:"Startup Script"}),x.jsx(xp,{id:"startupScript",value:c,onChange:y=>d(y.target.value),placeholder:"npm install && npm run dev",rows:2}),x.jsx(gi,{children:"Command to run in the terminal when creating a worktree."})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"copyFiles",children:"Copy Files"}),x.jsx(qt,{id:"copyFiles",value:p,onChange:y=>f(y.target.value),placeholder:".env, config.local.json"}),x.jsx(gi,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]}),x.jsxs(pa,{className:"mt-4",children:[x.jsx(y0,{render:x.jsx(ze,{variant:"outline",type:"button"}),children:"Cancel"}),x.jsx(ze,{type:"submit",disabled:g.isPending||!o.trim(),children:g.isPending?"Adding...":"Add Repository"})]})]})})]}),x.jsx(N0,{open:n,onOpenChange:s,onSelect:w,initialPath:b||void 0})]})}function Y7(){const{data:e,isLoading:t,error:n}=j0(),s=QR(),o=async u=>{await s.mutateAsync(u)};return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsx("h1",{className:"text-sm font-medium",children:"Repositories"}),e&&x.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.length," total"]})]}),x.jsx(K7,{})]}),x.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[t&&x.jsx("div",{className:"flex items-center justify-center py-12",children:x.jsx(Ce,{icon:Jr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),n&&x.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[x.jsx(Ce,{icon:Jl,size:20,strokeWidth:2}),x.jsxs("span",{className:"text-sm",children:["Failed to load repositories: ",n.message]})]}),!t&&!n&&e?.length===0&&x.jsx("div",{className:"py-12 text-muted-foreground",children:x.jsx("p",{className:"text-sm",children:"No repositories added yet. Add a repository for quick access when creating tasks."})}),x.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=>x.jsx($7,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const X7=()=>`http://${window.location.hostname}:3000`,pu={activeTab:"diff",browserUrl:X7(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1},filesViewState:{selectedFile:null,expandedDirs:[]}};function Op(e){const t=Gn(),n=k.useRef(void 0),s=k.useRef({}),{data:o}=GR(e),u=k.useMemo(()=>{const g=o?.viewState;return g?{activeTab:g.activeTab??pu.activeTab,browserUrl:g.browserUrl??pu.browserUrl,diffOptions:{...pu.diffOptions,...g.diffOptions},filesViewState:{...pu.filesViewState,...g.filesViewState}}:pu},[o?.viewState]),h=Nn({mutationFn:async g=>{const b=await fetch(`/api/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({viewState:g})});if(!b.ok)throw new Error("Failed to update view state");return b.json()},onSuccess:g=>{t.setQueryData(["tasks",e],g),t.setQueryData(["tasks"],b=>b&&b.map(w=>w.id===e?g:w))}}),a=k.useCallback(g=>{const b=s.current;s.current={...b,...g,diffOptions:g.diffOptions||b.diffOptions?{...b.diffOptions,...g.diffOptions}:void 0,filesViewState:g.filesViewState||b.filesViewState?{...b.filesViewState,...g.filesViewState}:void 0};const w=s.current,C={activeTab:w.activeTab??u.activeTab,browserUrl:w.browserUrl??u.browserUrl,diffOptions:{...u.diffOptions,...w.diffOptions},filesViewState:{...u.filesViewState,...w.filesViewState}};t.setQueryData(["tasks",e],_=>_&&{..._,viewState:C}),t.setQueryData(["tasks"],_=>_&&_.map(y=>y.id===e?{...y,viewState:C}:y)),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{h.mutate(C),s.current={}},500)},[t,e,u,h]),c=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:c,setBrowserUrl:d,setDiffOptions:p,setFilesViewState:f}}function Q7(e){const{viewState:t,setActiveTab:n}=Op(e);return{tab:t.activeTab,setTab:n}}function Z7(e){return $n({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 rw(e,t,n){return t?`vscode://vscode-remote/ssh-remote+${n!==22?`${t}:${n}`:t}${e}`:`vscode://file${e}`}function J7({taskName:e,cwd:t,className:n,planModeDescription:s,startupScript:o}){const u=k.useRef(null),h=k.useRef(null),a=k.useRef(null),c=k.useRef(!1),d=k.useRef(!1),[p,f]=k.useState(null),[g,b]=k.useState(!1),{data:w}=$R(),{setTerminalFocused:C}=B0(),{terminals:_,terminalsLoaded:y,connected:v,newTerminalIds:S,createTerminal:E,attachXterm:T,resizeTerminal:A,setupImagePaste:M,writeToTerminal:L}=W0(),D=p?_.find(W=>W.id===p):null,U=D?.status;k.useEffect(()=>{if(!u.current||h.current)return;const W=new bk.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"}}),j=new Sk.FitAddon,Y=new xk.WebLinksAddon;W.loadAddon(j),W.loadAddon(Y),W.open(u.current),h.current=W,a.current=j,requestAnimationFrame(()=>{j.fit(),b(!0)});const $=setTimeout(()=>{j.fit(),W.refresh(0,W.rows-1)},100),V=()=>C(!0),q=()=>C(!1);return W.textarea&&(W.textarea.addEventListener("focus",V),W.textarea.addEventListener("blur",q)),()=>{clearTimeout($),W.textarea&&(W.textarea.removeEventListener("focus",V),W.textarea.removeEventListener("blur",q)),C(!1),W.dispose(),h.current=null,a.current=null,b(!1)}},[C]);const z=k.useCallback(()=>{if(!a.current||!h.current)return;a.current.fit();const{cols:W,rows:j}=h.current;p&&A(p,W,j)},[p,A]);return k.useEffect(()=>{if(!u.current)return;const W=()=>{requestAnimationFrame(z)};window.addEventListener("resize",W);const j=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{z(),h.current&&h.current.refresh(0,h.current.rows-1)})};document.addEventListener("visibilitychange",j);const Y=new ResizeObserver(W);Y.observe(u.current);const $=new IntersectionObserver(V=>{V[0]?.isIntersecting&&requestAnimationFrame(()=>{z(),h.current&&h.current.refresh(0,h.current.rows-1)})},{threshold:.1});return $.observe(u.current),()=>{window.removeEventListener("resize",W),document.removeEventListener("visibilitychange",j),Y.disconnect(),$.disconnect()}},[z]),k.useEffect(()=>{if(!v||!t||!g||!y)return;const W=_.find(j=>j.cwd===t);if(W){f(W.id);return}if(!c.current&&h.current){c.current=!0;const{cols:j,rows:Y}=h.current;E({name:e,cols:j,rows:Y,cwd:t})}},[v,t,g,y,_,e,E]),k.useEffect(()=>{if(!t||p)return;const W=_.find(j=>j.cwd===t);W&&f(W.id)},[_,t,p]),k.useEffect(()=>{if(!p||!h.current||!u.current||d.current)return;const W=T(p,h.current),j=M(u.current,p);if(d.current=!0,requestAnimationFrame(z),S.has(p)){S.delete(p),o&&setTimeout(()=>{L(p,o+"\r")},100);let Y=w;s&&(Y=`claude "${`${e}: ${s}`.replace(/"/g,'\\"')}" --allow-dangerously-skip-permissions --permission-mode plan`),Y&&setTimeout(()=>{L(p,Y+"\r")},o?300:100)}return()=>{W(),j(),d.current=!1}},[p,T,M,t,z,w,L,s,e,o,S]),t?x.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!v&&x.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),U==="error"&&x.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."}),U==="exited"&&x.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",D?.exitCode,")"]}),x.jsxs("div",{className:"relative flex-1",children:[x.jsx("div",{ref:u,className:Be("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",n)}),x.jsx("button",{onClick:()=>h.current?.scrollToBottom(),className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:x.jsx(Ce,{icon:D2,size:20,strokeWidth:2})})]})]}):x.jsx("div",{className:Be("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function eB(e){const{viewState:t,setDiffOptions:n}=Op(e);return{options:t.diffOptions,setOption:(s,o)=>{n({[s]:o})},setOptions:n}}function tB(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 nB({taskId:e,worktreePath:t}){const{options:n,setOption:s}=eB(e),{wrap:o,ignoreWhitespace:u,includeUntracked:h}=n,{data:a,isLoading:c,error:d}=sI(t,{ignoreWhitespace:u,includeUntracked:h}),p=k.useMemo(()=>a?.diff?tB(a.diff):[],[a?.diff]);if(!t)return x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"});if(c)return x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading diff..."});if(d)return x.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?x.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[x.jsx("p",{children:"No changes detected"}),a?.files&&a.files.length>0&&x.jsxs("div",{className:"text-xs",children:[x.jsx("p",{className:"text-center mb-2",children:"Modified files:"}),x.jsxs("div",{className:"flex flex-col gap-1",children:[a.files.map(g=>x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("span",{className:Be("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"&&"?"]}),x.jsx("span",{children:g.path})]},g.path)),f&&x.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-muted-foreground hover:text-foreground mt-1",children:[x.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-4 h-3"}),x.jsx("span",{children:"Show untracked files"})]})]})]})]}):x.jsxs("div",{className:"flex flex-col h-full",children:[x.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&&x.jsxs("span",{className:"text-muted-foreground",children:[a.branch,a.isBranchDiff&&x.jsx("span",{className:"opacity-70",children:" (vs master)"})]}),x.jsx("div",{className:"flex-1"}),x.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[x.jsx("input",{type:"checkbox",checked:o,onChange:g=>s("wrap",g.target.checked),className:"w-3 h-3"}),"Wrap"]}),x.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[x.jsx("input",{type:"checkbox",checked:u,onChange:g=>s("ignoreWhitespace",g.target.checked),className:"w-3 h-3"}),"Ignore whitespace"]}),x.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[x.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-3 h-3"}),"Untracked"]})]}),x.jsx(sd,{className:"flex-1 min-h-0",children:x.jsx("div",{className:"font-mono text-xs",children:p.map((g,b)=>x.jsxs("div",{className:Be("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")&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.oldLineNumber??""}),x.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.newLineNumber??""})]}),x.jsxs("span",{className:Be("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"&&"-"]}),x.jsx("span",{className:Be("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})]},b))})})]})}function rB(e){const{viewState:t,setBrowserUrl:n}=Op(e);return{url:t.browserUrl,setUrl:n}}function sB({taskId:e}){const{url:t,setUrl:n}=rB(e),[s,o]=k.useState(t),[u,h]=k.useState(0);k.useEffect(()=>{o(t)},[t]);const a=k.useCallback(()=>{h(d=>d+1)},[]),c=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 x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2 py-1.5",children:[x.jsx(ze,{variant:"ghost",size:"icon-xs",disabled:!0,children:x.jsx(Ce,{icon:jM,size:14,strokeWidth:2})}),x.jsx(ze,{variant:"ghost",size:"icon-xs",disabled:!0,children:x.jsx(Ce,{icon:P2,size:14,strokeWidth:2})}),x.jsx(ze,{variant:"ghost",size:"icon-xs",onClick:a,children:x.jsx(Ce,{icon:e4,size:14,strokeWidth:2})}),x.jsx("form",{onSubmit:c,className:"flex-1",children:x.jsx(qt,{value:s,onChange:d=>o(d.target.value),className:"h-7 bg-background text-xs",placeholder:"Enter URL..."})})]}),x.jsx("div",{className:"flex-1 overflow-hidden bg-white",children:x.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 iB(e){const{viewState:t,setFilesViewState:n}=Op(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 oB(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?KM:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?UM:WM}function $k({entry:e,depth:t,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u}){const h=s.includes(e.path),a=n===e.path,c=e.type==="directory",d=k.useCallback(()=>{c?u(e.path):o(e.path)},[c,e.path,o,u]);return x.jsxs("div",{children:[x.jsxs("div",{className:Be("flex items-center gap-1.5 px-2 py-0.5 cursor-pointer text-sm hover:bg-muted/50",a&&"bg-primary/10 text-primary"),style:{paddingLeft:`${t*12+8}px`},onClick:d,children:[x.jsx(Ce,{icon:c?h?z2:_s:oB(e.name),size:14,strokeWidth:2,className:Be("shrink-0",c?"text-yellow-500":"text-muted-foreground")}),x.jsx("span",{className:"break-all",children:e.name})]}),c&&h&&e.children&&x.jsx("div",{children:e.children.map(p=>x.jsx($k,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function aB({entries:e,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o,onCollapseAll:u}){return e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No files"}):x.jsxs("div",{className:"flex flex-col h-full",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1 border-b border-border",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"Files"}),x.jsx("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Collapse all",children:x.jsx(Ce,{icon:ZM,size:14,strokeWidth:2})})]}),x.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>x.jsx($k,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const lB="modulepreload",cB=function(e){return"/"+e},sw={},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]"),c=a?.nonce||a?.getAttribute("nonce");o=d(n.map(p=>{if(p=cB(p),p in sw)return;sw[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=f?"stylesheet":lB,f||(b.as="script"),b.crossOrigin="",b.href=p,c&&b.setAttribute("nonce",c),document.head.appendChild(b),f)return new Promise((w,C)=>{b.addEventListener("load",w),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return o.then(a=>{for(const c of a||[])c.status==="rejected"&&u(c.reason);return t().catch(u)})};let xn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function uB(e){return $0(e)}function $0(e){return Array.isArray(e)?dB(e):e instanceof RegExp?e:typeof e=="object"?fB(e):e}function dB(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=$0(e[n]);return t}function fB(e){let t={};for(let n in e)t[n]=$0(e[n]);return t}function Kk(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function Yk(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Yk(e.substring(0,e.length-1)):e.substr(~t+1)}var Av=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,rh=class{static hasCaptures(e){return e===null?!1:(Av.lastIndex=0,Av.test(e))}static replaceCaptures(e,t,n){return e.replace(Av,(s,o,u,h)=>{let a=n[parseInt(o||u,10)];if(a){let c=t.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(h){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function Xk(e,t){return e<t?-1:e>t?1:0}function Qk(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=Xk(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function iw(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 Zk(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Jk=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(mB(e),t)}static createFromParsedTheme(e,t){return vB(e,t)}_cachedMatchRoot=new Jk(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=>hB(e.parent,o.parentScopes));return s?new eT(s.fontStyle,s.foreground,s.background):null}},Ov=class mh{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new mh(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new mh(n,t[s]);return n}push(t){return new mh(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 hB(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&&!pB(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function pB(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var eT=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function mB(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 c=-1;if(typeof h.settings.fontStyle=="string"){c=0;let f=h.settings.fontStyle.split(" ");for(let g=0,b=f.length;g<b;g++)switch(f[g]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let d=null;typeof h.settings.foreground=="string"&&iw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&iw(h.settings.background)&&(p=h.settings.background);for(let f=0,g=a.length;f<g;f++){let w=a[f].trim().split(" "),C=w[w.length-1],_=null;w.length>1&&(_=w.slice(0,w.length-1),_.reverse()),n[s++]=new gB(C,_,o,c,d,p)}}return n}var gB=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}},Qn=(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))(Qn||{});function vB(e,t){e.sort((c,d)=>{let p=Xk(c.scope,d.scope);return p!==0||(p=Qk(c.parentScopes,d.parentScopes),p!==0)?p:c.index-d.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(o=c.background)}let u=new _B(t),h=new eT(n,u.getId(s),u.getId(o)),a=new bB(new __(0,null,-1,0,0),[]);for(let c=0,d=e.length;c<d;c++){let p=e[c];a.insert(0,p.scope,p.parentScopes,p.fontStyle,u.getId(p.foreground),u.getId(p.background))}return new qh(u,h,a)}var _B=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)}},yB=Object.freeze([]),__=class tT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||yB,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new tT(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)}},bB=class y_{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(y_._cmpBySpecificity),n}insert(t,n,s,o,u,h){if(n===""){this._doInsertHere(t,s,o,u,h);return}let a=n.indexOf("."),c,d;a===-1?(c=n,d=""):(c=n.substring(0,a),d=n.substring(a+1));let p;this._children.hasOwnProperty(c)?p=this._children[c]:(p=new y_(this._mainRule.clone(),__.cloneArr(this._rulesWithParentScopes)),this._children[c]=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 c=this._rulesWithParentScopes[h];if(Qk(c.parentScopes,n)===0){c.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 __(t,n,s,o,u))}},Kl=class Yr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Yr.getLanguageId(t),s=Yr.getTokenType(t),o=Yr.getFontStyle(t),u=Yr.getForeground(t),h=Yr.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 c=Yr.getLanguageId(t),d=Yr.getTokenType(t),p=Yr.containsBalancedBrackets(t)?1:0,f=Yr.getFontStyle(t),g=Yr.getForeground(t),b=Yr.getBackground(t);return n!==0&&(c=n),s!==8&&(d=s),o!==null&&(p=o?1:0),u!==-1&&(f=u),h!==0&&(g=h),a!==0&&(b=a),(c<<0|d<<8|p<<10|f<<11|g<<15|b<<24)>>>0}};function Gh(e,t){const n=[],s=SB(e);let o=s.next();for(;o!==null;){let c=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let d=h();if(n.push({matcher:d,priority:c}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const c=u();return d=>!!c&&!c(d)}if(o==="("){o=s.next();const c=a();return o===")"&&(o=s.next()),c}if(ow(o)){const c=[];do c.push(o),o=s.next();while(ow(o));return d=>t(c,d)}return null}function h(){const c=[];let d=u();for(;d;)c.push(d),d=u();return p=>c.every(f=>f(p))}function a(){const c=[];let d=h();for(;d&&(c.push(d),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");d=h()}return p=>c.some(f=>f(p))}}function ow(e){return!!e&&!!e.match(/[\w\.:]+/)}function SB(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 nT(e){typeof e.dispose=="function"&&e.dispose()}var Hu=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},xB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},CB=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))}},wB=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Hu(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new CB;for(const n of e)EB(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Hu){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 EB(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 Hu?gh({baseGrammar:u,selfGrammar:o},s):b_(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 Hu(a))}function b_(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];$h([s],t,n)}}function gh(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?Kk({},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=rT(u);switch(h.kind){case 0:gh({...t,selfGrammar:t.baseGrammar},n);break;case 1:gh(t,n);break;case 2:b_(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 c={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};h.kind===4?b_(h.ruleName,c,n):gh(c,n)}else h.kind===4?n.add(new xB(h.scopeName,h.ruleName)):n.add(new Hu(h.scopeName));break}}}var RB=class{kind=0},kB=class{kind=1},TB=class{constructor(e){this.ruleName=e}kind=2},LB=class{constructor(e){this.scopeName=e}kind=3},AB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function rT(e){if(e==="$base")return new RB;if(e==="$self")return new kB;const t=e.indexOf("#");if(t===-1)return new LB(e);if(t===0)return new TB(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new AB(n,s)}}var OB=/\\(\d+)/,aw=/\\(\d+)/g,MB=-1,sT=-2;var md=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,s){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=rh.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=rh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Yk(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:rh.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:rh.replaceCaptures(this._contentName,e,t)}},DB=class extends md{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!")}},PB=class extends md{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,null),this._match=new Vu(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 Fu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},lw=class extends md{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 Fu,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},S_=class extends md{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o,u,h,a,c,d){super(e,t,n,s),this._begin=new Vu(o,this.id),this.beginCaptures=u,this._end=new Vu(h||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!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 Fu;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 md{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,s,o,u,h,a,c){super(e,t,n,s),this._begin=new Vu(o,this.id),this.beginCaptures=u,this.whileCaptures=a,this._while=new Vu(h,sT),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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 Fu;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 Fu,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},iT=class Xn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new DB(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new PB(t.$vscodeTextmateLocation,t.id,t.name,t.match,Xn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=Kk({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new lw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Xn._compilePatterns(u,n,s))}return t.while?new Kh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Xn._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,Xn._compileCaptures(t.whileCaptures||t.captures,n,s),Xn._compilePatterns(t.patterns,n,s)):new S_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Xn._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,Xn._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,Xn._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 c=0;t[h].patterns&&(c=Xn.getCompiledRuleId(t[h],n,s)),o[a]=Xn.createCaptureRule(n,t[h].$vscodeTextmateLocation,t[h].name,t[h].contentName,c)}}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 c=-1;if(a.include){const d=rT(a.include);switch(d.kind){case 0:case 1:c=Xn.getCompiledRuleId(s[a.include],n,s);break;case 2:let p=s[d.ruleName];p&&(c=Xn.getCompiledRuleId(p,n,s));break;case 3:case 4:const f=d.scopeName,g=d.kind===4?d.ruleName:null,b=n.getExternalGrammar(f,s);if(b)if(g){let w=b.repository[g];w&&(c=Xn.getCompiledRuleId(w,n,b.repository))}else c=Xn.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else c=Xn.getCompiledRuleId(a,n,s);if(c!==-1){const d=n.getRule(c);let p=!1;if((d instanceof lw||d instanceof S_||d instanceof Kh)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Vu=class oT{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=OB.test(this.source):this.hasBackReferences=!1}clone(){return new oT(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 aw.lastIndex=0,this.source.replace(aw,(o,u)=>Zk(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,c;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&&(c=this.source.charAt(u+1),c==="A"?(t[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):c==="G"?(t[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(t[u+1]=c,n[u+1]=c,s[u+1]=c,o[u+1]=c),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}},Fu=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 cw(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 cw(e,s,this._items.map(o=>o.ruleId))}},cw=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}},Mv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},IB=class x_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Mv(t,8),this._embeddedLanguagesMatcher=new jB(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?x_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Mv(0,0);_getBasicScopeAttributes=new Jk(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new Mv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(x_.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/},jB=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])=>Zk(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])}},uw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function aT(e,t,n,s,o,u,h,a){const c=t.content.length;let d=!1,p=-1;if(h){const b=NB(e,t,n,s,o,u);o=b.stack,s=b.linePos,n=b.isFirstLine,p=b.anchorPosition}const f=Date.now();for(;!d;){if(a!==0&&Date.now()-f>a)return new uw(o,!0);g()}return new uw(o,!1);function g(){const b=BB(e,t,n,s,o,p);if(!b){u.produce(o,c),d=!0;return}const w=b.captureIndices,C=b.matchedRuleId,_=w&&w.length>0?w[0].end>s:!1;if(C===MB){const y=o.getRule(e);u.produce(o,w[0].start),o=o.withContentNameScopesList(o.nameScopesList),yu(e,t,n,o,u,y.endCaptures,w),u.produce(o,w[0].end);const v=o;if(o=o.parent,p=v.getAnchorPos(),!_&&v.getEnterPos()===s){o=v,u.produce(o,c),d=!0;return}}else{const y=e.getRule(C);u.produce(o,w[0].start);const v=o,S=y.getName(t.content,w),E=o.contentNameScopesList.pushAttributed(S,e);if(o=o.push(C,s,p,w[0].end===c,null,E,E),y instanceof S_){const T=y;yu(e,t,n,o,u,T.beginCaptures,w),u.produce(o,w[0].end),p=w[0].end;const A=T.getContentName(t.content,w),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.endHasBackReferences&&(o=o.withEndRule(T.getEndWithResolvedBackReferences(t.content,w))),!_&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),d=!0;return}}else if(y instanceof Kh){const T=y;yu(e,t,n,o,u,T.beginCaptures,w),u.produce(o,w[0].end),p=w[0].end;const A=T.getContentName(t.content,w),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.whileHasBackReferences&&(o=o.withEndRule(T.getWhileWithResolvedBackReferences(t.content,w))),!_&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),d=!0;return}}else if(yu(e,t,n,o,u,y.captures,w),u.produce(o,w[0].end),o=o.pop(),!_){o=o.safePop(),u.produce(o,c),d=!0;return}}w[0].end>s&&(s=w[0].end,n=!1)}}function NB(e,t,n,s,o,u){let h=o.beginRuleCapturedEOL?0:-1;const a=[];for(let c=o;c;c=c.pop()){const d=c.getRule(e);d instanceof Kh&&a.push({rule:d,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:d,findOptions:p}=VB(c.rule,e,c.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==sT){o=c.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(u.produce(c.stack,f.captureIndices[0].start),yu(e,t,n,c.stack,u,c.rule.whileCaptures,f.captureIndices),u.produce(c.stack,f.captureIndices[0].end),h=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=c.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:h,isFirstLine:n}}function BB(e,t,n,s,o,u){const h=zB(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const c=HB(a,e,t,n,s,o,u);if(!c)return h;if(!h)return c;const d=h.captureIndices[0].start,p=c.captureIndices[0].start;return p<d||c.priorityMatch&&p===d?c:h}function zB(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:c}=lT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,c);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function HB(e,t,n,s,o,u,h){let a=Number.MAX_VALUE,c=null,d,p=0;const f=u.contentNameScopesList.getScopeNames();for(let g=0,b=e.length;g<b;g++){const w=e[g];if(!w.matcher(f))continue;const C=t.getRule(w.ruleId),{ruleScanner:_,findOptions:y}=lT(C,t,null,s,o===h),v=_.findNextMatchSync(n,o,y);if(!v)continue;const S=v.captureIndices[0].start;if(!(S>=a)&&(a=S,c=v.captureIndices,d=v.ruleId,p=w.priority,a===o))break}return c?{priorityMatch:p===-1,captureIndices:c,matchedRuleId:d}:null}function lT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function VB(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function yu(e,t,n,s,o,u,h){if(u.length===0)return;const a=t.content,c=Math.min(u.length,h.length),d=[],p=h[0].end;for(let f=0;f<c;f++){const g=u[f];if(g===null)continue;const b=h[f];if(b.length===0)continue;if(b.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=b.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,b.start):o.produce(s,b.start),g.retokenizeCapturedWithRuleId){const C=g.getName(a,h),_=s.contentNameScopesList.pushAttributed(C,e),y=g.getContentName(a,h),v=_.pushAttributed(y,e),S=s.push(g.retokenizeCapturedWithRuleId,b.start,-1,!1,null,_,v),E=e.createOnigString(a.substring(0,b.end));aT(e,E,n&&b.start===0,b.start,S,o,!1,0),nT(E);continue}const w=g.getName(a,h);if(w!==null){const _=(d.length>0?d[d.length-1].scopes:s.contentNameScopesList).pushAttributed(w,e);d.push(new FB(_,b.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var FB=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function UB(e,t,n,s,o,u,h,a){return new qB(e,t,n,s,o,u,h,a)}function dw(e,t,n,s,o){const u=Gh(t,Yh),h=iT.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(WB(t[o],s))return n=o+1,!0;return!1})}function WB(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 qB=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new IB(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=fw(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const d=Gh(c,Yh);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[c]})}}_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)dw(t,h,o[h],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(h=>{const a=this.getExternalGrammar(h);if(a){const c=a.injectionSelector;c&&dw(t,c,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]=fw(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=iT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===C_.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),f=Kl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let b;g?b=Ru.createRootAndLookUpScopeName(g,f,this):b=Ru.createRoot("unknown",f),t=new C_(null,this._rootId,-1,-1,!1,null,b,b)}else o=!1,t.reset();e=e+`
36
+ `;const u=this.createOnigString(e),h=u.content.length,a=new $B(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=aT(this,u,o,0,t,a,!0,s);return nT(u),{lineLength:h,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function fw(e,t){return e=uB(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 Ru=class Ls{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=Ov.push(o,u.scopeNames),s=new Ls(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new Ls(null,new Ov(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Ov(null,t),h=s.themeProvider.themeMatch(u),a=Ls.mergeAttributes(n,o,h);return new Ls(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ls.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),Kl.set(t,n.languageId,n.tokenType,null,o,u,h)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ls._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=Ls._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=Ls.mergeAttributes(t.tokenAttributes,o,h);return new Ls(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}},C_=class Yo{constructor(t,n,s,o,u,h,a,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=h,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Yo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Yo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ru.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(){Yo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,u,h,a){return new Yo(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 Yo(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=Ru.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Yo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,Ru.fromExtension(s,n.contentNameScopesList))}},GB=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}},$B=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=Kl.set(s,0,h.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(u))}if(o&&(s=Kl.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}},KB=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,UB(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},YB=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new KB(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 GB(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new wB(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)}},w_=C_.NULL;const XB=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class gd{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}gd.prototype.normal={};gd.prototype.property={};gd.prototype.space=void 0;function cT(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new gd(n,s,t)}function E_(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let QB=0;const yt=Ba(),Sn=Ba(),R_=Ba(),Me=Ba(),Kt=Ba(),jl=Ba(),Lr=Ba();function Ba(){return 2**++QB}const k_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Sn,commaOrSpaceSeparated:Lr,commaSeparated:jl,number:Me,overloadedBoolean:R_,spaceSeparated:Kt},Symbol.toStringTag,{value:"Module"})),Dv=Object.keys(k_);class K0 extends vr{constructor(t,n,s,o){let u=-1;if(super(t,n),hw(this,"space",o),typeof s=="number")for(;++u<Dv.length;){const h=Dv[u];hw(this,Dv[u],(s&k_[h])===k_[h])}}}K0.prototype.defined=!0;function hw(e,t,n){n&&(e[t]=n)}function dc(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new K0(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[E_(s)]=s,n[E_(u.attribute)]=s}return new gd(t,n,e.space)}const uT=dc({properties:{ariaActiveDescendant:null,ariaAtomic:Sn,ariaAutoComplete:null,ariaBusy:Sn,ariaChecked:Sn,ariaColCount:Me,ariaColIndex:Me,ariaColSpan:Me,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:Me,ariaLive:null,ariaModal:Sn,ariaMultiLine:Sn,ariaMultiSelectable:Sn,ariaOrientation:null,ariaOwns:Kt,ariaPlaceholder:null,ariaPosInSet:Me,ariaPressed:Sn,ariaReadOnly:Sn,ariaRelevant:null,ariaRequired:Sn,ariaRoleDescription:Kt,ariaRowCount:Me,ariaRowIndex:Me,ariaRowSpan:Me,ariaSelected:Sn,ariaSetSize:Me,ariaSort:null,ariaValueMax:Me,ariaValueMin:Me,ariaValueNow:Me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dT(e,t){return t in e?e[t]:t}function fT(e,t){return dT(e,t.toLowerCase())}const ZB=dc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jl,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:Me,colSpan:null,content:null,contentEditable:Sn,controls:yt,controlsList:Kt,coords:Me|jl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:R_,draggable:Sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Kt,height:Me,hidden:R_,high:Me,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:Me,manifest:null,max:null,maxLength:Me,media:null,method:null,min:null,minLength:Me,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:Me,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:Me,rowSpan:Me,sandbox:Kt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:Me,sizes:null,slot:null,span:Me,spellCheck:Sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Me,step:null,style:null,tabIndex:Me,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Sn,width:Me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kt,axis:null,background:null,bgColor:null,border:Me,borderColor:null,bottomMargin:Me,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:Me,leftMargin:Me,link:null,longDesc:null,lowSrc:null,marginHeight:Me,marginWidth:Me,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:Me,rules:null,scheme:null,scrolling:Sn,standby:null,summary:null,text:null,topMargin:Me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:Me,security:null,unselectable:null},space:"html",transform:fT}),JB=dc({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:Lr,accentHeight:Me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Me,amplitude:Me,arabicForm:null,ascent:Me,attributeName:null,attributeType:null,azimuth:Me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Me,by:null,calcMode:null,capHeight:Me,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:Me,diffuseConstant:Me,direction:null,display:null,dur:null,divisor:Me,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Me,enableBackground:null,end:null,event:null,exponent:Me,externalResourcesRequired:null,fill:null,fillOpacity:Me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jl,g2:jl,glyphName:jl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Me,horizOriginX:Me,horizOriginY:Me,id:null,ideographic:Me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Me,k:Me,k1:Me,k2:Me,k3:Me,k4:Me,kernelMatrix:Lr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Me,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:Me,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:Me,overlineThickness:Me,paintOrder:null,panose1:null,path:null,pathLength:Me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Me,pointsAtY:Me,pointsAtZ:Me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lr,rev:Lr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lr,requiredFeatures:Lr,requiredFonts:Lr,requiredFormats:Lr,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:Me,specularExponent:Me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Me,strikethroughThickness:Me,string:null,stroke:null,strokeDashArray:Lr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Me,strokeOpacity:Me,strokeWidth:null,style:null,surfaceScale:Me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lr,tabIndex:Me,tableValues:null,target:null,targetX:Me,targetY:Me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Me,underlineThickness:Me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Me,values:null,vAlphabetic:Me,vMathematical:Me,vectorEffect:null,vHanging:Me,vIdeographic:Me,version:null,vertAdvY:Me,vertOriginX:Me,vertOriginY:Me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dT}),hT=dc({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()}}),pT=dc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fT}),mT=dc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ez=/[A-Z]/g,pw=/-[a-z]/g,tz=/^data[-\w.:]+$/i;function nz(e,t){const n=E_(t);let s=t,o=vr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tz.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(pw,sz);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!pw.test(u)){let h=u.replace(ez,rz);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=K0}return new o(s,t)}function rz(e){return"-"+e.toLowerCase()}function sz(e){return e.charAt(1).toUpperCase()}const iz=cT([uT,ZB,hT,pT,mT],"html"),gT=cT([uT,JB,hT,pT,mT],"svg"),mw={}.hasOwnProperty;function oz(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&mw.call(o,e)){const c=String(o[e]);h=mw.call(a,c)?a[c]: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 az=/["&'<>`]/g,lz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,cz=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,uz=/[|\\{}()[\]^$+*?.]/g,gw=new WeakMap;function dz(e,t){if(e=e.replace(t.subset?fz(t.subset):az,s),t.subset||t.escapeOnly)return e;return e.replace(lz,n).replace(cz,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 fz(e){let t=gw.get(e);return t||(t=hz(e),gw.set(e,t)),t}function hz(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(uz,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const pz=/[\dA-Fa-f]/;function mz(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!pz.test(String.fromCharCode(t))?s:s+";"}const gz=/\d/;function vz(e,t,n){const s="&#"+String(e);return n&&t&&!gz.test(String.fromCharCode(t))?s:s+";"}const _z=["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"],Pv={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:"€"},yz=["cent","copy","divide","gt","lt","not","para","times"],vT={}.hasOwnProperty,T_={};let sh;for(sh in Pv)vT.call(Pv,sh)&&(T_[Pv[sh]]=sh);const bz=/[^\dA-Za-z]/;function Sz(e,t,n,s){const o=String.fromCharCode(e);if(vT.call(T_,o)){const u=T_[o],h="&"+u;return n&&_z.includes(u)&&!yz.includes(u)&&(!s||t&&t!==61&&bz.test(String.fromCharCode(t)))?h:h+";"}return""}function xz(e,t,n){let s=mz(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Sz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=vz(e,t,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Nl(e,t){return dz(e,Object.assign({format:xz},t))}const Cz=/^>|^->|<!--|-->|--!>|<!-$/g,wz=[">"],Ez=["<",">"];function Rz(e,t,n,s){return s.settings.bogusComments?"<?"+Nl(e.value,Object.assign({},s.settings.characterReferences,{subset:wz}))+">":"<!--"+e.value.replace(Cz,o)+"-->";function o(u){return Nl(u,Object.assign({},s.settings.characterReferences,{subset:Ez}))}}function kz(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function vw(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 Tz(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Lz(e){return e.join(" ").trim()}const Az=/[ \t\n\f\r]/g;function Y0(e){return typeof e=="object"?e.type==="text"?_w(e.value):!1:_w(e)}function _w(e){return e.replace(Az,"")===""}const On=yT(1),_T=yT(-1),Oz=[];function yT(e){return t;function t(n,s,o){const u=n?n.children:Oz;let h=(s||0)+e,a=u[h];if(!o)for(;a&&Y0(a);)h+=e,a=u[h];return a}}const Mz={}.hasOwnProperty;function bT(e){return t;function t(n,s,o){return Mz.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const X0=bT({body:Pz,caption:Iv,colgroup:Iv,dd:Bz,dt:Nz,head:Iv,html:Dz,li:jz,optgroup:zz,option:Hz,p:Iz,rp:yw,rt:yw,tbody:Fz,td:bw,tfoot:Uz,th:bw,thead:Vz,tr:Wz});function Iv(e,t,n){const s=On(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Y0(s.value.charAt(0)))}function Dz(e,t,n){const s=On(n,t);return!s||s.type!=="comment"}function Pz(e,t,n){const s=On(n,t);return!s||s.type!=="comment"}function Iz(e,t,n){const s=On(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 jz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="li"}function Nz(e,t,n){const s=On(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Bz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function yw(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function zz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Hz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Vz(e,t,n){const s=On(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Fz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Uz(e,t,n){return!On(n,t)}function Wz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function bw(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const qz=bT({body:Kz,colgroup:Yz,head:$z,html:Gz,tbody:Xz});function Gz(e){const t=On(e,-1);return!t||t.type!=="comment"}function $z(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 Kz(e){const t=On(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Y0(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Yz(e,t,n){const s=_T(n,t),o=On(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&X0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Xz(e,t,n){const s=_T(n,t),o=On(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&X0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const ih={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 Qz(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 c;o.space==="html"&&e.tagName==="svg"&&(s.schema=gT);const d=Zz(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!qz(e,t,n))&&(a.push("<",e.tagName,d?" "+d:""),h&&(o.space==="svg"||s.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(p),!h&&(!u||!X0(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function Zz(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=Jz(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 Jz(e,t,n){const s=nz(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 c=Nl(s.attribute,Object.assign({},e.settings.characterReferences,{subset:ih.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?Tz:Lz)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(a=Nl(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ih.unquoted[o][u]}))),a!==n&&(e.settings.quoteSmart&&vw(n,h)>vw(n,e.alternative)&&(h=e.alternative),a=h+Nl(n,Object.assign({},e.settings.characterReferences,{subset:(h==="'"?ih.single:ih.double)[o][u],attribute:!0}))+h),c+(a&&"="+a))}const eH=["<","&"];function ST(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Nl(e.value,Object.assign({},s.settings.characterReferences,{subset:eH}))}function tH(e,t,n,s){return s.settings.allowDangerousHtml?e.value:ST(e,t,n,s)}function nH(e,t,n,s){return s.all(e)}const rH=oz("type",{invalid:sH,unknown:iH,handlers:{comment:Rz,doctype:kz,element:Qz,raw:tH,root:nH,text:ST}});function sH(e){throw new Error("Expected node, not `"+e+"`")}function iH(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const oH={},aH={},lH=[];function cH(e,t){const n=t||oH,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:uH,all:dH,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||XB,characterReferences:n.characterReferences||aH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?gT:iz,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function uH(e,t,n){return rH(e,t,n,this)}function dH(e){const t=[],n=e&&e.children||lH;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 mo(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function fH(e){return Array.isArray(e)?e:[e]}async function xT(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Q0(e){return!e||["plaintext","txt","text","plain"].includes(e)}function CT(e){return e==="ansi"||Q0(e)}function Z0(e){return e==="none"}function wT(e){return Z0(e)}function ET(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 Mp(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 hH(e){const t=Mp(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 J0="light-dark()",pH=["color","background-color"];function mH(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 gH(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?mH(o,u):o})):e}function vH(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))),c={},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 b=p[g]||"inherit";if(f===0&&s&&pH.includes(g))if(s===J0&&h.length>1){const w=t.findIndex(v=>v==="light"),C=t.findIndex(v=>v==="dark");if(w===-1||C===-1)throw new xn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=h[w][g]||"inherit",y=h[C][g]||"inherit";c[g]=`light-dark(${_}, ${y})`,o==="css-vars"&&(c[d(f,g)]=b)}else c[g]=b;else o==="css-vars"&&(c[d(f,g)]=b)}}),u.htmlStyle=c,u}function Qh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Qn.Italic&&(t["font-style"]="italic"),e.fontStyle&Qn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Qn.Underline&&n.push("underline"),e.fontStyle&Qn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function L_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const RT=new WeakMap;function Dp(e,t){RT.set(e,t)}function Uu(e){return RT.get(e)}class fc{_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 fc(Object.fromEntries(fH(n).map(s=>[s,w_])),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 _H(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function _H(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 yH(e,t){if(!(e instanceof fc))throw new xn("Invalid grammar state");return e.getInternalStack(t)}function bH(){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 xn(`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 xn(`Invalid decoration position ${JSON.stringify(h)}. Lines length: ${o.lines.length}`);let c=h.character;if(c<0&&(c=a.length+c),c<0||c>a.length)throw new xn(`Invalid decoration position ${JSON.stringify(h)}. Line ${h.line} length: ${a.length}`);return{...h,character:c,offset:o.posToIndex(h.line,c)}}};const o=hH(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));SH(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 gH(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 xn(`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,b){const w=o[p];let C="",_=-1,y=-1;if(f===0&&(_=0),g===0&&(y=0),g===Number.POSITIVE_INFINITY&&(y=w.children.length),_===-1||y===-1)for(let S=0;S<w.children.length;S++)C+=kT(w.children[S]),_===-1&&C.length===f&&(_=S+1),y===-1&&C.length===g&&(y=S+1);if(_===-1)throw new xn(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(y===-1)throw new xn(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const v=w.children.slice(_,y);if(!b.alwaysWrap&&v.length===w.children.length)a(w,b,"line");else if(!b.alwaysWrap&&v.length===1&&v[0].type==="element")a(v[0],b,"token");else{const S={type:"element",tagName:"span",properties:{},children:v};a(S,b,"wrapper"),w.children.splice(_,v.length,S)}}function h(p,f){o[p]=a(o[p],f,"line")}function a(p,f,g){const b=f.properties||{},w=f.transform||(C=>C);return p.tagName=f.tagName||"span",p.properties={...p.properties,...b,class:p.properties.class},f.properties?.class&&ET(p,f.properties.class),p=w(p,g)||p,p}const c=[],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 b=f.line+1;b<g.line;b++)c.unshift(()=>h(b,p));u(g.line,0,g.character,p)}}c.forEach(p=>p())}}}function SH(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new xn(`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,c=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(u||h||a||c){if(u&&h||a&&c||a&&n.start.offset===n.end.offset||h&&o.start.offset===o.end.offset)continue;throw new xn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function kT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(kT).join(""):""}const xH=[bH()];function Zh(e){const t=CH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...xH]}function CH(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 oa=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],jv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function wH(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 Sw(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 EH(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)jv[s]&&t.push({type:"setDecoration",value:jv[s]});else if(s<=29){const o=jv[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:oa[s-30]}});else if(s===38){const o=Sw(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:oa[s-40]}});else if(s===48){const o=Sw(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:oa[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:oa[s-100+8]}})}return t}function RH(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=wH(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 c=EH(h.sequence);for(const d of c)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 c)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 kH={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 TH(e=kH){function t(a){return e[a]}function n(a){return`#${a.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let d=0;d<oa.length;d++)s.push(t(oa[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 c=8;for(let d=0;d<24;d++,c+=10)s.push(n([c,c,c]));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 LH={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 AH(e,t,n){const s=Xh(e,n),o=Mp(t),u=Object.fromEntries(oa.map(c=>{const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,p=e.colors?.[d];return[c,p||LH[c]]})),h=TH(u),a=RH();return o.map(c=>a.parse(c[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=mo(p,s),f=mo(f,s),d.decorations.has("dim")&&(p=OH(p));let g=Qn.None;return d.decorations.has("bold")&&(g|=Qn.Bold),d.decorations.has("italic")&&(g|=Qn.Italic),d.decorations.has("underline")&&(g|=Qn.Underline),d.decorations.has("strikethrough")&&(g|=Qn.Strikethrough),{content:d.value,offset:c[1],color:p,bgColor:f,fontStyle:g}}))}function OH(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],c=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${u}${u}${h}${h}${c}`}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 ey(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Q0(o)||Z0(s))return Mp(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return AH(u,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new xn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(u.name))throw new xn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return DH(t,a,u,h,n)}function MH(...e){if(e.length===2)return Uu(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:u=t.getLoadedThemes()[0]}=s;if(Q0(o)||Z0(u))throw new xn("Plain language does not have grammar state");if(o==="ansi")throw new xn("ANSI language does not have grammar state");const{theme:h,colorMap:a}=t.setTheme(u),c=t.getLanguage(o);return new fc(ty(n,c,h,a,s).stateStack,c.name,h.name)}function DH(e,t,n,s,o){const u=ty(e,t,n,s,o),h=new fc(u.stateStack,t.name,n.name);return Dp(u.tokens,h),u.tokens}function ty(e,t,n,s,o){const u=Xh(n,o),{tokenizeMaxLineLength:h=0,tokenizeTimeLimit:a=500}=o,c=Mp(e);let d=o.grammarState?yH(o.grammarState,n.name)??w_:o.grammarContextCode!=null?ty(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:w_,p=[];const f=[];for(let g=0,b=c.length;g<b;g++){const[w,C]=c[g];if(w===""){p=[],f.push([]);continue}if(h>0&&w.length>=h){p=[],f.push([{content:w,offset:C,color:"",fontStyle:0}]);continue}let _,y,v;o.includeExplanation&&(_=t.tokenizeLine(w,d,a),y=_.tokens,v=0);const S=t.tokenizeLine2(w,d,a),E=S.tokens.length/2;for(let T=0;T<E;T++){const A=S.tokens[2*T],M=T+1<E?S.tokens[2*T+2]:w.length;if(A===M)continue;const L=S.tokens[2*T+1],D=mo(s[Kl.getForeground(L)],u),U=Kl.getFontStyle(L),z={content:w.substring(A,M),offset:C+A,color:D,fontStyle:U};if(o.includeExplanation){const W=[];if(o.includeExplanation!=="scopeName")for(const Y of n.settings){let $;switch(typeof Y.scope){case"string":$=Y.scope.split(/,/).map(V=>V.trim());break;case"object":$=Y.scope;break;default:continue}W.push({settings:Y,selectors:$.map(V=>V.split(/ /))})}z.explanation=[];let j=0;for(;A+j<M;){const Y=y[v],$=w.substring(Y.startIndex,Y.endIndex);j+=$.length,z.explanation.push({content:$,scopes:o.includeExplanation==="scopeName"?PH(Y.scopes):IH(W,Y.scopes)}),v+=1}}p.push(z)}f.push(p),p=[],d=S.ruleStack}return{tokens:f,stateStack:d}}function PH(e){return e.map(t=>({scopeName:t}))}function IH(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:NH(e,u,t.slice(0,s))}}return n}function xw(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function jH(e,t,n){if(!xw(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)xw(e[s],n[o])&&(s-=1),o-=1;return s===-1}function NH(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(jH(h,t,n)){s.push(u);break}return s}function TT(e,t,n){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const d=ey(e,t,{...n,theme:c.theme}),p=Uu(d),f=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:d,state:p,theme:f}}),u=BH(...o.map(c=>c.tokens)),h=u[0].map((c,d)=>c.map((p,f)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),u.forEach((b,w)=>{const{content:C,explanation:_,offset:y,...v}=b[d][f];g.variants[s[w].color]=v}),g})),a=o[0].state?new fc(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return a&&Dp(h,a),h}function BH(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(c=>c[s]),u=t.map(()=>[]);t.forEach((c,d)=>c.push(u[d]));const h=o.map(()=>0),a=o.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(d=>d.content.length));for(let d=0;d<n;d++){const p=a[d];p.content.length===c?(u[d].push(p),h[d]+=1,a[d]=o[d][h[d]]):(u[d].push({...p,content:p.content.slice(0,c)}),a[d]={...p,content:p.content.slice(c),offset:p.offset+c})}}}return t}function Jh(e,t,n){let s,o,u,h,a,c;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 xn("`themes` option must not be empty");const b=TT(e,t,n);if(c=Uu(b),d&&J0!==d&&!g.find(y=>y.color===d))throw new xn(`\`themes\` option must contain the defaultColor key \`${d}\``);const w=g.map(y=>e.getTheme(y.theme)),C=g.map(y=>y.color);u=b.map(y=>y.map(v=>vH(v,C,p,d,f))),c&&Dp(u,c);const _=g.map(y=>Xh(y.theme,n));o=Cw(g,w,_,p,d,"fg",f),s=Cw(g,w,_,p,d,"bg",f),h=`shiki-themes ${w.map(y=>y.name).join(" ")}`,a=d?void 0:[o,s].join(";")}else if("theme"in n){const d=Xh(n.theme,n);u=ey(e,t,n);const p=e.getTheme(n.theme);s=mo(p.bg,d),o=mo(p.fg,d),h=p.name,c=Uu(u)}else throw new xn("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:h,rootStyle:a,grammarState:c}}function Cw(e,t,n,s,o,u,h){return e.map((a,c)=>{const d=mo(t[c][u],n[c])||"inherit",p=`${s+a.color}${u==="bg"?"-bg":""}:${d}`;if(c===0&&o){if(o===J0&&e.length>1){const f=e.findIndex(C=>C.color==="light"),g=e.findIndex(C=>C.color==="dark");if(f===-1||g===-1)throw new xn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=mo(t[f][u],n[f])||"inherit",w=mo(t[g][u],n[g])||"inherit";return`light-dark(${b}, ${w});${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 w of Zh(n))o=w.preprocess?.call(s,o,n)||o;let{tokens:u,fg:h,bg:a,themeName:c,rootStyle:d,grammarState:p}=Jh(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?u=HH(u):f==="never"&&(u=VH(u)),g&&(u=FH(u));const b={...s,get source(){return o}};for(const w of Zh(n))u=w.tokens?.call(b,u)||u;return zH(u,{...n,fg:h,bg:a,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},b,p)}function zH(e,t,n,s=Uu(e)){const o=Zh(t),u=[],h={type:"root",children:[]},{structure:a="classic",tabindex:c="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}`),c!==!1&&c!=null&&(d.tabindex=c.toString());for(const[C,_]of Object.entries(t.meta||{}))C.startsWith("_")||(d[C]=_);let p={type:"element",tagName:"pre",properties:d,children:[]},f={type:"element",tagName:"code",properties:{},children:u};const g=[],b={...n,structure:a,addClassToHast:ET,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((C,_)=>{_&&(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 S of C){let E={type:"element",tagName:"span",properties:{...S.htmlAttrs},children:[{type:"text",value:S.content}]};const T=L_(S.htmlStyle||Qh(S));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(b,E,_+1,v,y,S)||E;a==="inline"?h.children.push(E):a==="classic"&&y.children.push(E),v+=S.content.length}if(a==="classic"){for(const S of o)y=S?.line?.call(b,y,_+1)||y;g.push(y),u.push(y)}else a==="inline"&&g.push(y)}),a==="classic"){for(const C of o)f=C?.code?.call(b,f)||f;p.children.push(f);for(const C of o)p=C?.pre?.call(b,p)||p;h.children.push(p)}else if(a==="inline"){const C=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const S of h.children)S.type==="element"&&S.tagName==="br"?(C.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(S.type==="element"||S.type==="text")&&_.children.push(S);C.push(_);let v={type:"element",tagName:"code",properties:{},children:C};for(const S of o)v=S?.code?.call(b,v)||v;h.children=[];for(let S=0;S<v.children.length;S++){S>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=v.children[S];E.type==="element"&&h.children.push(...E.children)}}let w=h;for(const C of o)w=C?.root?.call(b,w)||w;return s&&Dp(w,s),w}function HH(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((u,h)=>{const c=!(u.fontStyle&&(u.fontStyle&Qn.Underline||u.fontStyle&Qn.Strikethrough));c&&u.content.match(/^\s+$/)&&t[h+1]?(o===void 0&&(o=u.offset),s+=u.content):s?(c?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 VH(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 FH(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=L_(o.htmlStyle||Qh(o)),h=L_(s.htmlStyle||Qh(s)),a=o.fontStyle&&(o.fontStyle&Qn.Underline||o.fontStyle&Qn.Strikethrough),c=s.fontStyle&&(s.fontStyle&Qn.Underline||s.fontStyle&Qn.Strikethrough);!a&&!c&&u===h?o.content+=s.content:n.push({...s})}return n})}const UH=cH;function WH(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>ep(e,u,h),codeToTokens:(u,h)=>Jh(e,u,h)};let o=UH(ep(e,t,n,s));for(const u of Zh(n))o=u.postprocess?.call(s,o,n)||o;return o}const ww={light:"#333333",dark:"#bbbbbb"},Ew={light:"#fffffe",dark:"#1e1e1e"},Rw="__shiki_resolved";function ny(e){if(e?.[Rw])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(c=>!c.name&&!c.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"?ww.light:ww.dark),n||(n=t.type==="light"?Ew.light:Ew.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 c=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?h(a):(u.set(a,c),c)}t.settings=t.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),d=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!d)return a;const p={...a,settings:{...a.settings}};if(c){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 c=h(t.colors[a]);t.colorReplacements[c]=t.colors[a],t.colors[a]=c}return Object.defineProperty(t,Rw,{enumerable:!1,writable:!1,value:!0}),t}async function LT(e){return Array.from(new Set((await Promise.all(e.filter(t=>!CT(t)).map(async t=>await xT(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function AT(e){return(await Promise.all(e.map(async n=>wT(n)?null:ny(await xT(n))))).filter(n=>!!n)}let qH=3;function GH(e,t=3){t>qH||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let El=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function OT(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 El(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class $H extends YB{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=ny(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=OT(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(c=>s.map(([d])=>d).includes(c)):!1).filter(u=>!s.includes(u));throw new El(`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 KH{_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 mu=0;function YH(e){mu+=1,e.warnings!==!1&&mu>=10&&mu%10===0&&console.warn(`[Shiki] ${mu} 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 El("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(ny),o=new KH(e.engine,n),u=new $H(o,s,n,e.langAlias);let h;function a(S){return OT(S,e.langAlias)}function c(S){y();const E=u.getGrammar(typeof S=="string"?S:S.name);if(!E)throw new El(`Language \`${S}\` not found, you may need to load it first`);return E}function d(S){if(S==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const E=u.getTheme(S);if(!E)throw new El(`Theme \`${S}\` not found, you may need to load it first`);return E}function p(S){y();const E=d(S);h!==S&&(u.setTheme(E),h=S);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return y(),u.getLoadedThemes()}function g(){return y(),u.getLoadedLanguages()}function b(...S){y(),u.loadLanguages(S.flat(1))}async function w(...S){return b(await LT(S))}function C(...S){y();for(const E of S.flat(1))u.loadTheme(E)}async function _(...S){return y(),C(await AT(S))}function y(){if(t)throw new El("Shiki instance has been disposed")}function v(){t||(t=!0,u.dispose(),mu-=1)}return{setTheme:p,getTheme:d,getLanguage:c,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:w,loadLanguageSync:b,loadTheme:_,loadThemeSync:C,dispose:v,[Symbol.dispose]:v}}async function XH(e){e.engine||GH("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([AT(e.themes||[]),LT(e.langs||[]),e.engine]);return YH({...e,themes:t,langs:n,engine:s})}async function QH(e){const t=await XH(e);return{getLastGrammarState:(...n)=>MH(t,...n),codeToTokensBase:(n,s)=>ey(t,n,s),codeToTokensWithThemes:(n,s)=>TT(t,n,s),codeToTokens:(n,s)=>Jh(t,n,s),codeToHast:(n,s)=>ep(t,n,s),codeToHtml:(n,s)=>WH(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ZH(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,CT(f))return[];const g=t[f];if(!g)throw new xn(`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(wT(f))return"none";if(typeof f=="string"){const g=n[f];if(!g)throw new xn(`Theme \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}const c=(u.themes??[]).map(f=>a(f)),d=(u.langs??[]).map(f=>h(f)),p=await QH({engine:u.engine??s(),...u,themes:c,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 MT=[{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"),[]))}],JH=Object.fromEntries(MT.map(e=>[e.id,e.import])),eV=Object.fromEntries(MT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),tV={...JH,...eV},nV=[{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"),[]))}],rV=Object.fromEntries(nV.map(e=>[e.id,e.import]));class ry extends Error{constructor(t){super(t),this.name="ShikiError"}}function sV(){return 2147483648}function iV(){return typeof performance<"u"?performance.now():Date.now()}const oV=(e,t)=>e+(t-e%t)%t;async function aV(e){let t,n;const s={};function o(b){n=b,s.HEAPU8=new Uint8Array(b),s.HEAPU32=new Uint32Array(b)}function u(b,w,C){s.HEAPU8.copyWithin(b,w,w+C)}function h(b){try{return t.grow(b-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(b){const w=s.HEAPU8.length;b=b>>>0;const C=sV();if(b>C)return!1;for(let _=1;_<=4;_*=2){let y=w*(1+.2/_);y=Math.min(y,b+100663296);const v=Math.min(C,oV(Math.max(b,y),65536));if(h(v))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(b,w,C=1024){const _=w+C;let y=w;for(;b[y]&&!(y>=_);)++y;if(y-w>16&&b.buffer&&c)return c.decode(b.subarray(w,y));let v="";for(;w<y;){let S=b[w++];if(!(S&128)){v+=String.fromCharCode(S);continue}const E=b[w++]&63;if((S&224)===192){v+=String.fromCharCode((S&31)<<6|E);continue}const T=b[w++]&63;if((S&240)===224?S=(S&15)<<12|E<<6|T:S=(S&7)<<18|E<<12|T<<6|b[w++]&63,S<65536)v+=String.fromCharCode(S);else{const A=S-65536;v+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return v}function p(b,w){return b?d(s.HEAPU8,b,w):""}const f={emscripten_get_now:iV,emscripten_memcpy_big:u,emscripten_resize_heap:a,fd_write:()=>0};async function g(){const w=await e({env:f,wasi_snapshot_preview1:f});t=w.memory,o(t.buffer),Object.assign(s,w),s.UTF8ToString=p}return await g(),s}var lV=Object.defineProperty,cV=(e,t,n)=>t in e?lV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tn=(e,t,n)=>cV(e,typeof t!="symbol"?t+"":t,n);let Dn=null;function uV(e){throw new ry(e.UTF8ToString(e.getLastOnigError()))}class Pp{constructor(t){Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16Value"),Tn(this,"utf8Value"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16");const n=t.length,s=Pp._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 c=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 b=t.charCodeAt(d+1);b>=56320&&b<=57343&&(f=(p-55296<<10)+65536|b-56320,g=!0)}o&&(u[d]=c,g&&(u[d+1]=c),f<=127?h[c+0]=d:f<=2047?(h[c+0]=d,h[c+1]=d):f<=65535?(h[c+0]=d,h[c+1]=d,h[c+2]=d):(h[c+0]=d,h[c+1]=d,h[c+2]=d,h[c+3]=d)),f<=127?a[c++]=f:f<=2047?(a[c++]=192|(f&1984)>>>6,a[c++]=128|(f&63)>>>0):f<=65535?(a[c++]=224|(f&61440)>>>12,a[c++]=128|(f&4032)>>>6,a[c++]=128|(f&63)>>>0):(a[c++]=240|(f&1835008)>>>18,a[c++]=128|(f&258048)>>>12,a[c++]=128|(f&4032)>>>6,a[c++]=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 c=t.charCodeAt(s+1);c>=56320&&c<=57343&&(h=(u-55296<<10)+65536|c-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 Ip=class As{constructor(t){if(Tn(this,"id",++As.LAST_ID),Tn(this,"_onigBinding"),Tn(this,"content"),Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16"),Tn(this,"ptr"),!Dn)throw new ry("Must invoke loadWasm first.");this._onigBinding=Dn,this.content=t;const n=new Pp(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!As._sharedPtrInUse?(As._sharedPtr||(As._sharedPtr=Dn.omalloc(1e4)),As._sharedPtrInUse=!0,Dn.HEAPU8.set(n.utf8Value,As._sharedPtr),this.ptr=As._sharedPtr):this.ptr=n.createString(Dn)}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===As._sharedPtr?As._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Tn(Ip,"LAST_ID",0);Tn(Ip,"_sharedPtr",0);Tn(Ip,"_sharedPtrInUse",!1);let DT=Ip;class dV{constructor(t){if(Tn(this,"_onigBinding"),Tn(this,"_ptr"),!Dn)throw new ry("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,c=t.length;a<c;a++){const d=new Pp(t[a]);n[a]=d.createString(Dn),s[a]=d.utf8Length}const o=Dn.omalloc(4*t.length);Dn.HEAPU32.set(n,o/4);const u=Dn.omalloc(4*t.length);Dn.HEAPU32.set(s,u/4);const h=Dn.createOnigScanner(o,u,t.length);for(let a=0,c=t.length;a<c;a++)Dn.ofree(n[a]);Dn.ofree(u),Dn.ofree(o),h===0&&uV(Dn),this._onigBinding=Dn,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 DT(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 c=h/4;const d=a[c++],p=a[c++],f=[];for(let g=0;g<p;g++){const b=t.convertUtf8OffsetToUtf16(a[c++]),w=t.convertUtf8OffsetToUtf16(a[c++]);f[g]={start:b,end:w,length:w-b}}return{index:d,captureIndices:f}}}function fV(e){return typeof e.instantiator=="function"}function hV(e){return typeof e.default=="function"}function pV(e){return typeof e.data<"u"}function mV(e){return typeof Response<"u"&&e instanceof Response}function gV(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 oh;function vV(e){if(oh)return oh;async function t(){Dn=await aV(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),fV(s)?s=await s.instantiator(n):hV(s)?s=await s.default(n):(pV(s)&&(s=s.data),mV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await _V(s)(n):s=await yV(s)(n):gV(s)?s=await Nv(s)(n):s instanceof WebAssembly.Module?s=await Nv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Nv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return oh=t(),oh}function Nv(e){return t=>WebAssembly.instantiate(e,t)}function _V(e){return t=>WebAssembly.instantiateStreaming(e,t)}function yV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function bV(e){return e&&await vV(e),{createScanner(t){return new dV(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new DT(t)}}}const SV=ZH({langs:tV,themes:rV,engine:()=>bV(te(()=>import("./wasm-CG6Dc4jp.js"),[]))});let ah=null,lh=null;const xV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function CV(){return ah||lh||(lh=SV({themes:["github-dark"],langs:xV}),ah=await lh,ah)}async function wV(e,t){const n=await CV(),s=EV(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 EV(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 RV(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 kV({filePath:e,content:t,isLoading:n,error:s,onClose:o}){const[u,h]=k.useState(null),[a,c]=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}c(!0);const g=RV(e);wV(t.content,g).then(b=>{h(b),c(!1)}).catch(()=>{h(null),c(!1)})},[t,e]),!e)return x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(n)return x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(s)return x.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s.message});if(!t)return x.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 x.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[x.jsx("p",{children:"Binary file"}),x.jsxs("p",{className:"text-xs",children:[(t.size/1024).toFixed(1)," KB"]})]});if(t.mimeType.startsWith("image/"))return x.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[x.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:[x.jsx("span",{className:"text-muted-foreground truncate",title:e,children:e.split("/").pop()||e}),x.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:x.jsx(Ce,{icon:go,size:14,strokeWidth:2})})]}),x.jsx("div",{className:"flex flex-1 items-center justify-center p-4 bg-[#0d1117]",children:x.jsx("img",{src:t.content,alt:e,className:"max-w-full max-h-full object-contain"})})]});const f=e.split("/").pop()||e;return x.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[x.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:[x.jsx("span",{className:"text-muted-foreground truncate flex-1",title:e,children:f}),t.truncated&&x.jsxs("span",{className:"text-yellow-500",children:["Truncated (",t.lineCount.toLocaleString()," lines)"]}),x.jsxs("span",{className:"text-muted-foreground",children:[(t.size/1024).toFixed(1)," KB"]}),x.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[x.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked),className:"w-3 h-3"}),"Wrap"]}),x.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:x.jsx(Ce,{icon:go,size:14,strokeWidth:2})})]}),x.jsx(sd,{className:"flex-1 min-h-0",children:a?x.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm",children:"Highlighting..."}):u?x.jsx("div",{className:Be("text-xs [&_pre]:!bg-transparent [&_pre]:!m-0 [&_pre]:!p-2 [&_code]:!bg-transparent",d?"[&_pre]:whitespace-pre-wrap [&_pre]:break-all":"[&_pre]:whitespace-pre"),dangerouslySetInnerHTML:{__html:u}}):x.jsx("pre",{className:Be("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function TV({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=iB(e),{data:a,isLoading:c,error:d}=iI(t),{data:p,isLoading:f,error:g}=oI(t,n),b=k.useCallback(_=>{o(_)},[o]),w=k.useCallback(()=>{o(null)},[o]),C=k.useCallback(_=>{u(_)},[u]);return t?c?x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):d?x.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message}):x.jsxs(Qo,{direction:"horizontal",className:"h-full",children:[x.jsx(Qr,{defaultSize:65,minSize:30,className:"overflow-hidden",children:x.jsx(kV,{filePath:n,content:p??null,isLoading:f,error:g,onClose:w})}),x.jsx(Zo,{withHandle:!0}),x.jsx(Qr,{defaultSize:35,minSize:15,children:x.jsx(sd,{className:"h-full",children:x.jsx(aB,{entries:a?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:b,onToggleDir:C,onCollapseAll:h})})})]}):x.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}function LV({...e}){return x.jsx(v9,{"data-slot":"dropdown-menu",...e})}function AV({...e}){return x.jsx(b9,{"data-slot":"dropdown-menu-trigger",...e})}function OV({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return x.jsx(i9,{children:x.jsx(o9,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:x.jsx(r9,{"data-slot":"dropdown-menu-content",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...u})})})}function MV({...e}){return x.jsx(l9,{"data-slot":"dropdown-menu-radio-group",...e})}function DV({className:e,children:t,...n}){return x.jsxs(u9,{"data-slot":"dropdown-menu-radio-item",className:Be("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[x.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:x.jsx(d9,{children:x.jsx(Ce,{icon:ka,strokeWidth:2})})}),t]})}const PT=vs("/tasks/$taskId")({component:IV}),kw={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},PV={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 IV(){const{taskId:e}=PT.useParams(),t=vo(),n=T3(),{data:s,isLoading:o}=GR(e),u=D0(),h=eI(),{tab:a,setTab:c}=Q7(e),d=Ck(),p=wk(),f=Ek(),{data:g}=KR(),{data:b}=YR(),{data:w}=Z7(s?.linearTicketId??null),C=n.state,_=C?.planMode&&C?.description?C.description:void 0,[y,v]=k.useState(!1),[S,E]=k.useState(null),[T,A]=k.useState(!1),[M,L]=k.useState(!1),[D,U]=k.useState(null),[z,W]=k.useState(!1),[j,Y]=k.useState(!1),[$,V]=k.useState(null),[q,H]=k.useState(!1),[P,B]=k.useState(!1),[I,G]=k.useState(!1),{terminals:K,writeToTerminal:J}=W0();k.useEffect(()=>{if(M){const ae=setTimeout(()=>L(!1),3e3);return()=>clearTimeout(ae)}},[M]),k.useEffect(()=>{if(j){const ae=setTimeout(()=>Y(!1),3e3);return()=>clearTimeout(ae)}},[j]),k.useEffect(()=>{if(P){const ae=setTimeout(()=>B(!1),3e3);return()=>clearTimeout(ae)}},[P]);const Z=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){E(null),L(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),L(!0)}catch(ae){const xe=ae instanceof Error?ae.message:"Sync failed";E(xe),A(!0)}}},ee=()=>{if(!s||!S)return"";const ae=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${ae} | Error: ${S} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${ae} branch`},X=()=>{if(!s||!D)return"";const ae=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${ae} | Error: ${D} | Steps: 1) Check git status in both worktree and parent 2) Resolve any conflicts 3) Ensure worktree changes are committed 4) Retry merge to ${ae} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},F=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){U(null),Y(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),Y(!0),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(ae){const xe=ae instanceof Error?ae.message:"Merge failed";U(xe),W(!0)}}},se=async()=>{if(s?.repoPath){V(null),B(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),B(!0)}catch(ae){const xe=ae instanceof Error?ae.message:"Sync parent failed";V(xe),H(!0)}}},re=()=>{if(!s||!$)return"";const ae=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${ae} | Error: ${$} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${ae}`},ne=K.find(ae=>ae.cwd===s?.worktreePath),oe=()=>{if(!ne)return;const ae=ee();J(ne.id,ae+"\r"),A(!1)},ce=()=>{if(!ne)return;const xe=`claude -p "${ee().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,xe),A(!1)},_e=()=>{if(!ne)return;const ae=X();J(ne.id,ae+"\r"),W(!1)},ve=()=>{if(!ne)return;const xe=`claude -p "${X().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,xe),W(!1)},he=()=>{if(!ne)return;const ae=re();J(ne.id,ae+"\r"),H(!1)},fe=()=>{if(!ne)return;const xe=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,xe),H(!1)},De=()=>{G(!0)},Ae=()=>{if(!s?.worktreePath)return;const ae=rw(s.worktreePath,g,b);window.open(ae,"_blank"),G(!1)},Pe=()=>{if(!s?.repoPath)return;const ae=rw(s.repoPath,g,b);window.open(ae,"_blank"),G(!1)},Se=ae=>{s&&u.mutate({taskId:s.id,updates:{status:ae}})},be=()=>{s&&h.mutate(s.id,{onSuccess:()=>{t({to:"/tasks"})}})};return o?x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):s?x.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[x.jsxs("div",{className:"flex-1",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("h1",{className:"text-sm font-medium",children:s.title}),x.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>v(!0),title:"Task settings",children:x.jsx(Ce,{icon:U2,size:14,strokeWidth:2})})]}),x.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[x.jsx("span",{children:s.repoName}),x.jsx(Ce,{icon:Jv,size:12,strokeWidth:2}),x.jsx("span",{className:"font-mono",children:s.branch}),s.prUrl&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-muted-foreground/50",children:"•"}),x.jsxs("a",{href:s.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:ae=>ae.stopPropagation(),children:[x.jsx(Ce,{icon:Q_,size:14,strokeWidth:2}),x.jsxs("span",{children:["#",s.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),s.linearTicketUrl&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-muted-foreground/50",children:"•"}),x.jsxs("a",{href:s.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:ae=>ae.stopPropagation(),title:w?.title,children:[x.jsx(Ce,{icon:Z_,size:14,strokeWidth:2}),x.jsx("span",{children:s.linearTicketId}),w?.status&&x.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",w.status,")"]})]})]})]})]}),x.jsxs(LV,{children:[x.jsx(AV,{render:x.jsx(ze,{variant:"ghost",size:"sm",className:PV[s.status]}),children:kw[s.status]}),x.jsx(OV,{align:"end",children:x.jsx(MV,{value:s.status,onValueChange:Se,children:Object.entries(kw).map(([ae,xe])=>x.jsx(DV,{value:ae,children:xe},ae))})})]}),x.jsx(ze,{variant:"ghost",size:"icon-sm",onClick:Z,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:x.jsx(Ce,{icon:M2,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),x.jsx(ze,{variant:"ghost",size:"icon-sm",onClick:F,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:x.jsx(Ce,{icon:j2,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),x.jsx(ze,{variant:"ghost",size:"icon-sm",onClick:se,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:x.jsx(Ce,{icon:V2,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),x.jsx(ze,{variant:"ghost",size:"icon-sm",onClick:De,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:x.jsx(Ce,{icon:s4,size:16,strokeWidth:2})}),M&&x.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),j&&x.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),P&&x.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),x.jsxs(id,{children:[x.jsx(od,{render:x.jsx(ze,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:x.jsx(Ce,{icon:qu,size:16,strokeWidth:2})}),x.jsxs(ad,{children:[x.jsxs(ld,{children:[x.jsx(ud,{children:"Delete Task"}),x.jsxs(dd,{children:['This will permanently delete "',s.title,'", close its terminal, and remove its worktree. This action cannot be undone.']})]}),x.jsxs(cd,{children:[x.jsx(fd,{children:"Cancel"}),x.jsx(rk,{onClick:be,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),x.jsxs(Qo,{direction:"horizontal",className:"min-h-0 flex-1",children:[x.jsx(Qr,{defaultSize:50,minSize:30,children:x.jsx(J7,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,planModeDescription:_,startupScript:s.startupScript})}),x.jsx(Zo,{withHandle:!0}),x.jsx(Qr,{defaultSize:50,minSize:30,children:x.jsxs(wp,{value:a,onValueChange:c,className:"flex h-full flex-col",children:[x.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:x.jsxs(Ep,{variant:"line",children:[x.jsxs(po,{value:"diff",children:[x.jsx(Ce,{icon:VM,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),x.jsxs(po,{value:"browser",children:[x.jsx(Ce,{icon:NM,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),x.jsxs(po,{value:"files",children:[x.jsx(Ce,{icon:_s,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),x.jsx(ma,{value:"diff",className:"flex-1 overflow-hidden",children:x.jsx(nB,{taskId:s.id,worktreePath:s.worktreePath})}),x.jsx(ma,{value:"browser",className:"flex-1 overflow-hidden",children:x.jsx(sB,{taskId:s.id})}),x.jsx(ma,{value:"files",className:"flex-1 overflow-hidden",children:x.jsx(TV,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),x.jsx(Wk,{task:s,open:y,onOpenChange:v}),x.jsx(Ms,{open:I,onOpenChange:G,children:x.jsxs(Ds,{className:"sm:max-w-sm",children:[x.jsxs(vi,{children:[x.jsx(_i,{children:"Open in VS Code"}),x.jsx(ra,{children:"Choose which folder to open"})]}),x.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[x.jsxs(ze,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Ae,disabled:!s.worktreePath,children:[x.jsx(Ce,{icon:Jv,size:16,strokeWidth:2,className:"mr-2"}),"Worktree",x.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.branch})]}),x.jsxs(ze,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Pe,disabled:!s.repoPath,children:[x.jsx(Ce,{icon:_s,size:16,strokeWidth:2,className:"mr-2"}),"Repository",x.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.repoName})]})]})]})}),x.jsx(Ms,{open:T,onOpenChange:A,children:x.jsxs(Ds,{className:"sm:max-w-md",children:[x.jsxs(vi,{children:[x.jsx(_i,{className:"text-destructive",children:"Sync Failed"}),x.jsx(ra,{children:"An error occurred while syncing with upstream."})]}),x.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:S}),x.jsxs(pa,{className:"mt-4 gap-2",children:[x.jsx(ze,{variant:"outline",onClick:()=>A(!1),children:"Close"}),x.jsx(ze,{variant:"outline",onClick:oe,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),x.jsx(ze,{variant:"destructive",onClick:ce,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),x.jsx(Ms,{open:z,onOpenChange:W,children:x.jsxs(Ds,{className:"sm:max-w-md",children:[x.jsxs(vi,{children:[x.jsx(_i,{className:"text-destructive",children:"Merge Failed"}),x.jsxs(ra,{children:["An error occurred while merging to ",s?.baseBranch||"main","."]})]}),x.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:D}),x.jsxs(pa,{className:"mt-4 gap-2",children:[x.jsx(ze,{variant:"outline",onClick:()=>W(!1),children:"Close"}),x.jsx(ze,{variant:"outline",onClick:_e,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),x.jsx(ze,{variant:"destructive",onClick:ve,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),x.jsx(Ms,{open:q,onOpenChange:H,children:x.jsxs(Ds,{className:"sm:max-w-md",children:[x.jsxs(vi,{children:[x.jsx(_i,{className:"text-destructive",children:"Sync Parent Failed"}),x.jsx(ra,{children:"An error occurred while syncing the parent repository with origin."})]}),x.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:$}),x.jsxs(pa,{className:"mt-4 gap-2",children:[x.jsx(ze,{variant:"outline",onClick:()=>H(!1),children:"Close"}),x.jsx(ze,{variant:"outline",onClick:he,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),x.jsx(ze,{variant:"destructive",onClick:fe,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})})]}):x.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[x.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),x.jsx(Wn,{to:"/tasks",children:x.jsx(ze,{variant:"outline",children:"Back to Tasks"})})]})}const IT=vs("/repositories/$repoId")({component:jV});function jV(){const{repoId:e}=IT.useParams(),t=vo(),{data:n,isLoading:s,error:o}=_I(e),u=yI(),h=QR(),[a,c]=k.useState(""),[d,p]=k.useState(""),[f,g]=k.useState(""),[b,w]=k.useState(!1);k.useEffect(()=>{n&&(c(n.displayName),p(n.startupScript||""),g(n.copyFiles||""),w(!1))},[n]),k.useEffect(()=>{if(n){const y=a!==n.displayName||d!==(n.startupScript||"")||f!==(n.copyFiles||"");w(y)}},[a,d,f,n]);const C=()=>{n&&u.mutate({id:n.id,updates:{displayName:a.trim()||n.path.split("/").pop()||"repo",startupScript:d.trim()||null,copyFiles:f.trim()||null}})},_=async()=>{n&&(await h.mutateAsync(n.id),t({to:"/repositories"}))};return s?x.jsx("div",{className:"flex h-full items-center justify-center",children:x.jsx(Ce,{icon:Jr,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):o||!n?x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2",children:x.jsxs(Wn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[x.jsx(Ce,{icon:Ox,size:16,strokeWidth:2}),"Repositories"]})}),x.jsx("div",{className:"flex flex-1 items-center justify-center",children:x.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[x.jsx(Ce,{icon:Jl,size:20,strokeWidth:2}),x.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Wn,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[x.jsx(Ce,{icon:Ox,size:16,strokeWidth:2}),"Repositories"]}),x.jsx("span",{className:"text-muted-foreground",children:"/"}),x.jsx("span",{className:"text-sm font-medium",children:n.displayName})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(id,{children:[x.jsxs(od,{render:x.jsx(ze,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive"}),children:[x.jsx(Ce,{icon:qu,size:14,strokeWidth:2,"data-slot":"icon"}),"Delete"]}),x.jsxs(ad,{children:[x.jsxs(ld,{children:[x.jsx(ud,{children:"Delete Repository"}),x.jsxs(dd,{children:['This will remove "',n.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),x.jsxs(cd,{children:[x.jsx(fd,{children:"Cancel"}),x.jsx(ze,{variant:"destructive",onClick:_,children:"Delete"})]})]})]}),x.jsx(ze,{size:"sm",onClick:C,disabled:!b||u.isPending,children:u.isPending?"Saving...":"Save"})]})]}),x.jsx("div",{className:"flex-1 overflow-auto p-4",children:x.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[x.jsx(Ce,{icon:_s,size:14,strokeWidth:2}),x.jsx("span",{className:"font-mono",children:n.path})]}),x.jsxs(Cp,{children:[x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"displayName",children:"Display Name"}),x.jsx(qt,{id:"displayName",value:a,onChange:y=>c(y.target.value),placeholder:n.path.split("/").pop()||"My Project"})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"startupScript",children:"Startup Script"}),x.jsx(xp,{id:"startupScript",value:d,onChange:y=>p(y.target.value),placeholder:"npm install && npm run dev",rows:3}),x.jsx(gi,{children:"Command to run in the terminal when creating a worktree."})]}),x.jsxs(In,{children:[x.jsx(jn,{htmlFor:"copyFiles",children:"Copy Files"}),x.jsx(qt,{id:"copyFiles",value:f,onChange:y=>g(y.target.value),placeholder:".env, config.local.json"}),x.jsx(gi,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]})]})})]})}const NV=gj.update({id:"/",path:"/",getParentRoute:()=>Us}),BV=Rj.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>Us}),zV=EN.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>Us}),HV=O7.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>Us}),VV=P7.update({id:"/settings/",path:"/settings/",getParentRoute:()=>Us}),FV=W7.update({id:"/review/",path:"/review/",getParentRoute:()=>Us}),UV=G7.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>Us}),WV=PT.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>Us}),qV=IT.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>Us}),GV={IndexRoute:NV,RepositoriesRepoIdRoute:qV,TasksTaskIdRoute:WV,RepositoriesIndexRoute:UV,ReviewIndexRoute:FV,SettingsIndexRoute:VV,TasksIndexRoute:HV,TerminalsIndexRoute:zV,WorktreesIndexRoute:BV},$V=Us._addFileChildren(GV)._addFileTypes(),KV=new Q3({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),YV=w3({routeTree:$V});$L.createRoot(document.getElementById("root")).render(x.jsx(k.StrictMode,{children:x.jsx(Z3,{client:KV,children:x.jsx(k3,{router:YV})})}));