var NF=Object.defineProperty;var IF=(e,t,n)=>t in e?NF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $l=(e,t,n)=>(IF(e,typeof t!="symbol"?t+"":t,n),n),gy=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y=(e,t,n)=>(gy(e,t,"read from private field"),n?n.call(e):t.get(e)),Ee=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_e=(e,t,n,r)=>(gy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var mp=(e,t,n,r)=>({set _(i){_e(e,t,i,n)},get _(){return Y(e,t,r)}}),Ue=(e,t,n)=>(gy(e,t,"access private method"),n);/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * Author: André Tabarra (https://github.com/tabarra)
 * Repository: https://github.com/tabarra/txAdmin
 * txAdmin is a free open source software provided under the license below.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * MIT License
 * 
 * Copyright (c) 2019-2024 André Tabarra <maintainer@txadmin.gg>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * This distribution also includes third party code under their own licenses, which
 * can be found in ../THIRD-PARTY-LICENSES.txt or their respective repositories.
 * Attribution for non-code assets can be found at the bottom of ../README.md or at
 * the top of the respective file.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */function jF(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var vo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n7={exports:{}},j0={},r7={exports:{}},tt={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Mf=Symbol.for("react.element"),BF=Symbol.for("react.portal"),FF=Symbol.for("react.fragment"),zF=Symbol.for("react.strict_mode"),HF=Symbol.for("react.profiler"),WF=Symbol.for("react.provider"),UF=Symbol.for("react.context"),VF=Symbol.for("react.forward_ref"),qF=Symbol.for("react.suspense"),KF=Symbol.for("react.memo"),GF=Symbol.for("react.lazy"),K3=Symbol.iterator;function YF(e){return e===null||typeof e!="object"?null:(e=K3&&e[K3]||e["@@iterator"],typeof e=="function"?e:null)}var i7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},s7=Object.assign,o7={};function vu(e,t,n){this.props=e,this.context=t,this.refs=o7,this.updater=n||i7}vu.prototype.isReactComponent={};vu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function a7(){}a7.prototype=vu.prototype;function u2(e,t,n){this.props=e,this.context=t,this.refs=o7,this.updater=n||i7}var d2=u2.prototype=new a7;d2.constructor=u2;s7(d2,vu.prototype);d2.isPureReactComponent=!0;var G3=Array.isArray,l7=Object.prototype.hasOwnProperty,h2={current:null},c7={key:!0,ref:!0,__self:!0,__source:!0};function u7(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)l7.call(t,r)&&!c7.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:Mf,type:e,key:s,ref:a,props:i,_owner:h2.current}}function XF(e,t){return{$$typeof:Mf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function f2(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mf}function QF(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Y3=/\/+/g;function vy(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QF(""+e.key):t.toString(36)}function Sm(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Mf:case BF:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+vy(a,0):r,G3(i)?(n="",e!=null&&(n=e.replace(Y3,"$&/")+"/"),Sm(i,t,n,"",function(c){return c})):i!=null&&(f2(i)&&(i=XF(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(Y3,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",G3(e))for(var o=0;o<e.length;o++){s=e[o];var l=r+vy(s,o);a+=Sm(s,t,n,l,i)}else if(l=YF(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=r+vy(s,o++),a+=Sm(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function gp(e,t,n){if(e==null)return e;var r=[],i=0;return Sm(e,r,"","",function(s){return t.call(n,s,i++)}),r}function JF(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zn={current:null},Cm={transition:null},ZF={ReactCurrentDispatcher:Zn,ReactCurrentBatchConfig:Cm,ReactCurrentOwner:h2};tt.Children={map:gp,forEach:function(e,t,n){gp(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gp(e,function(){t++}),t},toArray:function(e){return gp(e,function(t){return t})||[]},only:function(e){if(!f2(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};tt.Component=vu;tt.Fragment=FF;tt.Profiler=HF;tt.PureComponent=u2;tt.StrictMode=zF;tt.Suspense=qF;tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZF;tt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=s7({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=h2.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)l7.call(t,l)&&!c7.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:Mf,type:e.type,key:i,ref:s,props:r,_owner:a}};tt.createContext=function(e){return e={$$typeof:UF,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:WF,_context:e},e.Consumer=e};tt.createElement=u7;tt.createFactory=function(e){var t=u7.bind(null,e);return t.type=e,t};tt.createRef=function(){return{current:null}};tt.forwardRef=function(e){return{$$typeof:VF,render:e}};tt.isValidElement=f2;tt.lazy=function(e){return{$$typeof:GF,_payload:{_status:-1,_result:e},_init:JF}};tt.memo=function(e,t){return{$$typeof:KF,type:e,compare:t===void 0?null:t}};tt.startTransition=function(e){var t=Cm.transition;Cm.transition={};try{e()}finally{Cm.transition=t}};tt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};tt.useCallback=function(e,t){return Zn.current.useCallback(e,t)};tt.useContext=function(e){return Zn.current.useContext(e)};tt.useDebugValue=function(){};tt.useDeferredValue=function(e){return Zn.current.useDeferredValue(e)};tt.useEffect=function(e,t){return Zn.current.useEffect(e,t)};tt.useId=function(){return Zn.current.useId()};tt.useImperativeHandle=function(e,t,n){return Zn.current.useImperativeHandle(e,t,n)};tt.useInsertionEffect=function(e,t){return Zn.current.useInsertionEffect(e,t)};tt.useLayoutEffect=function(e,t){return Zn.current.useLayoutEffect(e,t)};tt.useMemo=function(e,t){return Zn.current.useMemo(e,t)};tt.useReducer=function(e,t,n){return Zn.current.useReducer(e,t,n)};tt.useRef=function(e){return Zn.current.useRef(e)};tt.useState=function(e){return Zn.current.useState(e)};tt.useSyncExternalStore=function(e,t,n){return Zn.current.useSyncExternalStore(e,t,n)};tt.useTransition=function(){return Zn.current.useTransition()};tt.version="18.2.0";r7.exports=tt;var x=r7.exports;const Ye=vn(x),d7=jF({__proto__:null,default:Ye},[x]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ez=x,tz=Symbol.for("react.element"),nz=Symbol.for("react.fragment"),rz=Object.prototype.hasOwnProperty,iz=ez.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sz={key:!0,ref:!0,__self:!0,__source:!0};function h7(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)rz.call(t,r)&&!sz.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:tz,type:e,key:s,ref:a,props:i,_owner:iz.current}}j0.Fragment=nz;j0.jsx=h7;j0.jsxs=h7;n7.exports=j0;var v=n7.exports;const oz=x.createContext(null),yy={didCatch:!1,error:null};class f7 extends x.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=yy}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(yy)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&az(t.resetKeys,i)){var s,a;(s=(a=this.props).onReset)===null||s===void 0||s.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(yy)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:a}=this.state;let o=t;if(s){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(r)o=x.createElement(r,l);else if(i===null||x.isValidElement(i))o=i;else throw a}return x.createElement(oz.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function az(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var ab={},p7={exports:{}},Lr={},m7={exports:{}},g7={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t(j,L){var A=j.length;j.push(L);e:for(;0<A;){var F=A-1>>>1,H=j[F];if(0<i(H,L))j[F]=L,j[A]=H,A=F;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var L=j[0],A=j.pop();if(A!==L){j[0]=A;e:for(var F=0,H=j.length,B=H>>>1;F<B;){var G=2*(F+1)-1,J=j[G],W=G+1,U=j[W];if(0>i(J,A))W<H&&0>i(U,J)?(j[F]=U,j[W]=A,F=W):(j[F]=J,j[G]=A,F=G);else if(W<H&&0>i(U,A))j[F]=U,j[W]=A,F=W;else break e}}return L}function i(j,L){var A=j.sortIndex-L.sortIndex;return A!==0?A:j.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],d=1,u=null,h=3,f=!1,b=!1,y=!1,m=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(j){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=j)r(c),L.sortIndex=L.expirationTime,t(l,L);else break;L=n(c)}}function S(j){if(y=!1,_(j),!b)if(n(l)!==null)b=!0,N(k);else{var L=n(c);L!==null&&I(S,L.startTime-j)}}function k(j,L){b=!1,y&&(y=!1,p(w),w=-1),f=!0;var A=h;try{for(_(L),u=n(l);u!==null&&(!(u.expirationTime>L)||j&&!M());){var F=u.callback;if(typeof F=="function"){u.callback=null,h=u.priorityLevel;var H=F(u.expirationTime<=L);L=e.unstable_now(),typeof H=="function"?u.callback=H:u===n(l)&&r(l),_(L)}else r(l);u=n(l)}if(u!==null)var B=!0;else{var G=n(c);G!==null&&I(S,G.startTime-L),B=!1}return B}finally{u=null,h=A,f=!1}}var C=!1,T=null,w=-1,E=5,$=-1;function M(){return!(e.unstable_now()-$<E)}function P(){if(T!==null){var j=e.unstable_now();$=j;var L=!0;try{L=T(!0,j)}finally{L?D():(C=!1,T=null)}}else C=!1}var D;if(typeof g=="function")D=function(){g(P)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,O=R.port2;R.port1.onmessage=P,D=function(){O.postMessage(null)}}else D=function(){m(P,0)};function N(j){T=j,C||(C=!0,D())}function I(j,L){w=m(function(){j(e.unstable_now())},L)}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(j){j.callback=null},e.unstable_continueExecution=function(){b||f||(b=!0,N(k))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(j){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var A=h;h=L;try{return j()}finally{h=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,L){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var A=h;h=j;try{return L()}finally{h=A}},e.unstable_scheduleCallback=function(j,L,A){var F=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?F+A:F):A=F,j){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=A+H,j={id:d++,callback:L,priorityLevel:j,startTime:A,expirationTime:H,sortIndex:-1},A>F?(j.sortIndex=A,t(c,j),n(l)===null&&j===n(c)&&(y?(p(w),w=-1):y=!0,I(S,A-F))):(j.sortIndex=H,t(l,j),b||f||(b=!0,N(k))),j},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(j){var L=h;return function(){var A=h;h=L;try{return j.apply(this,arguments)}finally{h=A}}}})(g7);m7.exports=g7;var lz=m7.exports;/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var v7=x,Rr=lz;function ue(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var y7=new Set,yh={};function rl(e,t){Hc(e,t),Hc(e+"Capture",t)}function Hc(e,t){for(yh[e]=t,e=0;e<t.length;e++)y7.add(t[e])}var Ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lb=Object.prototype.hasOwnProperty,cz=/^[: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]*$/,X3={},Q3={};function uz(e){return lb.call(Q3,e)?!0:lb.call(X3,e)?!1:cz.test(e)?Q3[e]=!0:(X3[e]=!0,!1)}function dz(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hz(e,t,n,r){if(t===null||typeof t>"u"||dz(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function er(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var Dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Dn[e]=new er(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Dn[t]=new er(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Dn[e]=new er(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Dn[e]=new er(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Dn[e]=new er(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Dn[e]=new er(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Dn[e]=new er(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Dn[e]=new er(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Dn[e]=new er(e,5,!1,e.toLowerCase(),null,!1,!1)});var p2=/[\-:]([a-z])/g;function m2(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(p2,m2);Dn[t]=new er(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(p2,m2);Dn[t]=new er(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(p2,m2);Dn[t]=new er(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Dn[e]=new er(e,1,!1,e.toLowerCase(),null,!1,!1)});Dn.xlinkHref=new er("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Dn[e]=new er(e,1,!1,e.toLowerCase(),null,!0,!0)});function g2(e,t,n,r){var i=Dn.hasOwnProperty(t)?Dn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hz(t,n,i,r)&&(n=null),r||i===null?uz(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var zs=v7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vp=Symbol.for("react.element"),ql=Symbol.for("react.portal"),Kl=Symbol.for("react.fragment"),v2=Symbol.for("react.strict_mode"),cb=Symbol.for("react.profiler"),_7=Symbol.for("react.provider"),b7=Symbol.for("react.context"),y2=Symbol.for("react.forward_ref"),ub=Symbol.for("react.suspense"),db=Symbol.for("react.suspense_list"),_2=Symbol.for("react.memo"),to=Symbol.for("react.lazy"),x7=Symbol.for("react.offscreen"),J3=Symbol.iterator;function rd(e){return e===null||typeof e!="object"?null:(e=J3&&e[J3]||e["@@iterator"],typeof e=="function"?e:null)}var Qt=Object.assign,_y;function jd(e){if(_y===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_y=t&&t[1]||""}return`
`+_y+e}var by=!1;function xy(e,t){if(!e||by)return"";by=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),s=r.stack.split(`
`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{by=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?jd(e):""}function fz(e){switch(e.tag){case 5:return jd(e.type);case 16:return jd("Lazy");case 13:return jd("Suspense");case 19:return jd("SuspenseList");case 0:case 2:case 15:return e=xy(e.type,!1),e;case 11:return e=xy(e.type.render,!1),e;case 1:return e=xy(e.type,!0),e;default:return""}}function hb(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kl:return"Fragment";case ql:return"Portal";case cb:return"Profiler";case v2:return"StrictMode";case ub:return"Suspense";case db:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b7:return(e.displayName||"Context")+".Consumer";case _7:return(e._context.displayName||"Context")+".Provider";case y2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _2:return t=e.displayName||null,t!==null?t:hb(e.type)||"Memo";case to:t=e._payload,e=e._init;try{return hb(e(t))}catch{}}return null}function pz(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hb(t);case 8:return t===v2?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Po(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function w7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mz(e){var t=w7(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yp(e){e._valueTracker||(e._valueTracker=mz(e))}function S7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=w7(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function og(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fb(e,t){var n=t.checked;return Qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Z3(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Po(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function C7(e,t){t=t.checked,t!=null&&g2(e,"checked",t,!1)}function pb(e,t){C7(e,t);var n=Po(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?mb(e,t.type,n):t.hasOwnProperty("defaultValue")&&mb(e,t.type,Po(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ek(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function mb(e,t,n){(t!=="number"||og(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bd=Array.isArray;function lc(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Po(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gb(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ue(91));return Qt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tk(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ue(92));if(Bd(n)){if(1<n.length)throw Error(ue(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Po(n)}}function k7(e,t){var n=Po(t.value),r=Po(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function nk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function E7(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vb(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?E7(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _p,T7=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_p=_p||document.createElement("div"),_p.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_p.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _h(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gz=["Webkit","ms","Moz","O"];Object.keys(Qd).forEach(function(e){gz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qd[t]=Qd[e]})});function $7(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qd.hasOwnProperty(e)&&Qd[e]?(""+t).trim():t+"px"}function M7(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=$7(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var vz=Qt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yb(e,t){if(t){if(vz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ue(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ue(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ue(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ue(62))}}function _b(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 bb=null;function b2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xb=null,cc=null,uc=null;function rk(e){if(e=Lf(e)){if(typeof xb!="function")throw Error(ue(280));var t=e.stateNode;t&&(t=W0(t),xb(e.stateNode,e.type,t))}}function R7(e){cc?uc?uc.push(e):uc=[e]:cc=e}function A7(){if(cc){var e=cc,t=uc;if(uc=cc=null,rk(e),t)for(e=0;e<t.length;e++)rk(t[e])}}function L7(e,t){return e(t)}function D7(){}var wy=!1;function P7(e,t,n){if(wy)return e(t,n);wy=!0;try{return L7(e,t,n)}finally{wy=!1,(cc!==null||uc!==null)&&(D7(),A7())}}function bh(e,t){var n=e.stateNode;if(n===null)return null;var r=W0(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ue(231,t,typeof n));return n}var wb=!1;if(Ts)try{var id={};Object.defineProperty(id,"passive",{get:function(){wb=!0}}),window.addEventListener("test",id,id),window.removeEventListener("test",id,id)}catch{wb=!1}function yz(e,t,n,r,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Jd=!1,ag=null,lg=!1,Sb=null,_z={onError:function(e){Jd=!0,ag=e}};function bz(e,t,n,r,i,s,a,o,l){Jd=!1,ag=null,yz.apply(_z,arguments)}function xz(e,t,n,r,i,s,a,o,l){if(bz.apply(this,arguments),Jd){if(Jd){var c=ag;Jd=!1,ag=null}else throw Error(ue(198));lg||(lg=!0,Sb=c)}}function il(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function O7(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ik(e){if(il(e)!==e)throw Error(ue(188))}function wz(e){var t=e.alternate;if(!t){if(t=il(e),t===null)throw Error(ue(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return ik(i),e;if(s===r)return ik(i),t;s=s.sibling}throw Error(ue(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(ue(189))}}if(n.alternate!==r)throw Error(ue(190))}if(n.tag!==3)throw Error(ue(188));return n.stateNode.current===n?e:t}function N7(e){return e=wz(e),e!==null?I7(e):null}function I7(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=I7(e);if(t!==null)return t;e=e.sibling}return null}var j7=Rr.unstable_scheduleCallback,sk=Rr.unstable_cancelCallback,Sz=Rr.unstable_shouldYield,Cz=Rr.unstable_requestPaint,rn=Rr.unstable_now,kz=Rr.unstable_getCurrentPriorityLevel,x2=Rr.unstable_ImmediatePriority,B7=Rr.unstable_UserBlockingPriority,cg=Rr.unstable_NormalPriority,Ez=Rr.unstable_LowPriority,F7=Rr.unstable_IdlePriority,B0=null,Vi=null;function Tz(e){if(Vi&&typeof Vi.onCommitFiberRoot=="function")try{Vi.onCommitFiberRoot(B0,e,void 0,(e.current.flags&128)===128)}catch{}}var vi=Math.clz32?Math.clz32:Rz,$z=Math.log,Mz=Math.LN2;function Rz(e){return e>>>=0,e===0?32:31-($z(e)/Mz|0)|0}var bp=64,xp=4194304;function Fd(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ug(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Fd(o):(s&=a,s!==0&&(r=Fd(s)))}else a=n&~i,a!==0?r=Fd(a):s!==0&&(r=Fd(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-vi(t),i=1<<n,r|=e[n],t&=~i;return r}function Az(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lz(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-vi(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=Az(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function Cb(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function z7(){var e=bp;return bp<<=1,!(bp&4194240)&&(bp=64),e}function Sy(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Rf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vi(t),e[t]=n}function Dz(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-vi(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function w2(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-vi(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var _t=0;function H7(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var W7,S2,U7,V7,q7,kb=!1,wp=[],ko=null,Eo=null,To=null,xh=new Map,wh=new Map,so=[],Pz="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 submit".split(" ");function ok(e,t){switch(e){case"focusin":case"focusout":ko=null;break;case"dragenter":case"dragleave":Eo=null;break;case"mouseover":case"mouseout":To=null;break;case"pointerover":case"pointerout":xh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wh.delete(t.pointerId)}}function sd(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Lf(t),t!==null&&S2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Oz(e,t,n,r,i){switch(t){case"focusin":return ko=sd(ko,e,t,n,r,i),!0;case"dragenter":return Eo=sd(Eo,e,t,n,r,i),!0;case"mouseover":return To=sd(To,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return xh.set(s,sd(xh.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,wh.set(s,sd(wh.get(s)||null,e,t,n,r,i)),!0}return!1}function K7(e){var t=fa(e.target);if(t!==null){var n=il(t);if(n!==null){if(t=n.tag,t===13){if(t=O7(n),t!==null){e.blockedOn=t,q7(e.priority,function(){U7(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function km(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eb(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bb=r,n.target.dispatchEvent(r),bb=null}else return t=Lf(n),t!==null&&S2(t),e.blockedOn=n,!1;t.shift()}return!0}function ak(e,t,n){km(e)&&n.delete(t)}function Nz(){kb=!1,ko!==null&&km(ko)&&(ko=null),Eo!==null&&km(Eo)&&(Eo=null),To!==null&&km(To)&&(To=null),xh.forEach(ak),wh.forEach(ak)}function od(e,t){e.blockedOn===t&&(e.blockedOn=null,kb||(kb=!0,Rr.unstable_scheduleCallback(Rr.unstable_NormalPriority,Nz)))}function Sh(e){function t(i){return od(i,e)}if(0<wp.length){od(wp[0],e);for(var n=1;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ko!==null&&od(ko,e),Eo!==null&&od(Eo,e),To!==null&&od(To,e),xh.forEach(t),wh.forEach(t),n=0;n<so.length;n++)r=so[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<so.length&&(n=so[0],n.blockedOn===null);)K7(n),n.blockedOn===null&&so.shift()}var dc=zs.ReactCurrentBatchConfig,dg=!0;function Iz(e,t,n,r){var i=_t,s=dc.transition;dc.transition=null;try{_t=1,C2(e,t,n,r)}finally{_t=i,dc.transition=s}}function jz(e,t,n,r){var i=_t,s=dc.transition;dc.transition=null;try{_t=4,C2(e,t,n,r)}finally{_t=i,dc.transition=s}}function C2(e,t,n,r){if(dg){var i=Eb(e,t,n,r);if(i===null)Dy(e,t,r,hg,n),ok(e,r);else if(Oz(i,e,t,n,r))r.stopPropagation();else if(ok(e,r),t&4&&-1<Pz.indexOf(e)){for(;i!==null;){var s=Lf(i);if(s!==null&&W7(s),s=Eb(e,t,n,r),s===null&&Dy(e,t,r,hg,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Dy(e,t,r,null,n)}}var hg=null;function Eb(e,t,n,r){if(hg=null,e=b2(r),e=fa(e),e!==null)if(t=il(e),t===null)e=null;else if(n=t.tag,n===13){if(e=O7(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return hg=e,null}function G7(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kz()){case x2:return 1;case B7:return 4;case cg:case Ez:return 16;case F7:return 536870912;default:return 16}default:return 16}}var yo=null,k2=null,Em=null;function Y7(){if(Em)return Em;var e,t=k2,n=t.length,r,i="value"in yo?yo.value:yo.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return Em=i.slice(e,1<r?1-r:void 0)}function Tm(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sp(){return!0}function lk(){return!1}function Dr(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Sp:lk,this.isPropagationStopped=lk,this}return Qt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Sp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Sp)},persist:function(){},isPersistent:Sp}),t}var yu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},E2=Dr(yu),Af=Qt({},yu,{view:0,detail:0}),Bz=Dr(Af),Cy,ky,ad,F0=Qt({},Af,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:T2,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ad&&(ad&&e.type==="mousemove"?(Cy=e.screenX-ad.screenX,ky=e.screenY-ad.screenY):ky=Cy=0,ad=e),Cy)},movementY:function(e){return"movementY"in e?e.movementY:ky}}),ck=Dr(F0),Fz=Qt({},F0,{dataTransfer:0}),zz=Dr(Fz),Hz=Qt({},Af,{relatedTarget:0}),Ey=Dr(Hz),Wz=Qt({},yu,{animationName:0,elapsedTime:0,pseudoElement:0}),Uz=Dr(Wz),Vz=Qt({},yu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qz=Dr(Vz),Kz=Qt({},yu,{data:0}),uk=Dr(Kz),Gz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yz={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"},Xz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xz[e])?!!t[e]:!1}function T2(){return Qz}var Jz=Qt({},Af,{key:function(e){if(e.key){var t=Gz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:T2,charCode:function(e){return e.type==="keypress"?Tm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zz=Dr(Jz),eH=Qt({},F0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dk=Dr(eH),tH=Qt({},Af,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:T2}),nH=Dr(tH),rH=Qt({},yu,{propertyName:0,elapsedTime:0,pseudoElement:0}),iH=Dr(rH),sH=Qt({},F0,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oH=Dr(sH),aH=[9,13,27,32],$2=Ts&&"CompositionEvent"in window,Zd=null;Ts&&"documentMode"in document&&(Zd=document.documentMode);var lH=Ts&&"TextEvent"in window&&!Zd,X7=Ts&&(!$2||Zd&&8<Zd&&11>=Zd),hk=" ",fk=!1;function Q7(e,t){switch(e){case"keyup":return aH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J7(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gl=!1;function cH(e,t){switch(e){case"compositionend":return J7(t);case"keypress":return t.which!==32?null:(fk=!0,hk);case"textInput":return e=t.data,e===hk&&fk?null:e;default:return null}}function uH(e,t){if(Gl)return e==="compositionend"||!$2&&Q7(e,t)?(e=Y7(),Em=k2=yo=null,Gl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return X7&&t.locale!=="ko"?null:t.data;default:return null}}var dH={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 pk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dH[e.type]:t==="textarea"}function Z7(e,t,n,r){R7(r),t=fg(t,"onChange"),0<t.length&&(n=new E2("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var eh=null,Ch=null;function hH(e){uM(e,0)}function z0(e){var t=Ql(e);if(S7(t))return e}function fH(e,t){if(e==="change")return t}var eM=!1;if(Ts){var Ty;if(Ts){var $y="oninput"in document;if(!$y){var mk=document.createElement("div");mk.setAttribute("oninput","return;"),$y=typeof mk.oninput=="function"}Ty=$y}else Ty=!1;eM=Ty&&(!document.documentMode||9<document.documentMode)}function gk(){eh&&(eh.detachEvent("onpropertychange",tM),Ch=eh=null)}function tM(e){if(e.propertyName==="value"&&z0(Ch)){var t=[];Z7(t,Ch,e,b2(e)),P7(hH,t)}}function pH(e,t,n){e==="focusin"?(gk(),eh=t,Ch=n,eh.attachEvent("onpropertychange",tM)):e==="focusout"&&gk()}function mH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return z0(Ch)}function gH(e,t){if(e==="click")return z0(t)}function vH(e,t){if(e==="input"||e==="change")return z0(t)}function yH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xi=typeof Object.is=="function"?Object.is:yH;function kh(e,t){if(xi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!lb.call(t,i)||!xi(e[i],t[i]))return!1}return!0}function vk(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yk(e,t){var n=vk(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=vk(n)}}function nM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rM(){for(var e=window,t=og();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=og(e.document)}return t}function M2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function _H(e){var t=rM(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&nM(n.ownerDocument.documentElement,n)){if(r!==null&&M2(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=yk(n,s);var a=yk(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var bH=Ts&&"documentMode"in document&&11>=document.documentMode,Yl=null,Tb=null,th=null,$b=!1;function _k(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$b||Yl==null||Yl!==og(r)||(r=Yl,"selectionStart"in r&&M2(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),th&&kh(th,r)||(th=r,r=fg(Tb,"onSelect"),0<r.length&&(t=new E2("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Yl)))}function Cp(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Xl={animationend:Cp("Animation","AnimationEnd"),animationiteration:Cp("Animation","AnimationIteration"),animationstart:Cp("Animation","AnimationStart"),transitionend:Cp("Transition","TransitionEnd")},My={},iM={};Ts&&(iM=document.createElement("div").style,"AnimationEvent"in window||(delete Xl.animationend.animation,delete Xl.animationiteration.animation,delete Xl.animationstart.animation),"TransitionEvent"in window||delete Xl.transitionend.transition);function H0(e){if(My[e])return My[e];if(!Xl[e])return e;var t=Xl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in iM)return My[e]=t[n];return e}var sM=H0("animationend"),oM=H0("animationiteration"),aM=H0("animationstart"),lM=H0("transitionend"),cM=new Map,bk="abort auxClick 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(" ");function Yo(e,t){cM.set(e,t),rl(t,[e])}for(var Ry=0;Ry<bk.length;Ry++){var Ay=bk[Ry],xH=Ay.toLowerCase(),wH=Ay[0].toUpperCase()+Ay.slice(1);Yo(xH,"on"+wH)}Yo(sM,"onAnimationEnd");Yo(oM,"onAnimationIteration");Yo(aM,"onAnimationStart");Yo("dblclick","onDoubleClick");Yo("focusin","onFocus");Yo("focusout","onBlur");Yo(lM,"onTransitionEnd");Hc("onMouseEnter",["mouseout","mouseover"]);Hc("onMouseLeave",["mouseout","mouseover"]);Hc("onPointerEnter",["pointerout","pointerover"]);Hc("onPointerLeave",["pointerout","pointerover"]);rl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rl("onBeforeInput",["compositionend","keypress","textInput","paste"]);rl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zd="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(" "),SH=new Set("cancel close invalid load scroll toggle".split(" ").concat(zd));function xk(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,xz(r,t,void 0,e),e.currentTarget=null}function uM(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;xk(i,o,c),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;xk(i,o,c),s=l}}}if(lg)throw e=Sb,lg=!1,Sb=null,e}function It(e,t){var n=t[Db];n===void 0&&(n=t[Db]=new Set);var r=e+"__bubble";n.has(r)||(dM(t,e,2,!1),n.add(r))}function Ly(e,t,n){var r=0;t&&(r|=4),dM(n,e,r,t)}var kp="_reactListening"+Math.random().toString(36).slice(2);function Eh(e){if(!e[kp]){e[kp]=!0,y7.forEach(function(n){n!=="selectionchange"&&(SH.has(n)||Ly(n,!1,e),Ly(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kp]||(t[kp]=!0,Ly("selectionchange",!1,t))}}function dM(e,t,n,r){switch(G7(t)){case 1:var i=Iz;break;case 4:i=jz;break;default:i=C2}n=i.bind(null,t,n,e),i=void 0,!wb||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dy(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;o!==null;){if(a=fa(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}P7(function(){var c=s,d=b2(n),u=[];e:{var h=cM.get(e);if(h!==void 0){var f=E2,b=e;switch(e){case"keypress":if(Tm(n)===0)break e;case"keydown":case"keyup":f=Zz;break;case"focusin":b="focus",f=Ey;break;case"focusout":b="blur",f=Ey;break;case"beforeblur":case"afterblur":f=Ey;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=ck;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=zz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=nH;break;case sM:case oM:case aM:f=Uz;break;case lM:f=iH;break;case"scroll":f=Bz;break;case"wheel":f=oH;break;case"copy":case"cut":case"paste":f=qz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=dk}var y=(t&4)!==0,m=!y&&e==="scroll",p=y?h!==null?h+"Capture":null:h;y=[];for(var g=c,_;g!==null;){_=g;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,p!==null&&(S=bh(g,p),S!=null&&y.push(Th(g,S,_)))),m)break;g=g.return}0<y.length&&(h=new f(h,b,null,n,d),u.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",h&&n!==bb&&(b=n.relatedTarget||n.fromElement)&&(fa(b)||b[$s]))break e;if((f||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,f?(b=n.relatedTarget||n.toElement,f=c,b=b?fa(b):null,b!==null&&(m=il(b),b!==m||b.tag!==5&&b.tag!==6)&&(b=null)):(f=null,b=c),f!==b)){if(y=ck,S="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(y=dk,S="onPointerLeave",p="onPointerEnter",g="pointer"),m=f==null?h:Ql(f),_=b==null?h:Ql(b),h=new y(S,g+"leave",f,n,d),h.target=m,h.relatedTarget=_,S=null,fa(d)===c&&(y=new y(p,g+"enter",b,n,d),y.target=_,y.relatedTarget=m,S=y),m=S,f&&b)t:{for(y=f,p=b,g=0,_=y;_;_=Ml(_))g++;for(_=0,S=p;S;S=Ml(S))_++;for(;0<g-_;)y=Ml(y),g--;for(;0<_-g;)p=Ml(p),_--;for(;g--;){if(y===p||p!==null&&y===p.alternate)break t;y=Ml(y),p=Ml(p)}y=null}else y=null;f!==null&&wk(u,h,f,y,!1),b!==null&&m!==null&&wk(u,m,b,y,!0)}}e:{if(h=c?Ql(c):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var k=fH;else if(pk(h))if(eM)k=vH;else{k=mH;var C=pH}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=gH);if(k&&(k=k(e,c))){Z7(u,k,n,d);break e}C&&C(e,h,c),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&mb(h,"number",h.value)}switch(C=c?Ql(c):window,e){case"focusin":(pk(C)||C.contentEditable==="true")&&(Yl=C,Tb=c,th=null);break;case"focusout":th=Tb=Yl=null;break;case"mousedown":$b=!0;break;case"contextmenu":case"mouseup":case"dragend":$b=!1,_k(u,n,d);break;case"selectionchange":if(bH)break;case"keydown":case"keyup":_k(u,n,d)}var T;if($2)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Gl?Q7(e,n)&&(w="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(w="onCompositionStart");w&&(X7&&n.locale!=="ko"&&(Gl||w!=="onCompositionStart"?w==="onCompositionEnd"&&Gl&&(T=Y7()):(yo=d,k2="value"in yo?yo.value:yo.textContent,Gl=!0)),C=fg(c,w),0<C.length&&(w=new uk(w,e,null,n,d),u.push({event:w,listeners:C}),T?w.data=T:(T=J7(n),T!==null&&(w.data=T)))),(T=lH?cH(e,n):uH(e,n))&&(c=fg(c,"onBeforeInput"),0<c.length&&(d=new uk("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=T))}uM(u,t)})}function Th(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fg(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=bh(e,n),s!=null&&r.unshift(Th(e,s,i)),s=bh(e,t),s!=null&&r.push(Th(e,s,i))),e=e.return}return r}function Ml(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wk(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&c!==null&&(o=c,i?(l=bh(n,s),l!=null&&a.unshift(Th(n,l,o))):i||(l=bh(n,s),l!=null&&a.push(Th(n,l,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var CH=/\r\n?/g,kH=/\u0000|\uFFFD/g;function Sk(e){return(typeof e=="string"?e:""+e).replace(CH,`
`).replace(kH,"")}function Ep(e,t,n){if(t=Sk(t),Sk(e)!==t&&n)throw Error(ue(425))}function pg(){}var Mb=null,Rb=null;function Ab(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lb=typeof setTimeout=="function"?setTimeout:void 0,EH=typeof clearTimeout=="function"?clearTimeout:void 0,Ck=typeof Promise=="function"?Promise:void 0,TH=typeof queueMicrotask=="function"?queueMicrotask:typeof Ck<"u"?function(e){return Ck.resolve(null).then(e).catch($H)}:Lb;function $H(e){setTimeout(function(){throw e})}function Py(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Sh(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Sh(t)}function $o(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function kk(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var _u=Math.random().toString(36).slice(2),Fi="__reactFiber$"+_u,$h="__reactProps$"+_u,$s="__reactContainer$"+_u,Db="__reactEvents$"+_u,MH="__reactListeners$"+_u,RH="__reactHandles$"+_u;function fa(e){var t=e[Fi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$s]||n[Fi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kk(e);e!==null;){if(n=e[Fi])return n;e=kk(e)}return t}e=n,n=e.parentNode}return null}function Lf(e){return e=e[Fi]||e[$s],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ql(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ue(33))}function W0(e){return e[$h]||null}var Pb=[],Jl=-1;function Xo(e){return{current:e}}function Ht(e){0>Jl||(e.current=Pb[Jl],Pb[Jl]=null,Jl--)}function Lt(e,t){Jl++,Pb[Jl]=e.current,e.current=t}var Oo={},Wn=Xo(Oo),ur=Xo(!1),Fa=Oo;function Wc(e,t){var n=e.type.contextTypes;if(!n)return Oo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dr(e){return e=e.childContextTypes,e!=null}function mg(){Ht(ur),Ht(Wn)}function Ek(e,t,n){if(Wn.current!==Oo)throw Error(ue(168));Lt(Wn,t),Lt(ur,n)}function hM(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ue(108,pz(e)||"Unknown",i));return Qt({},n,r)}function gg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oo,Fa=Wn.current,Lt(Wn,e),Lt(ur,ur.current),!0}function Tk(e,t,n){var r=e.stateNode;if(!r)throw Error(ue(169));n?(e=hM(e,t,Fa),r.__reactInternalMemoizedMergedChildContext=e,Ht(ur),Ht(Wn),Lt(Wn,e)):Ht(ur),Lt(ur,n)}var vs=null,U0=!1,Oy=!1;function fM(e){vs===null?vs=[e]:vs.push(e)}function AH(e){U0=!0,fM(e)}function Qo(){if(!Oy&&vs!==null){Oy=!0;var e=0,t=_t;try{var n=vs;for(_t=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vs=null,U0=!1}catch(i){throw vs!==null&&(vs=vs.slice(e+1)),j7(x2,Qo),i}finally{_t=t,Oy=!1}}return null}var Zl=[],ec=0,vg=null,yg=0,Br=[],Fr=0,za=null,bs=1,xs="";function sa(e,t){Zl[ec++]=yg,Zl[ec++]=vg,vg=e,yg=t}function pM(e,t,n){Br[Fr++]=bs,Br[Fr++]=xs,Br[Fr++]=za,za=e;var r=bs;e=xs;var i=32-vi(r)-1;r&=~(1<<i),n+=1;var s=32-vi(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,bs=1<<32-vi(t)+i|n<<i|r,xs=s+e}else bs=1<<s|n<<i|r,xs=e}function R2(e){e.return!==null&&(sa(e,1),pM(e,1,0))}function A2(e){for(;e===vg;)vg=Zl[--ec],Zl[ec]=null,yg=Zl[--ec],Zl[ec]=null;for(;e===za;)za=Br[--Fr],Br[Fr]=null,xs=Br[--Fr],Br[Fr]=null,bs=Br[--Fr],Br[Fr]=null}var $r=null,kr=null,qt=!1,hi=null;function mM(e,t){var n=Kr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $k(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,$r=e,kr=$o(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$r=e,kr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=za!==null?{id:bs,overflow:xs}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,$r=e,kr=null,!0):!1;default:return!1}}function Ob(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nb(e){if(qt){var t=kr;if(t){var n=t;if(!$k(e,t)){if(Ob(e))throw Error(ue(418));t=$o(n.nextSibling);var r=$r;t&&$k(e,t)?mM(r,n):(e.flags=e.flags&-4097|2,qt=!1,$r=e)}}else{if(Ob(e))throw Error(ue(418));e.flags=e.flags&-4097|2,qt=!1,$r=e}}}function Mk(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$r=e}function Tp(e){if(e!==$r)return!1;if(!qt)return Mk(e),qt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ab(e.type,e.memoizedProps)),t&&(t=kr)){if(Ob(e))throw gM(),Error(ue(418));for(;t;)mM(e,t),t=$o(t.nextSibling)}if(Mk(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ue(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kr=$o(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kr=null}}else kr=$r?$o(e.stateNode.nextSibling):null;return!0}function gM(){for(var e=kr;e;)e=$o(e.nextSibling)}function Uc(){kr=$r=null,qt=!1}function L2(e){hi===null?hi=[e]:hi.push(e)}var LH=zs.ReactCurrentBatchConfig;function ai(e,t){if(e&&e.defaultProps){t=Qt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var _g=Xo(null),bg=null,tc=null,D2=null;function P2(){D2=tc=bg=null}function O2(e){var t=_g.current;Ht(_g),e._currentValue=t}function Ib(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hc(e,t){bg=e,D2=tc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(cr=!0),e.firstContext=null)}function Zr(e){var t=e._currentValue;if(D2!==e)if(e={context:e,memoizedValue:t,next:null},tc===null){if(bg===null)throw Error(ue(308));tc=e,bg.dependencies={lanes:0,firstContext:e}}else tc=tc.next=e;return t}var pa=null;function N2(e){pa===null?pa=[e]:pa.push(e)}function vM(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,N2(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ms(e,r)}function Ms(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var no=!1;function I2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yM(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Es(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,at&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ms(e,n)}return i=r.interleaved,i===null?(t.next=t,N2(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ms(e,n)}function $m(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,w2(e,n)}}function Rk(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xg(e,t,n,r){var i=e.updateQueue;no=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;a=0,d=c=l=null,o=s;do{var h=o.lane,f=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var b=e,y=o;switch(h=t,f=n,y.tag){case 1:if(b=y.payload,typeof b=="function"){u=b.call(f,u,h);break e}u=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=y.payload,h=typeof b=="function"?b.call(f,u,h):b,h==null)break e;u=Qt({},u,h);break e;case 2:no=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else f={eventTime:f,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=f,l=u):d=d.next=f,a|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Wa|=a,e.lanes=a,e.memoizedState=u}}function Ak(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ue(191,i));i.call(r)}}}var _M=new v7.Component().refs;function jb(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var V0={isMounted:function(e){return(e=e._reactInternals)?il(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qn(),i=Ao(e),s=Es(r,i);s.payload=t,n!=null&&(s.callback=n),t=Mo(e,s,i),t!==null&&(yi(t,e,i,r),$m(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qn(),i=Ao(e),s=Es(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Mo(e,s,i),t!==null&&(yi(t,e,i,r),$m(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qn(),r=Ao(e),i=Es(n,r);i.tag=2,t!=null&&(i.callback=t),t=Mo(e,i,r),t!==null&&(yi(t,e,r,n),$m(t,e,r))}};function Lk(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!kh(n,r)||!kh(i,s):!0}function bM(e,t,n){var r=!1,i=Oo,s=t.contextType;return typeof s=="object"&&s!==null?s=Zr(s):(i=dr(t)?Fa:Wn.current,r=t.contextTypes,s=(r=r!=null)?Wc(e,i):Oo),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=V0,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Dk(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&V0.enqueueReplaceState(t,t.state,null)}function Bb(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=_M,I2(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Zr(s):(s=dr(t)?Fa:Wn.current,i.context=Wc(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(jb(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&V0.enqueueReplaceState(i,i.state,null),xg(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ld(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ue(309));var r=n.stateNode}if(!r)throw Error(ue(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=i.refs;o===_M&&(o=i.refs={}),a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(ue(284));if(!n._owner)throw Error(ue(290,e))}return e}function $p(e,t){throw e=Object.prototype.toString.call(t),Error(ue(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Pk(e){var t=e._init;return t(e._payload)}function xM(e){function t(p,g){if(e){var _=p.deletions;_===null?(p.deletions=[g],p.flags|=16):_.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function i(p,g){return p=Lo(p,g),p.index=0,p.sibling=null,p}function s(p,g,_){return p.index=_,e?(_=p.alternate,_!==null?(_=_.index,_<g?(p.flags|=2,g):_):(p.flags|=2,g)):(p.flags|=1048576,g)}function a(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,g,_,S){return g===null||g.tag!==6?(g=Hy(_,p.mode,S),g.return=p,g):(g=i(g,_),g.return=p,g)}function l(p,g,_,S){var k=_.type;return k===Kl?d(p,g,_.props.children,S,_.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===to&&Pk(k)===g.type)?(S=i(g,_.props),S.ref=ld(p,g,_),S.return=p,S):(S=Pm(_.type,_.key,_.props,null,p.mode,S),S.ref=ld(p,g,_),S.return=p,S)}function c(p,g,_,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==_.containerInfo||g.stateNode.implementation!==_.implementation?(g=Wy(_,p.mode,S),g.return=p,g):(g=i(g,_.children||[]),g.return=p,g)}function d(p,g,_,S,k){return g===null||g.tag!==7?(g=Da(_,p.mode,S,k),g.return=p,g):(g=i(g,_),g.return=p,g)}function u(p,g,_){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Hy(""+g,p.mode,_),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case vp:return _=Pm(g.type,g.key,g.props,null,p.mode,_),_.ref=ld(p,null,g),_.return=p,_;case ql:return g=Wy(g,p.mode,_),g.return=p,g;case to:var S=g._init;return u(p,S(g._payload),_)}if(Bd(g)||rd(g))return g=Da(g,p.mode,_,null),g.return=p,g;$p(p,g)}return null}function h(p,g,_,S){var k=g!==null?g.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return k!==null?null:o(p,g,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case vp:return _.key===k?l(p,g,_,S):null;case ql:return _.key===k?c(p,g,_,S):null;case to:return k=_._init,h(p,g,k(_._payload),S)}if(Bd(_)||rd(_))return k!==null?null:d(p,g,_,S,null);$p(p,_)}return null}function f(p,g,_,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return p=p.get(_)||null,o(g,p,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case vp:return p=p.get(S.key===null?_:S.key)||null,l(g,p,S,k);case ql:return p=p.get(S.key===null?_:S.key)||null,c(g,p,S,k);case to:var C=S._init;return f(p,g,_,C(S._payload),k)}if(Bd(S)||rd(S))return p=p.get(_)||null,d(g,p,S,k,null);$p(g,S)}return null}function b(p,g,_,S){for(var k=null,C=null,T=g,w=g=0,E=null;T!==null&&w<_.length;w++){T.index>w?(E=T,T=null):E=T.sibling;var $=h(p,T,_[w],S);if($===null){T===null&&(T=E);break}e&&T&&$.alternate===null&&t(p,T),g=s($,g,w),C===null?k=$:C.sibling=$,C=$,T=E}if(w===_.length)return n(p,T),qt&&sa(p,w),k;if(T===null){for(;w<_.length;w++)T=u(p,_[w],S),T!==null&&(g=s(T,g,w),C===null?k=T:C.sibling=T,C=T);return qt&&sa(p,w),k}for(T=r(p,T);w<_.length;w++)E=f(T,p,w,_[w],S),E!==null&&(e&&E.alternate!==null&&T.delete(E.key===null?w:E.key),g=s(E,g,w),C===null?k=E:C.sibling=E,C=E);return e&&T.forEach(function(M){return t(p,M)}),qt&&sa(p,w),k}function y(p,g,_,S){var k=rd(_);if(typeof k!="function")throw Error(ue(150));if(_=k.call(_),_==null)throw Error(ue(151));for(var C=k=null,T=g,w=g=0,E=null,$=_.next();T!==null&&!$.done;w++,$=_.next()){T.index>w?(E=T,T=null):E=T.sibling;var M=h(p,T,$.value,S);if(M===null){T===null&&(T=E);break}e&&T&&M.alternate===null&&t(p,T),g=s(M,g,w),C===null?k=M:C.sibling=M,C=M,T=E}if($.done)return n(p,T),qt&&sa(p,w),k;if(T===null){for(;!$.done;w++,$=_.next())$=u(p,$.value,S),$!==null&&(g=s($,g,w),C===null?k=$:C.sibling=$,C=$);return qt&&sa(p,w),k}for(T=r(p,T);!$.done;w++,$=_.next())$=f(T,p,w,$.value,S),$!==null&&(e&&$.alternate!==null&&T.delete($.key===null?w:$.key),g=s($,g,w),C===null?k=$:C.sibling=$,C=$);return e&&T.forEach(function(P){return t(p,P)}),qt&&sa(p,w),k}function m(p,g,_,S){if(typeof _=="object"&&_!==null&&_.type===Kl&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case vp:e:{for(var k=_.key,C=g;C!==null;){if(C.key===k){if(k=_.type,k===Kl){if(C.tag===7){n(p,C.sibling),g=i(C,_.props.children),g.return=p,p=g;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===to&&Pk(k)===C.type){n(p,C.sibling),g=i(C,_.props),g.ref=ld(p,C,_),g.return=p,p=g;break e}n(p,C);break}else t(p,C);C=C.sibling}_.type===Kl?(g=Da(_.props.children,p.mode,S,_.key),g.return=p,p=g):(S=Pm(_.type,_.key,_.props,null,p.mode,S),S.ref=ld(p,g,_),S.return=p,p=S)}return a(p);case ql:e:{for(C=_.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===_.containerInfo&&g.stateNode.implementation===_.implementation){n(p,g.sibling),g=i(g,_.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Wy(_,p.mode,S),g.return=p,p=g}return a(p);case to:return C=_._init,m(p,g,C(_._payload),S)}if(Bd(_))return b(p,g,_,S);if(rd(_))return y(p,g,_,S);$p(p,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,g!==null&&g.tag===6?(n(p,g.sibling),g=i(g,_),g.return=p,p=g):(n(p,g),g=Hy(_,p.mode,S),g.return=p,p=g),a(p)):n(p,g)}return m}var Vc=xM(!0),wM=xM(!1),Df={},qi=Xo(Df),Mh=Xo(Df),Rh=Xo(Df);function ma(e){if(e===Df)throw Error(ue(174));return e}function j2(e,t){switch(Lt(Rh,t),Lt(Mh,e),Lt(qi,Df),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vb(t,e)}Ht(qi),Lt(qi,t)}function qc(){Ht(qi),Ht(Mh),Ht(Rh)}function SM(e){ma(Rh.current);var t=ma(qi.current),n=vb(t,e.type);t!==n&&(Lt(Mh,e),Lt(qi,n))}function B2(e){Mh.current===e&&(Ht(qi),Ht(Mh))}var Yt=Xo(0);function wg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ny=[];function F2(){for(var e=0;e<Ny.length;e++)Ny[e]._workInProgressVersionPrimary=null;Ny.length=0}var Mm=zs.ReactCurrentDispatcher,Iy=zs.ReactCurrentBatchConfig,Ha=0,Xt=null,fn=null,Cn=null,Sg=!1,nh=!1,Ah=0,DH=0;function On(){throw Error(ue(321))}function z2(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xi(e[n],t[n]))return!1;return!0}function H2(e,t,n,r,i,s){if(Ha=s,Xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mm.current=e===null||e.memoizedState===null?IH:jH,e=n(r,i),nh){s=0;do{if(nh=!1,Ah=0,25<=s)throw Error(ue(301));s+=1,Cn=fn=null,t.updateQueue=null,Mm.current=BH,e=n(r,i)}while(nh)}if(Mm.current=Cg,t=fn!==null&&fn.next!==null,Ha=0,Cn=fn=Xt=null,Sg=!1,t)throw Error(ue(300));return e}function W2(){var e=Ah!==0;return Ah=0,e}function Li(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Xt.memoizedState=Cn=e:Cn=Cn.next=e,Cn}function ei(){if(fn===null){var e=Xt.alternate;e=e!==null?e.memoizedState:null}else e=fn.next;var t=Cn===null?Xt.memoizedState:Cn.next;if(t!==null)Cn=t,fn=e;else{if(e===null)throw Error(ue(310));fn=e,e={memoizedState:fn.memoizedState,baseState:fn.baseState,baseQueue:fn.baseQueue,queue:fn.queue,next:null},Cn===null?Xt.memoizedState=Cn=e:Cn=Cn.next=e}return Cn}function Lh(e,t){return typeof t=="function"?t(e):t}function jy(e){var t=ei(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=fn,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,c=s;do{var d=c.lane;if((Ha&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=u,a=r):l=l.next=u,Xt.lanes|=d,Wa|=d}c=c.next}while(c!==null&&c!==s);l===null?a=r:l.next=o,xi(r,t.memoizedState)||(cr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Xt.lanes|=s,Wa|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function By(e){var t=ei(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);xi(s,t.memoizedState)||(cr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function CM(){}function kM(e,t){var n=Xt,r=ei(),i=t(),s=!xi(r.memoizedState,i);if(s&&(r.memoizedState=i,cr=!0),r=r.queue,U2($M.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Cn!==null&&Cn.memoizedState.tag&1){if(n.flags|=2048,Dh(9,TM.bind(null,n,r,i,t),void 0,null),En===null)throw Error(ue(349));Ha&30||EM(n,t,i)}return i}function EM(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function TM(e,t,n,r){t.value=n,t.getSnapshot=r,MM(t)&&RM(e)}function $M(e,t,n){return n(function(){MM(t)&&RM(e)})}function MM(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xi(e,n)}catch{return!0}}function RM(e){var t=Ms(e,1);t!==null&&yi(t,e,1,-1)}function Ok(e){var t=Li();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lh,lastRenderedState:e},t.queue=e,e=e.dispatch=NH.bind(null,Xt,e),[t.memoizedState,e]}function Dh(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function AM(){return ei().memoizedState}function Rm(e,t,n,r){var i=Li();Xt.flags|=e,i.memoizedState=Dh(1|t,n,void 0,r===void 0?null:r)}function q0(e,t,n,r){var i=ei();r=r===void 0?null:r;var s=void 0;if(fn!==null){var a=fn.memoizedState;if(s=a.destroy,r!==null&&z2(r,a.deps)){i.memoizedState=Dh(t,n,s,r);return}}Xt.flags|=e,i.memoizedState=Dh(1|t,n,s,r)}function Nk(e,t){return Rm(8390656,8,e,t)}function U2(e,t){return q0(2048,8,e,t)}function LM(e,t){return q0(4,2,e,t)}function DM(e,t){return q0(4,4,e,t)}function PM(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function OM(e,t,n){return n=n!=null?n.concat([e]):null,q0(4,4,PM.bind(null,t,e),n)}function V2(){}function NM(e,t){var n=ei();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&z2(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function IM(e,t){var n=ei();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&z2(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function jM(e,t,n){return Ha&21?(xi(n,t)||(n=z7(),Xt.lanes|=n,Wa|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,cr=!0),e.memoizedState=n)}function PH(e,t){var n=_t;_t=n!==0&&4>n?n:4,e(!0);var r=Iy.transition;Iy.transition={};try{e(!1),t()}finally{_t=n,Iy.transition=r}}function BM(){return ei().memoizedState}function OH(e,t,n){var r=Ao(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},FM(e))zM(t,n);else if(n=vM(e,t,n,r),n!==null){var i=Qn();yi(n,e,r,i),HM(n,t,r)}}function NH(e,t,n){var r=Ao(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(FM(e))zM(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,xi(o,a)){var l=t.interleaved;l===null?(i.next=i,N2(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=vM(e,t,i,r),n!==null&&(i=Qn(),yi(n,e,r,i),HM(n,t,r))}}function FM(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function zM(e,t){nh=Sg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function HM(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,w2(e,n)}}var Cg={readContext:Zr,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useInsertionEffect:On,useLayoutEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useMutableSource:On,useSyncExternalStore:On,useId:On,unstable_isNewReconciler:!1},IH={readContext:Zr,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:Zr,useEffect:Nk,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rm(4194308,4,PM.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rm(4,2,e,t)},useMemo:function(e,t){var n=Li();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Li();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=OH.bind(null,Xt,e),[r.memoizedState,e]},useRef:function(e){var t=Li();return e={current:e},t.memoizedState=e},useState:Ok,useDebugValue:V2,useDeferredValue:function(e){return Li().memoizedState=e},useTransition:function(){var e=Ok(!1),t=e[0];return e=PH.bind(null,e[1]),Li().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Xt,i=Li();if(qt){if(n===void 0)throw Error(ue(407));n=n()}else{if(n=t(),En===null)throw Error(ue(349));Ha&30||EM(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Nk($M.bind(null,r,s,e),[e]),r.flags|=2048,Dh(9,TM.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Li(),t=En.identifierPrefix;if(qt){var n=xs,r=bs;n=(r&~(1<<32-vi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ah++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=DH++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jH={readContext:Zr,useCallback:NM,useContext:Zr,useEffect:U2,useImperativeHandle:OM,useInsertionEffect:LM,useLayoutEffect:DM,useMemo:IM,useReducer:jy,useRef:AM,useState:function(){return jy(Lh)},useDebugValue:V2,useDeferredValue:function(e){var t=ei();return jM(t,fn.memoizedState,e)},useTransition:function(){var e=jy(Lh)[0],t=ei().memoizedState;return[e,t]},useMutableSource:CM,useSyncExternalStore:kM,useId:BM,unstable_isNewReconciler:!1},BH={readContext:Zr,useCallback:NM,useContext:Zr,useEffect:U2,useImperativeHandle:OM,useInsertionEffect:LM,useLayoutEffect:DM,useMemo:IM,useReducer:By,useRef:AM,useState:function(){return By(Lh)},useDebugValue:V2,useDeferredValue:function(e){var t=ei();return fn===null?t.memoizedState=e:jM(t,fn.memoizedState,e)},useTransition:function(){var e=By(Lh)[0],t=ei().memoizedState;return[e,t]},useMutableSource:CM,useSyncExternalStore:kM,useId:BM,unstable_isNewReconciler:!1};function Kc(e,t){try{var n="",r=t;do n+=fz(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Fy(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fb(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var FH=typeof WeakMap=="function"?WeakMap:Map;function WM(e,t,n){n=Es(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Eg||(Eg=!0,Xb=r),Fb(e,t)},n}function UM(e,t,n){n=Es(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Fb(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Fb(e,t),typeof r!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Ik(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new FH;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=eW.bind(null,e,t,n),t.then(e,e))}function jk(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Bk(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Es(-1,1),t.tag=2,Mo(n,t,1))),n.lanes|=1),e)}var zH=zs.ReactCurrentOwner,cr=!1;function Kn(e,t,n,r){t.child=e===null?wM(t,null,n,r):Vc(t,e.child,n,r)}function Fk(e,t,n,r,i){n=n.render;var s=t.ref;return hc(t,i),r=H2(e,t,n,r,s,i),n=W2(),e!==null&&!cr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(qt&&n&&R2(t),t.flags|=1,Kn(e,t,r,i),t.child)}function zk(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Z2(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,VM(e,t,s,r,i)):(e=Pm(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:kh,n(a,r)&&e.ref===t.ref)return Rs(e,t,i)}return t.flags|=1,e=Lo(s,r),e.ref=t.ref,e.return=t,t.child=e}function VM(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(kh(s,r)&&e.ref===t.ref)if(cr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(cr=!0);else return t.lanes=e.lanes,Rs(e,t,i)}return zb(e,t,n,r,i)}function qM(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(rc,Sr),Sr|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Lt(rc,Sr),Sr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Lt(rc,Sr),Sr|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Lt(rc,Sr),Sr|=r;return Kn(e,t,i,n),t.child}function KM(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zb(e,t,n,r,i){var s=dr(n)?Fa:Wn.current;return s=Wc(t,s),hc(t,i),n=H2(e,t,n,r,s,i),r=W2(),e!==null&&!cr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(qt&&r&&R2(t),t.flags|=1,Kn(e,t,n,i),t.child)}function Hk(e,t,n,r,i){if(dr(n)){var s=!0;gg(t)}else s=!1;if(hc(t,i),t.stateNode===null)Am(e,t),bM(t,n,r),Bb(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zr(c):(c=dr(n)?Fa:Wn.current,c=Wc(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&Dk(t,a,r,c),no=!1;var h=t.memoizedState;a.state=h,xg(t,r,a,i),l=t.memoizedState,o!==r||h!==l||ur.current||no?(typeof d=="function"&&(jb(t,n,d,r),l=t.memoizedState),(o=no||Lk(t,n,o,r,h,l,c))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,yM(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:ai(t.type,o),a.props=c,u=t.pendingProps,h=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zr(l):(l=dr(n)?Fa:Wn.current,l=Wc(t,l));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==u||h!==l)&&Dk(t,a,r,l),no=!1,h=t.memoizedState,a.state=h,xg(t,r,a,i);var b=t.memoizedState;o!==u||h!==b||ur.current||no?(typeof f=="function"&&(jb(t,n,f,r),b=t.memoizedState),(c=no||Lk(t,n,c,r,h,b,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,b,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,b,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),a.props=r,a.state=b,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Hb(e,t,n,r,s,i)}function Hb(e,t,n,r,i,s){KM(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Tk(t,n,!1),Rs(e,t,s);r=t.stateNode,zH.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Vc(t,e.child,null,s),t.child=Vc(t,null,o,s)):Kn(e,t,o,s),t.memoizedState=r.state,i&&Tk(t,n,!0),t.child}function GM(e){var t=e.stateNode;t.pendingContext?Ek(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ek(e,t.context,!1),j2(e,t.containerInfo)}function Wk(e,t,n,r,i){return Uc(),L2(i),t.flags|=256,Kn(e,t,n,r),t.child}var Wb={dehydrated:null,treeContext:null,retryLane:0};function Ub(e){return{baseLanes:e,cachePool:null,transitions:null}}function YM(e,t,n){var r=t.pendingProps,i=Yt.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Lt(Yt,i&1),e===null)return Nb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Y0(a,r,0,null),e=Da(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ub(n),t.memoizedState=Wb,e):q2(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return HH(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Lo(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=Lo(o,s):(s=Da(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?Ub(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=Wb,r}return s=e.child,e=s.sibling,r=Lo(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function q2(e,t){return t=Y0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mp(e,t,n,r){return r!==null&&L2(r),Vc(t,e.child,null,n),e=q2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function HH(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Fy(Error(ue(422))),Mp(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Y0({mode:"visible",children:r.children},i,0,null),s=Da(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Vc(t,e.child,null,a),t.child.memoizedState=Ub(a),t.memoizedState=Wb,s);if(!(t.mode&1))return Mp(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(ue(419)),r=Fy(s,r,void 0),Mp(e,t,a,r)}if(o=(a&e.childLanes)!==0,cr||o){if(r=En,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Ms(e,i),yi(r,e,i,-1))}return J2(),r=Fy(Error(ue(421))),Mp(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=tW.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,kr=$o(i.nextSibling),$r=t,qt=!0,hi=null,e!==null&&(Br[Fr++]=bs,Br[Fr++]=xs,Br[Fr++]=za,bs=e.id,xs=e.overflow,za=t),t=q2(t,r.children),t.flags|=4096,t)}function Uk(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ib(e.return,t,n)}function zy(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function XM(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Kn(e,t,r.children,n),r=Yt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uk(e,n,t);else if(e.tag===19)Uk(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Lt(Yt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&wg(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),zy(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&wg(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}zy(t,!0,n,null,s);break;case"together":zy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Am(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Rs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ue(153));if(t.child!==null){for(e=t.child,n=Lo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Lo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function WH(e,t,n){switch(t.tag){case 3:GM(t),Uc();break;case 5:SM(t);break;case 1:dr(t.type)&&gg(t);break;case 4:j2(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Lt(_g,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Lt(Yt,Yt.current&1),t.flags|=128,null):n&t.child.childLanes?YM(e,t,n):(Lt(Yt,Yt.current&1),e=Rs(e,t,n),e!==null?e.sibling:null);Lt(Yt,Yt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return XM(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lt(Yt,Yt.current),r)break;return null;case 22:case 23:return t.lanes=0,qM(e,t,n)}return Rs(e,t,n)}var QM,Vb,JM,ZM;QM=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vb=function(){};JM=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ma(qi.current);var s=null;switch(n){case"input":i=fb(e,i),r=fb(e,r),s=[];break;case"select":i=Qt({},i,{value:void 0}),r=Qt({},r,{value:void 0}),s=[];break;case"textarea":i=gb(e,i),r=gb(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=pg)}yb(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(yh.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(yh.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&It("scroll",e),s||o===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};ZM=function(e,t,n,r){n!==r&&(t.flags|=4)};function cd(e,t){if(!qt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function UH(e,t,n){var r=t.pendingProps;switch(A2(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(t),null;case 1:return dr(t.type)&&mg(),Nn(t),null;case 3:return r=t.stateNode,qc(),Ht(ur),Ht(Wn),F2(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Tp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hi!==null&&(Zb(hi),hi=null))),Vb(e,t),Nn(t),null;case 5:B2(t);var i=ma(Rh.current);if(n=t.type,e!==null&&t.stateNode!=null)JM(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ue(166));return Nn(t),null}if(e=ma(qi.current),Tp(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Fi]=t,r[$h]=s,e=(t.mode&1)!==0,n){case"dialog":It("cancel",r),It("close",r);break;case"iframe":case"object":case"embed":It("load",r);break;case"video":case"audio":for(i=0;i<zd.length;i++)It(zd[i],r);break;case"source":It("error",r);break;case"img":case"image":case"link":It("error",r),It("load",r);break;case"details":It("toggle",r);break;case"input":Z3(r,s),It("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},It("invalid",r);break;case"textarea":tk(r,s),It("invalid",r)}yb(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&Ep(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&Ep(r.textContent,o,e),i=["children",""+o]):yh.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&It("scroll",r)}switch(n){case"input":yp(r),ek(r,s,!0);break;case"textarea":yp(r),nk(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=pg)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=E7(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Fi]=t,e[$h]=r,QM(e,t,!1,!1),t.stateNode=e;e:{switch(a=_b(n,r),n){case"dialog":It("cancel",e),It("close",e),i=r;break;case"iframe":case"object":case"embed":It("load",e),i=r;break;case"video":case"audio":for(i=0;i<zd.length;i++)It(zd[i],e);i=r;break;case"source":It("error",e),i=r;break;case"img":case"image":case"link":It("error",e),It("load",e),i=r;break;case"details":It("toggle",e),i=r;break;case"input":Z3(e,r),i=fb(e,r),It("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qt({},r,{value:void 0}),It("invalid",e);break;case"textarea":tk(e,r),i=gb(e,r),It("invalid",e);break;default:i=r}yb(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?M7(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&T7(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&_h(e,l):typeof l=="number"&&_h(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(yh.hasOwnProperty(s)?l!=null&&s==="onScroll"&&It("scroll",e):l!=null&&g2(e,s,l,a))}switch(n){case"input":yp(e),ek(e,r,!1);break;case"textarea":yp(e),nk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Po(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?lc(e,!!r.multiple,s,!1):r.defaultValue!=null&&lc(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=pg)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Nn(t),null;case 6:if(e&&t.stateNode!=null)ZM(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ue(166));if(n=ma(Rh.current),ma(qi.current),Tp(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fi]=t,(s=r.nodeValue!==n)&&(e=$r,e!==null))switch(e.tag){case 3:Ep(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ep(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fi]=t,t.stateNode=r}return Nn(t),null;case 13:if(Ht(Yt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qt&&kr!==null&&t.mode&1&&!(t.flags&128))gM(),Uc(),t.flags|=98560,s=!1;else if(s=Tp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(ue(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ue(317));s[Fi]=t}else Uc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nn(t),s=!1}else hi!==null&&(Zb(hi),hi=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Yt.current&1?gn===0&&(gn=3):J2())),t.updateQueue!==null&&(t.flags|=4),Nn(t),null);case 4:return qc(),Vb(e,t),e===null&&Eh(t.stateNode.containerInfo),Nn(t),null;case 10:return O2(t.type._context),Nn(t),null;case 17:return dr(t.type)&&mg(),Nn(t),null;case 19:if(Ht(Yt),s=t.memoizedState,s===null)return Nn(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)cd(s,!1);else{if(gn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=wg(e),a!==null){for(t.flags|=128,cd(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Lt(Yt,Yt.current&1|2),t.child}e=e.sibling}s.tail!==null&&rn()>Gc&&(t.flags|=128,r=!0,cd(s,!1),t.lanes=4194304)}else{if(!r)if(e=wg(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cd(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!qt)return Nn(t),null}else 2*rn()-s.renderingStartTime>Gc&&n!==1073741824&&(t.flags|=128,r=!0,cd(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=rn(),t.sibling=null,n=Yt.current,Lt(Yt,r?n&1|2:n&1),t):(Nn(t),null);case 22:case 23:return Q2(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sr&1073741824&&(Nn(t),t.subtreeFlags&6&&(t.flags|=8192)):Nn(t),null;case 24:return null;case 25:return null}throw Error(ue(156,t.tag))}function VH(e,t){switch(A2(t),t.tag){case 1:return dr(t.type)&&mg(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qc(),Ht(ur),Ht(Wn),F2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return B2(t),null;case 13:if(Ht(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ue(340));Uc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ht(Yt),null;case 4:return qc(),null;case 10:return O2(t.type._context),null;case 22:case 23:return Q2(),null;case 24:return null;default:return null}}var Rp=!1,Bn=!1,qH=typeof WeakSet=="function"?WeakSet:Set,Se=null;function nc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){en(e,t,r)}else n.current=null}function qb(e,t,n){try{n()}catch(r){en(e,t,r)}}var Vk=!1;function KH(e,t){if(Mb=dg,e=rM(),M2(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,d=0,u=e,h=null;t:for(;;){for(var f;u!==n||i!==0&&u.nodeType!==3||(o=a+i),u!==s||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(f=u.firstChild)!==null;)h=u,u=f;for(;;){if(u===e)break t;if(h===n&&++c===i&&(o=a),h===s&&++d===r&&(l=a),(f=u.nextSibling)!==null)break;u=h,h=u.parentNode}u=f}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rb={focusedElem:e,selectionRange:n},dg=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var y=b.memoizedProps,m=b.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:ai(t.type,y),m);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ue(163))}}catch(S){en(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return b=Vk,Vk=!1,b}function rh(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&qb(t,n,s)}i=i.next}while(i!==r)}}function K0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Kb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function eR(e){var t=e.alternate;t!==null&&(e.alternate=null,eR(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fi],delete t[$h],delete t[Db],delete t[MH],delete t[RH])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function tR(e){return e.tag===5||e.tag===3||e.tag===4}function qk(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tR(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pg));else if(r!==4&&(e=e.child,e!==null))for(Gb(e,t,n),e=e.sibling;e!==null;)Gb(e,t,n),e=e.sibling}function Yb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yb(e,t,n),e=e.sibling;e!==null;)Yb(e,t,n),e=e.sibling}var An=null,ci=!1;function Ks(e,t,n){for(n=n.child;n!==null;)nR(e,t,n),n=n.sibling}function nR(e,t,n){if(Vi&&typeof Vi.onCommitFiberUnmount=="function")try{Vi.onCommitFiberUnmount(B0,n)}catch{}switch(n.tag){case 5:Bn||nc(n,t);case 6:var r=An,i=ci;An=null,Ks(e,t,n),An=r,ci=i,An!==null&&(ci?(e=An,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):An.removeChild(n.stateNode));break;case 18:An!==null&&(ci?(e=An,n=n.stateNode,e.nodeType===8?Py(e.parentNode,n):e.nodeType===1&&Py(e,n),Sh(e)):Py(An,n.stateNode));break;case 4:r=An,i=ci,An=n.stateNode.containerInfo,ci=!0,Ks(e,t,n),An=r,ci=i;break;case 0:case 11:case 14:case 15:if(!Bn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&qb(n,t,a),i=i.next}while(i!==r)}Ks(e,t,n);break;case 1:if(!Bn&&(nc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){en(n,t,o)}Ks(e,t,n);break;case 21:Ks(e,t,n);break;case 22:n.mode&1?(Bn=(r=Bn)||n.memoizedState!==null,Ks(e,t,n),Bn=r):Ks(e,t,n);break;default:Ks(e,t,n)}}function Kk(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new qH),t.forEach(function(r){var i=nW.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function si(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:An=o.stateNode,ci=!1;break e;case 3:An=o.stateNode.containerInfo,ci=!0;break e;case 4:An=o.stateNode.containerInfo,ci=!0;break e}o=o.return}if(An===null)throw Error(ue(160));nR(s,a,i),An=null,ci=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){en(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)rR(t,e),t=t.sibling}function rR(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(si(t,e),Ri(e),r&4){try{rh(3,e,e.return),K0(3,e)}catch(y){en(e,e.return,y)}try{rh(5,e,e.return)}catch(y){en(e,e.return,y)}}break;case 1:si(t,e),Ri(e),r&512&&n!==null&&nc(n,n.return);break;case 5:if(si(t,e),Ri(e),r&512&&n!==null&&nc(n,n.return),e.flags&32){var i=e.stateNode;try{_h(i,"")}catch(y){en(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&C7(i,s),_b(o,a);var c=_b(o,s);for(a=0;a<l.length;a+=2){var d=l[a],u=l[a+1];d==="style"?M7(i,u):d==="dangerouslySetInnerHTML"?T7(i,u):d==="children"?_h(i,u):g2(i,d,u,c)}switch(o){case"input":pb(i,s);break;case"textarea":k7(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?lc(i,!!s.multiple,f,!1):h!==!!s.multiple&&(s.defaultValue!=null?lc(i,!!s.multiple,s.defaultValue,!0):lc(i,!!s.multiple,s.multiple?[]:"",!1))}i[$h]=s}catch(y){en(e,e.return,y)}}break;case 6:if(si(t,e),Ri(e),r&4){if(e.stateNode===null)throw Error(ue(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){en(e,e.return,y)}}break;case 3:if(si(t,e),Ri(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Sh(t.containerInfo)}catch(y){en(e,e.return,y)}break;case 4:si(t,e),Ri(e);break;case 13:si(t,e),Ri(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Y2=rn())),r&4&&Kk(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Bn=(c=Bn)||d,si(t,e),Bn=c):si(t,e),Ri(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(Se=e,d=e.child;d!==null;){for(u=Se=d;Se!==null;){switch(h=Se,f=h.child,h.tag){case 0:case 11:case 14:case 15:rh(4,h,h.return);break;case 1:nc(h,h.return);var b=h.stateNode;if(typeof b.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(y){en(r,n,y)}}break;case 5:nc(h,h.return);break;case 22:if(h.memoizedState!==null){Yk(u);continue}}f!==null?(f.return=h,Se=f):Yk(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=u.stateNode,l=u.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=$7("display",a))}catch(y){en(e,e.return,y)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(y){en(e,e.return,y)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:si(t,e),Ri(e),r&4&&Kk(e);break;case 21:break;default:si(t,e),Ri(e)}}function Ri(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(tR(n)){var r=n;break e}n=n.return}throw Error(ue(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(_h(i,""),r.flags&=-33);var s=qk(e);Yb(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=qk(e);Gb(e,o,a);break;default:throw Error(ue(161))}}catch(l){en(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function GH(e,t,n){Se=e,iR(e)}function iR(e,t,n){for(var r=(e.mode&1)!==0;Se!==null;){var i=Se,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Rp;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Bn;o=Rp;var c=Bn;if(Rp=a,(Bn=l)&&!c)for(Se=i;Se!==null;)a=Se,l=a.child,a.tag===22&&a.memoizedState!==null?Xk(i):l!==null?(l.return=a,Se=l):Xk(i);for(;s!==null;)Se=s,iR(s),s=s.sibling;Se=i,Rp=o,Bn=c}Gk(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Se=s):Gk(e)}}function Gk(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Bn||K0(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Bn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ai(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Ak(t,s,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ak(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&Sh(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ue(163))}Bn||t.flags&512&&Kb(t)}catch(h){en(t,t.return,h)}}if(t===e){Se=null;break}if(n=t.sibling,n!==null){n.return=t.return,Se=n;break}Se=t.return}}function Yk(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Se=n;break}Se=t.return}}function Xk(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{K0(4,t)}catch(l){en(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){en(t,i,l)}}var s=t.return;try{Kb(t)}catch(l){en(t,s,l)}break;case 5:var a=t.return;try{Kb(t)}catch(l){en(t,a,l)}}}catch(l){en(t,t.return,l)}if(t===e){Se=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Se=o;break}Se=t.return}}var YH=Math.ceil,kg=zs.ReactCurrentDispatcher,K2=zs.ReactCurrentOwner,Yr=zs.ReactCurrentBatchConfig,at=0,En=null,ln=null,Ln=0,Sr=0,rc=Xo(0),gn=0,Ph=null,Wa=0,G0=0,G2=0,ih=null,ar=null,Y2=0,Gc=1/0,ps=null,Eg=!1,Xb=null,Ro=null,Ap=!1,_o=null,Tg=0,sh=0,Qb=null,Lm=-1,Dm=0;function Qn(){return at&6?rn():Lm!==-1?Lm:Lm=rn()}function Ao(e){return e.mode&1?at&2&&Ln!==0?Ln&-Ln:LH.transition!==null?(Dm===0&&(Dm=z7()),Dm):(e=_t,e!==0||(e=window.event,e=e===void 0?16:G7(e.type)),e):1}function yi(e,t,n,r){if(50<sh)throw sh=0,Qb=null,Error(ue(185));Rf(e,n,r),(!(at&2)||e!==En)&&(e===En&&(!(at&2)&&(G0|=n),gn===4&&oo(e,Ln)),hr(e,r),n===1&&at===0&&!(t.mode&1)&&(Gc=rn()+500,U0&&Qo()))}function hr(e,t){var n=e.callbackNode;Lz(e,t);var r=ug(e,e===En?Ln:0);if(r===0)n!==null&&sk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sk(n),t===1)e.tag===0?AH(Qk.bind(null,e)):fM(Qk.bind(null,e)),TH(function(){!(at&6)&&Qo()}),n=null;else{switch(H7(r)){case 1:n=x2;break;case 4:n=B7;break;case 16:n=cg;break;case 536870912:n=F7;break;default:n=cg}n=hR(n,sR.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function sR(e,t){if(Lm=-1,Dm=0,at&6)throw Error(ue(327));var n=e.callbackNode;if(fc()&&e.callbackNode!==n)return null;var r=ug(e,e===En?Ln:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=$g(e,r);else{t=r;var i=at;at|=2;var s=aR();(En!==e||Ln!==t)&&(ps=null,Gc=rn()+500,La(e,t));do try{JH();break}catch(o){oR(e,o)}while(!0);P2(),kg.current=s,at=i,ln!==null?t=0:(En=null,Ln=0,t=gn)}if(t!==0){if(t===2&&(i=Cb(e),i!==0&&(r=i,t=Jb(e,i))),t===1)throw n=Ph,La(e,0),oo(e,r),hr(e,rn()),n;if(t===6)oo(e,r);else{if(i=e.current.alternate,!(r&30)&&!XH(i)&&(t=$g(e,r),t===2&&(s=Cb(e),s!==0&&(r=s,t=Jb(e,s))),t===1))throw n=Ph,La(e,0),oo(e,r),hr(e,rn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ue(345));case 2:oa(e,ar,ps);break;case 3:if(oo(e,r),(r&130023424)===r&&(t=Y2+500-rn(),10<t)){if(ug(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Qn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Lb(oa.bind(null,e,ar,ps),t);break}oa(e,ar,ps);break;case 4:if(oo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-vi(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YH(r/1960))-r,10<r){e.timeoutHandle=Lb(oa.bind(null,e,ar,ps),r);break}oa(e,ar,ps);break;case 5:oa(e,ar,ps);break;default:throw Error(ue(329))}}}return hr(e,rn()),e.callbackNode===n?sR.bind(null,e):null}function Jb(e,t){var n=ih;return e.current.memoizedState.isDehydrated&&(La(e,t).flags|=256),e=$g(e,t),e!==2&&(t=ar,ar=n,t!==null&&Zb(t)),e}function Zb(e){ar===null?ar=e:ar.push.apply(ar,e)}function XH(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!xi(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function oo(e,t){for(t&=~G2,t&=~G0,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-vi(t),r=1<<n;e[n]=-1,t&=~r}}function Qk(e){if(at&6)throw Error(ue(327));fc();var t=ug(e,0);if(!(t&1))return hr(e,rn()),null;var n=$g(e,t);if(e.tag!==0&&n===2){var r=Cb(e);r!==0&&(t=r,n=Jb(e,r))}if(n===1)throw n=Ph,La(e,0),oo(e,t),hr(e,rn()),n;if(n===6)throw Error(ue(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,oa(e,ar,ps),hr(e,rn()),null}function X2(e,t){var n=at;at|=1;try{return e(t)}finally{at=n,at===0&&(Gc=rn()+500,U0&&Qo())}}function Ua(e){_o!==null&&_o.tag===0&&!(at&6)&&fc();var t=at;at|=1;var n=Yr.transition,r=_t;try{if(Yr.transition=null,_t=1,e)return e()}finally{_t=r,Yr.transition=n,at=t,!(at&6)&&Qo()}}function Q2(){Sr=rc.current,Ht(rc)}function La(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,EH(n)),ln!==null)for(n=ln.return;n!==null;){var r=n;switch(A2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mg();break;case 3:qc(),Ht(ur),Ht(Wn),F2();break;case 5:B2(r);break;case 4:qc();break;case 13:Ht(Yt);break;case 19:Ht(Yt);break;case 10:O2(r.type._context);break;case 22:case 23:Q2()}n=n.return}if(En=e,ln=e=Lo(e.current,null),Ln=Sr=t,gn=0,Ph=null,G2=G0=Wa=0,ar=ih=null,pa!==null){for(t=0;t<pa.length;t++)if(n=pa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}pa=null}return e}function oR(e,t){do{var n=ln;try{if(P2(),Mm.current=Cg,Sg){for(var r=Xt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Sg=!1}if(Ha=0,Cn=fn=Xt=null,nh=!1,Ah=0,K2.current=null,n===null||n.return===null){gn=1,Ph=t,ln=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=Ln,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=o,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=jk(a);if(f!==null){f.flags&=-257,Bk(f,a,o,s,t),f.mode&1&&Ik(s,c,t),t=f,l=c;var b=t.updateQueue;if(b===null){var y=new Set;y.add(l),t.updateQueue=y}else b.add(l);break e}else{if(!(t&1)){Ik(s,c,t),J2();break e}l=Error(ue(426))}}else if(qt&&o.mode&1){var m=jk(a);if(m!==null){!(m.flags&65536)&&(m.flags|=256),Bk(m,a,o,s,t),L2(Kc(l,o));break e}}s=l=Kc(l,o),gn!==4&&(gn=2),ih===null?ih=[s]:ih.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=WM(s,l,t);Rk(s,p);break e;case 1:o=l;var g=s.type,_=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Ro===null||!Ro.has(_)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=UM(s,o,t);Rk(s,S);break e}}s=s.return}while(s!==null)}cR(n)}catch(k){t=k,ln===n&&n!==null&&(ln=n=n.return);continue}break}while(!0)}function aR(){var e=kg.current;return kg.current=Cg,e===null?Cg:e}function J2(){(gn===0||gn===3||gn===2)&&(gn=4),En===null||!(Wa&268435455)&&!(G0&268435455)||oo(En,Ln)}function $g(e,t){var n=at;at|=2;var r=aR();(En!==e||Ln!==t)&&(ps=null,La(e,t));do try{QH();break}catch(i){oR(e,i)}while(!0);if(P2(),at=n,kg.current=r,ln!==null)throw Error(ue(261));return En=null,Ln=0,gn}function QH(){for(;ln!==null;)lR(ln)}function JH(){for(;ln!==null&&!Sz();)lR(ln)}function lR(e){var t=dR(e.alternate,e,Sr);e.memoizedProps=e.pendingProps,t===null?cR(e):ln=t,K2.current=null}function cR(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=VH(n,t),n!==null){n.flags&=32767,ln=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gn=6,ln=null;return}}else if(n=UH(n,t,Sr),n!==null){ln=n;return}if(t=t.sibling,t!==null){ln=t;return}ln=t=e}while(t!==null);gn===0&&(gn=5)}function oa(e,t,n){var r=_t,i=Yr.transition;try{Yr.transition=null,_t=1,ZH(e,t,n,r)}finally{Yr.transition=i,_t=r}return null}function ZH(e,t,n,r){do fc();while(_o!==null);if(at&6)throw Error(ue(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ue(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Dz(e,s),e===En&&(ln=En=null,Ln=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ap||(Ap=!0,hR(cg,function(){return fc(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Yr.transition,Yr.transition=null;var a=_t;_t=1;var o=at;at|=4,K2.current=null,KH(e,n),rR(n,e),_H(Rb),dg=!!Mb,Rb=Mb=null,e.current=n,GH(n),Cz(),at=o,_t=a,Yr.transition=s}else e.current=n;if(Ap&&(Ap=!1,_o=e,Tg=i),s=e.pendingLanes,s===0&&(Ro=null),Tz(n.stateNode),hr(e,rn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Eg)throw Eg=!1,e=Xb,Xb=null,e;return Tg&1&&e.tag!==0&&fc(),s=e.pendingLanes,s&1?e===Qb?sh++:(sh=0,Qb=e):sh=0,Qo(),null}function fc(){if(_o!==null){var e=H7(Tg),t=Yr.transition,n=_t;try{if(Yr.transition=null,_t=16>e?16:e,_o===null)var r=!1;else{if(e=_o,_o=null,Tg=0,at&6)throw Error(ue(331));var i=at;for(at|=4,Se=e.current;Se!==null;){var s=Se,a=s.child;if(Se.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(Se=c;Se!==null;){var d=Se;switch(d.tag){case 0:case 11:case 15:rh(8,d,s)}var u=d.child;if(u!==null)u.return=d,Se=u;else for(;Se!==null;){d=Se;var h=d.sibling,f=d.return;if(eR(d),d===c){Se=null;break}if(h!==null){h.return=f,Se=h;break}Se=f}}}var b=s.alternate;if(b!==null){var y=b.child;if(y!==null){b.child=null;do{var m=y.sibling;y.sibling=null,y=m}while(y!==null)}}Se=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Se=a;else e:for(;Se!==null;){if(s=Se,s.flags&2048)switch(s.tag){case 0:case 11:case 15:rh(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,Se=p;break e}Se=s.return}}var g=e.current;for(Se=g;Se!==null;){a=Se;var _=a.child;if(a.subtreeFlags&2064&&_!==null)_.return=a,Se=_;else e:for(a=g;Se!==null;){if(o=Se,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:K0(9,o)}}catch(k){en(o,o.return,k)}if(o===a){Se=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,Se=S;break e}Se=o.return}}if(at=i,Qo(),Vi&&typeof Vi.onPostCommitFiberRoot=="function")try{Vi.onPostCommitFiberRoot(B0,e)}catch{}r=!0}return r}finally{_t=n,Yr.transition=t}}return!1}function Jk(e,t,n){t=Kc(n,t),t=WM(e,t,1),e=Mo(e,t,1),t=Qn(),e!==null&&(Rf(e,1,t),hr(e,t))}function en(e,t,n){if(e.tag===3)Jk(e,e,n);else for(;t!==null;){if(t.tag===3){Jk(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ro===null||!Ro.has(r))){e=Kc(n,e),e=UM(t,e,1),t=Mo(t,e,1),e=Qn(),t!==null&&(Rf(t,1,e),hr(t,e));break}}t=t.return}}function eW(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qn(),e.pingedLanes|=e.suspendedLanes&n,En===e&&(Ln&n)===n&&(gn===4||gn===3&&(Ln&130023424)===Ln&&500>rn()-Y2?La(e,0):G2|=n),hr(e,t)}function uR(e,t){t===0&&(e.mode&1?(t=xp,xp<<=1,!(xp&130023424)&&(xp=4194304)):t=1);var n=Qn();e=Ms(e,t),e!==null&&(Rf(e,t,n),hr(e,n))}function tW(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uR(e,n)}function nW(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ue(314))}r!==null&&r.delete(t),uR(e,n)}var dR;dR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ur.current)cr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return cr=!1,WH(e,t,n);cr=!!(e.flags&131072)}else cr=!1,qt&&t.flags&1048576&&pM(t,yg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Am(e,t),e=t.pendingProps;var i=Wc(t,Wn.current);hc(t,n),i=H2(null,t,r,e,i,n);var s=W2();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dr(r)?(s=!0,gg(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,I2(t),i.updater=V0,t.stateNode=i,i._reactInternals=t,Bb(t,r,e,n),t=Hb(null,t,r,!0,s,n)):(t.tag=0,qt&&s&&R2(t),Kn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Am(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=iW(r),e=ai(r,e),i){case 0:t=zb(null,t,r,e,n);break e;case 1:t=Hk(null,t,r,e,n);break e;case 11:t=Fk(null,t,r,e,n);break e;case 14:t=zk(null,t,r,ai(r.type,e),n);break e}throw Error(ue(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ai(r,i),zb(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ai(r,i),Hk(e,t,r,i,n);case 3:e:{if(GM(t),e===null)throw Error(ue(387));r=t.pendingProps,s=t.memoizedState,i=s.element,yM(e,t),xg(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Kc(Error(ue(423)),t),t=Wk(e,t,r,n,i);break e}else if(r!==i){i=Kc(Error(ue(424)),t),t=Wk(e,t,r,n,i);break e}else for(kr=$o(t.stateNode.containerInfo.firstChild),$r=t,qt=!0,hi=null,n=wM(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Uc(),r===i){t=Rs(e,t,n);break e}Kn(e,t,r,n)}t=t.child}return t;case 5:return SM(t),e===null&&Nb(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,Ab(r,i)?a=null:s!==null&&Ab(r,s)&&(t.flags|=32),KM(e,t),Kn(e,t,a,n),t.child;case 6:return e===null&&Nb(t),null;case 13:return YM(e,t,n);case 4:return j2(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Vc(t,null,r,n):Kn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ai(r,i),Fk(e,t,r,i,n);case 7:return Kn(e,t,t.pendingProps,n),t.child;case 8:return Kn(e,t,t.pendingProps.children,n),t.child;case 12:return Kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Lt(_g,r._currentValue),r._currentValue=a,s!==null)if(xi(s.value,a)){if(s.children===i.children&&!ur.current){t=Rs(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Es(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ib(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(ue(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ib(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Kn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,hc(t,n),i=Zr(i),r=r(i),t.flags|=1,Kn(e,t,r,n),t.child;case 14:return r=t.type,i=ai(r,t.pendingProps),i=ai(r.type,i),zk(e,t,r,i,n);case 15:return VM(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ai(r,i),Am(e,t),t.tag=1,dr(r)?(e=!0,gg(t)):e=!1,hc(t,n),bM(t,r,i),Bb(t,r,i,n),Hb(null,t,r,!0,e,n);case 19:return XM(e,t,n);case 22:return qM(e,t,n)}throw Error(ue(156,t.tag))};function hR(e,t){return j7(e,t)}function rW(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,n,r){return new rW(e,t,n,r)}function Z2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iW(e){if(typeof e=="function")return Z2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===y2)return 11;if(e===_2)return 14}return 2}function Lo(e,t){var n=e.alternate;return n===null?(n=Kr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pm(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")Z2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Kl:return Da(n.children,i,s,t);case v2:a=8,i|=8;break;case cb:return e=Kr(12,n,t,i|2),e.elementType=cb,e.lanes=s,e;case ub:return e=Kr(13,n,t,i),e.elementType=ub,e.lanes=s,e;case db:return e=Kr(19,n,t,i),e.elementType=db,e.lanes=s,e;case x7:return Y0(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _7:a=10;break e;case b7:a=9;break e;case y2:a=11;break e;case _2:a=14;break e;case to:a=16,r=null;break e}throw Error(ue(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Da(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Y0(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=x7,e.lanes=n,e.stateNode={isHidden:!1},e}function Hy(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Wy(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sW(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sy(0),this.expirationTimes=Sy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function eS(e,t,n,r,i,s,a,o,l){return e=new sW(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Kr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},I2(s),e}function oW(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ql,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fR(e){if(!e)return Oo;e=e._reactInternals;e:{if(il(e)!==e||e.tag!==1)throw Error(ue(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ue(171))}if(e.tag===1){var n=e.type;if(dr(n))return hM(e,n,t)}return t}function pR(e,t,n,r,i,s,a,o,l){return e=eS(n,r,!0,e,i,s,a,o,l),e.context=fR(null),n=e.current,r=Qn(),i=Ao(n),s=Es(r,i),s.callback=t??null,Mo(n,s,i),e.current.lanes=i,Rf(e,i,r),hr(e,r),e}function X0(e,t,n,r){var i=t.current,s=Qn(),a=Ao(i);return n=fR(n),t.context===null?t.context=n:t.pendingContext=n,t=Es(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Mo(i,t,a),e!==null&&(yi(e,i,a,s),$m(e,i,a)),a}function Mg(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Zk(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tS(e,t){Zk(e,t),(e=e.alternate)&&Zk(e,t)}function aW(){return null}var mR=typeof reportError=="function"?reportError:function(e){console.error(e)};function nS(e){this._internalRoot=e}Q0.prototype.render=nS.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ue(409));X0(e,t,null,null)};Q0.prototype.unmount=nS.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ua(function(){X0(null,e,null,null)}),t[$s]=null}};function Q0(e){this._internalRoot=e}Q0.prototype.unstable_scheduleHydration=function(e){if(e){var t=V7();e={blockedOn:null,target:e,priority:t};for(var n=0;n<so.length&&t!==0&&t<so[n].priority;n++);so.splice(n,0,e),n===0&&K7(e)}};function rS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function J0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function eE(){}function lW(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Mg(a);s.call(c)}}var a=pR(t,r,e,0,null,!1,!1,"",eE);return e._reactRootContainer=a,e[$s]=a.current,Eh(e.nodeType===8?e.parentNode:e),Ua(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Mg(l);o.call(c)}}var l=eS(e,0,!1,null,null,!1,!1,"",eE);return e._reactRootContainer=l,e[$s]=l.current,Eh(e.nodeType===8?e.parentNode:e),Ua(function(){X0(t,l,n,r)}),l}function Z0(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=Mg(a);o.call(l)}}X0(t,a,e,i)}else a=lW(n,t,e,i,r);return Mg(a)}W7=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Fd(t.pendingLanes);n!==0&&(w2(t,n|1),hr(t,rn()),!(at&6)&&(Gc=rn()+500,Qo()))}break;case 13:Ua(function(){var r=Ms(e,1);if(r!==null){var i=Qn();yi(r,e,1,i)}}),tS(e,1)}};S2=function(e){if(e.tag===13){var t=Ms(e,134217728);if(t!==null){var n=Qn();yi(t,e,134217728,n)}tS(e,134217728)}};U7=function(e){if(e.tag===13){var t=Ao(e),n=Ms(e,t);if(n!==null){var r=Qn();yi(n,e,t,r)}tS(e,t)}};V7=function(){return _t};q7=function(e,t){var n=_t;try{return _t=e,t()}finally{_t=n}};xb=function(e,t,n){switch(t){case"input":if(pb(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=W0(r);if(!i)throw Error(ue(90));S7(r),pb(r,i)}}}break;case"textarea":k7(e,n);break;case"select":t=n.value,t!=null&&lc(e,!!n.multiple,t,!1)}};L7=X2;D7=Ua;var cW={usingClientEntryPoint:!1,Events:[Lf,Ql,W0,R7,A7,X2]},ud={findFiberByHostInstance:fa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},uW={bundleType:ud.bundleType,version:ud.version,rendererPackageName:ud.rendererPackageName,rendererConfig:ud.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:zs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=N7(e),e===null?null:e.stateNode},findFiberByHostInstance:ud.findFiberByHostInstance||aW,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lp.isDisabled&&Lp.supportsFiber)try{B0=Lp.inject(uW),Vi=Lp}catch{}}Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cW;Lr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rS(t))throw Error(ue(200));return oW(e,t,null,n)};Lr.createRoot=function(e,t){if(!rS(e))throw Error(ue(299));var n=!1,r="",i=mR;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=eS(e,1,!1,null,null,n,!1,r,i),e[$s]=t.current,Eh(e.nodeType===8?e.parentNode:e),new nS(t)};Lr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ue(188)):(e=Object.keys(e).join(","),Error(ue(268,e)));return e=N7(t),e=e===null?null:e.stateNode,e};Lr.flushSync=function(e){return Ua(e)};Lr.hydrate=function(e,t,n){if(!J0(t))throw Error(ue(200));return Z0(null,e,t,!0,n)};Lr.hydrateRoot=function(e,t,n){if(!rS(e))throw Error(ue(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=mR;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=pR(t,null,e,1,n??null,i,!1,s,a),e[$s]=t.current,Eh(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Q0(t)};Lr.render=function(e,t,n){if(!J0(t))throw Error(ue(200));return Z0(null,e,t,!1,n)};Lr.unmountComponentAtNode=function(e){if(!J0(e))throw Error(ue(40));return e._reactRootContainer?(Ua(function(){Z0(null,null,e,!1,function(){e._reactRootContainer=null,e[$s]=null})}),!0):!1};Lr.unstable_batchedUpdates=X2;Lr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!J0(n))throw Error(ue(200));if(e==null||e._reactInternals===void 0)throw Error(ue(38));return Z0(e,t,n,!1,r)};Lr.version="18.2.0-next-9e3b772b8-20220608";function gR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gR)}catch(e){console.error(e)}}gR(),p7.exports=Lr;var Yn=p7.exports;const vR=vn(Yn);var tE=Yn;ab.createRoot=tE.createRoot,ab.hydrateRoot=tE.hydrateRoot;var dW=typeof vo=="object"&&vo&&vo.Object===Object&&vo,hW=typeof self=="object"&&self&&self.Object===Object&&self;dW||hW||Function("return this")();var fW=typeof window<"u"?x.useLayoutEffect:x.useEffect;function wi(e,t,n,r){const i=x.useRef(t);fW(()=>{i.current=t},[t]),x.useEffect(()=>{const s=(n==null?void 0:n.current)??window;if(!(s&&s.addEventListener))return;const a=o=>{i.current(o)};return s.addEventListener(e,a,r),()=>{s.removeEventListener(e,a,r)}},[e,n,r])}function pW(e,t,n="mousedown",r={}){wi(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(e)?e.filter(o=>!!o.current).every(o=>o.current&&!o.current.contains(s)):e.current&&!e.current.contains(s))&&t(i)},void 0,r)}var yR={exports:{}},_R={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Yc=x;function mW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gW=typeof Object.is=="function"?Object.is:mW,vW=Yc.useState,yW=Yc.useEffect,_W=Yc.useLayoutEffect,bW=Yc.useDebugValue;function xW(e,t){var n=t(),r=vW({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return _W(function(){i.value=n,i.getSnapshot=t,Uy(i)&&s({inst:i})},[e,n,t]),yW(function(){return Uy(i)&&s({inst:i}),e(function(){Uy(i)&&s({inst:i})})},[e]),bW(n),n}function Uy(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gW(e,n)}catch{return!0}}function wW(e,t){return t()}var SW=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wW:xW;_R.useSyncExternalStore=Yc.useSyncExternalStore!==void 0?Yc.useSyncExternalStore:SW;yR.exports=_R;var bR=yR.exports;const{useEffect:CW,useLayoutEffect:kW,useRef:EW,useInsertionEffect:TW}=d7,$W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",MW=$W?kW:CW,RW=TW||MW,xR=e=>{const t=EW([e,(...n)=>t[0](...n)]).current;return RW(()=>{t[0]=e}),t[1]},AW=(e="",t=location.pathname)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",LW=(e,t="")=>e[0]==="~"?e.slice(1):t+e,DW="popstate",iS="pushState",sS="replaceState",PW="hashchange",nE=[DW,iS,sS,PW],OW=e=>{for(const t of nE)addEventListener(t,e);return()=>{for(const t of nE)removeEventListener(t,e)}},NW=(e,t)=>bR.useSyncExternalStore(OW,e,t),rE=()=>location.pathname,IW=({ssrPath:e}={})=>NW(rE,e?()=>e:rE),oS=(e,{replace:t=!1}={})=>history[t?sS:iS](null,"",e),jW=(e={})=>[AW(e.base,IW(e)),xR((t,n)=>oS(LW(t,e.base),n))];if(typeof history<"u")for(const e of[iS,sS]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}function BW(e=zW){let t={};const n=r=>t[r]||(t[r]=e(r));return(r,i)=>{const{regexp:s,keys:a}=n(r||""),o=s.exec(i);return o?[!0,a.reduce((c,d,u)=>(c[d.name]=o[u+1],c),{})]:[!1,null]}}const iE=e=>e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),FW=(e,t,n)=>{let r=e?"((?:[^\\/]+?)(?:\\/(?:[^\\/]+?))*)":"([^\\/]+?)";return t&&n&&(r="(?:\\/"+r+")"),r+(t?"?":"")},zW=e=>{const t=/:([A-Za-z0-9_]+)([?+*]?)/g;let n=null,r=0,i=[],s="";for(;(n=t.exec(e))!==null;){const[a,o,l]=n,c=l==="+"||l==="*",d=l==="?"||l==="*",u=d&&e[n.index-1]==="/"?1:0,h=e.substring(r,n.index-u);i.push({name:o}),r=t.lastIndex,s+=iE(h)+FW(c,d,u)}return s+=iE(e.substring(r)),{keys:i,regexp:new RegExp("^"+s+"(?:\\/)?$","i")}},HW={hook:jW,matcher:BW(),base:""},WW=x.createContext(HW),ev=()=>x.useContext(WW),tv=e=>e.hook(e),bu=()=>tv(ev()),Pf=e=>{const t=ev(),[n]=tv(t);return t.matcher(e,n)},UW=x.createContext({params:{}}),sE=(e,t)=>x.createElement(UW.Provider,{value:{params:e},children:t}),da=({path:e,match:t,component:n,children:r})=>{const i=Pf(e),[s,a]=t||i;return s?n?sE(a,x.createElement(n,{params:a})):sE(a,typeof r=="function"?r(a):r):null},No=x.forwardRef((e,t)=>{const n=ev(),[,r]=tv(n),{to:i,href:s=i,children:a,onClick:o}=e,l=xR(u=>{u.ctrlKey||u.metaKey||u.altKey||u.shiftKey||u.button!==0||(o&&o(u),u.defaultPrevented||(u.preventDefault(),r(i||s,e)))}),c={href:s[0]==="~"?s.slice(1):n.base+s,onClick:l,to:null,ref:t},d=x.isValidElement(a)?a:x.createElement("a",e);return x.cloneElement(d,c)}),ex=e=>Array.isArray(e)?[].concat(...e.map(t=>t&&t.type===x.Fragment?ex(t.props.children):ex(t))):[e],wR=({children:e,location:t})=>{const n=ev(),r=n.matcher,[i]=tv(n);for(const s of ex(e)){let a=0;if(x.isValidElement(s)&&(a=s.props.path?r(s.props.path,t||i):[!0,{}])[0])return x.cloneElement(s,{match:a})}return null};function SR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=SR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function VW(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=SR(e))&&(r&&(r+=" "),r+=t);return r}const aS="-";function qW(e){const t=GW(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(a){const o=a.split(aS);return o[0]===""&&o.length!==1&&o.shift(),CR(o,t)||KW(a)}function s(a,o){const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:s}}function CR(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?CR(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(aS);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId}const oE=/^\[(.+)\]$/;function KW(e){if(oE.test(e)){const t=oE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function GW(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return XW(Object.entries(e.classGroups),n).forEach(([s,a])=>{tx(a,r,s,t)}),r}function tx(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:aE(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(YW(i)){tx(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{tx(a,aE(t,s),n,r)})})}function aE(e,t){let n=e;return t.split(aS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function YW(e){return e.isThemeGetter}function XW(e,t){return t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[n,i]}):e}function QW(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(s,a){n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}}const kR="!";function JW(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(a){const o=[];let l=0,c=0,d;for(let y=0;y<a.length;y++){let m=a[y];if(l===0){if(m===r&&(n||a.slice(y,y+i)===t)){o.push(a.slice(c,y)),c=y+i;continue}if(m==="/"){d=y;continue}}m==="["?l++:m==="]"&&l--}const u=o.length===0?a:a.substring(c),h=u.startsWith(kR),f=h?u.substring(1):u,b=d&&d>c?d-c:void 0;return{modifiers:o,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:b}}}function ZW(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function eU(e){return{cache:QW(e.cacheSize),splitModifiers:JW(e),...qW(e)}}const tU=/\s+/;function nU(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=new Set;return e.trim().split(tU).map(a=>{const{modifiers:o,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=n(a);let u=r(d?c.substring(0,d):c),h=!!d;if(!u){if(!d)return{isTailwindClass:!1,originalClassName:a};if(u=r(c),!u)return{isTailwindClass:!1,originalClassName:a};h=!1}const f=ZW(o).join(":");return{isTailwindClass:!0,modifierId:l?f+kR:f,classGroupId:u,originalClassName:a,hasPostfixModifier:h}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:o,classGroupId:l,hasPostfixModifier:c}=a,d=o+l;return s.has(d)?!1:(s.add(d),i(l,c).forEach(u=>s.add(o+u)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function rU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ER(t))&&(r&&(r+=" "),r+=n);return r}function ER(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ER(e[r]))&&(n&&(n+=" "),n+=t);return n}function iU(e,...t){let n,r,i,s=a;function a(l){const c=t.reduce((d,u)=>u(d),e());return n=eU(c),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const c=r(l);if(c)return c;const d=nU(l,n);return i(l,d),d}return function(){return s(rU.apply(null,arguments))}}function Nt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const TR=/^\[(?:([a-z-]+):)?(.+)\]$/i,sU=/^\d+\/\d+$/,oU=new Set(["px","full","screen"]),aU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lU=/\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$/,cU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function cs(e){return ga(e)||oU.has(e)||sU.test(e)}function Gs(e){return xu(e,"length",_U)}function ga(e){return!!e&&!Number.isNaN(Number(e))}function Dp(e){return xu(e,"number",ga)}function dd(e){return!!e&&Number.isInteger(Number(e))}function hU(e){return e.endsWith("%")&&ga(e.slice(0,-1))}function Fe(e){return TR.test(e)}function Ys(e){return aU.test(e)}const fU=new Set(["length","size","percentage"]);function pU(e){return xu(e,fU,$R)}function mU(e){return xu(e,"position",$R)}const gU=new Set(["image","url"]);function vU(e){return xu(e,gU,xU)}function yU(e){return xu(e,"",bU)}function hd(){return!0}function xu(e,t,n){const r=TR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function _U(e){return lU.test(e)&&!cU.test(e)}function $R(){return!1}function bU(e){return uU.test(e)}function xU(e){return dU.test(e)}function wU(){const e=Nt("colors"),t=Nt("spacing"),n=Nt("blur"),r=Nt("brightness"),i=Nt("borderColor"),s=Nt("borderRadius"),a=Nt("borderSpacing"),o=Nt("borderWidth"),l=Nt("contrast"),c=Nt("grayscale"),d=Nt("hueRotate"),u=Nt("invert"),h=Nt("gap"),f=Nt("gradientColorStops"),b=Nt("gradientColorStopPositions"),y=Nt("inset"),m=Nt("margin"),p=Nt("opacity"),g=Nt("padding"),_=Nt("saturate"),S=Nt("scale"),k=Nt("sepia"),C=Nt("skew"),T=Nt("space"),w=Nt("translate"),E=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Fe,t],P=()=>[Fe,t],D=()=>["",cs,Gs],R=()=>["auto",ga,Fe],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],j=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",Fe],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[ga,Dp],H=()=>[ga,Fe];return{cacheSize:500,separator:":",theme:{colors:[hd],spacing:[cs,Gs],blur:["none","",Ys,Fe],brightness:F(),borderColor:[e],borderRadius:["none","","full",Ys,Fe],borderSpacing:P(),borderWidth:D(),contrast:F(),grayscale:L(),hueRotate:H(),invert:L(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[hU,Gs],inset:M(),margin:M(),opacity:F(),padding:P(),saturate:F(),scale:F(),sepia:L(),skew:H(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Fe]}],container:["container"],columns:[{columns:[Ys]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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"],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:[...O(),Fe]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dd,Fe]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Fe]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",dd,Fe]}],"grid-cols":[{"grid-cols":[hd]}],"col-start-end":[{col:["auto",{span:["full",dd,Fe]},Fe]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[hd]}],"row-start-end":[{row:["auto",{span:[dd,Fe]},Fe]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Fe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Fe,t]}],"min-w":[{"min-w":[Fe,t,"min","max","fit"]}],"max-w":[{"max-w":[Fe,t,"none","full","min","max","fit","prose",{screen:[Ys]},Ys]}],h:[{h:[Fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ys,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Dp]}],"font-family":[{font:[hd]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Fe]}],"line-clamp":[{"line-clamp":["none",ga,Dp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cs,Fe]}],"list-image":[{"list-image":["none",Fe]}],"list-style-type":[{list:["none","disc","decimal",Fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cs,Gs]}],"underline-offset":[{"underline-offset":["auto",cs,Fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),mU]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pU]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vU]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:N()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[cs,Fe]}],"outline-w":[{outline:[cs,Gs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[cs,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ys,yU]}],"shadow-color":[{shadow:[hd]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":I()}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ys,Fe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[_]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Fe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Fe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[dd,Fe]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cs,Gs,Dp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}}const SU=iU(wU);var Rg={en:{y:function(e){return"year"+(e===1?"":"s")},mo:function(e){return"month"+(e===1?"":"s")},w:function(e){return"week"+(e===1?"":"s")},d:function(e){return"day"+(e===1?"":"s")},h:function(e){return"hour"+(e===1?"":"s")},m:function(e){return"minute"+(e===1?"":"s")},s:function(e){return"second"+(e===1?"":"s")},ms:function(e){return"millisecond"+(e===1?"":"s")},decimal:"."},shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}};function MR(e){var t=function(r,i){var s=cE({},t,i||{});return kU(r,s)};return cE(t,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},e)}var nv=MR({});function CU(e){var t=[e.language];if(Ki(e,"fallbacks"))if(EU(e.fallbacks)&&e.fallbacks.length)t=t.concat(e.fallbacks);else throw new Error("fallbacks must be an array with at least one element");for(var n=0;n<t.length;n++){var r=t[n];if(Ki(e.languages,r))return e.languages[r];if(Ki(Rg,r))return Rg[r]}throw new Error("No language found.")}function kU(e,t){var n,r,i;e=Math.abs(e);var s=CU(t),a=[],o,l,c;for(n=0,r=t.units.length;n<r;n++){if(o=t.units[n],l=t.unitMeasures[o],n+1===r)if(Ki(t,"maxDecimalPoints")){var d=Math.pow(10,t.maxDecimalPoints),u=e/l;c=parseFloat((Math.floor(d*u)/d).toFixed(t.maxDecimalPoints))}else c=e/l;else c=Math.floor(e/l);a.push({unitCount:c,unitName:o}),e-=c*l}var h=0;for(n=0;n<a.length;n++)if(a[n].unitCount){h=n;break}if(t.round){var f,b;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)b=a[n-1],f=t.unitMeasures[b.unitName]/t.unitMeasures[i.unitName],(i.unitCount%f===0||t.largest&&t.largest-1<n-h)&&(b.unitCount+=i.unitCount/f,i.unitCount=0)}var y=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&y.push(lE(i.unitCount,i.unitName,s,t)),y.length!==t.largest);n++);if(y.length){var m;if(Ki(t,"delimiter")?m=t.delimiter:Ki(s,"delimiter")?m=s.delimiter:m=", ",!t.conjunction||y.length===1)return y.join(m);if(y.length===2)return y.join(t.conjunction);if(y.length>2)return y.slice(0,-1).join(m)+(t.serialComma?",":"")+t.conjunction+y.slice(-1)}else return lE(0,t.units[t.units.length-1],s,t)}function lE(e,t,n,r){var i;Ki(r,"decimal")?i=r.decimal:Ki(n,"decimal")?i=n.decimal:i=".";var s;typeof n._formatCount=="function"?s=n._formatCount(e,i):s=e.toString().replace(".",i);var a=n[t],o;return typeof a=="function"?o=a(e):o=a,n._numberFirst?o+r.spacer+s:s+r.spacer+o}function cE(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)Ki(t,r)&&(e[r]=t[r])}return e}var EU=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function Ki(e,t){return Object.prototype.hasOwnProperty.call(e,t)}nv.getSupportedLanguages=function(){var t=[];for(var n in Rg)Ki(Rg,n)&&n!=="gr"&&t.push(n);return t};nv.humanizer=MR;const Xi=Object.create(null);Xi.open="0";Xi.close="1";Xi.ping="2";Xi.pong="3";Xi.message="4";Xi.upgrade="5";Xi.noop="6";const Om=Object.create(null);Object.keys(Xi).forEach(e=>{Om[Xi[e]]=e});const nx={type:"error",data:"parser error"},RR=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",AR=typeof ArrayBuffer=="function",LR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,lS=({type:e,data:t},n,r)=>RR&&t instanceof Blob?n?r(t):uE(t,r):AR&&(t instanceof ArrayBuffer||LR(t))?n?r(t):uE(new Blob([t]),r):r(Xi[e]+(t||"")),uE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function dE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Vy;function TU(e,t){if(RR&&e.data instanceof Blob)return e.data.arrayBuffer().then(dE).then(t);if(AR&&(e.data instanceof ArrayBuffer||LR(e.data)))return t(dE(e.data));lS(e,!1,n=>{Vy||(Vy=new TextEncoder),t(Vy.encode(n))})}const hE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<hE.length;e++)Hd[hE.charCodeAt(e)]=e;const $U=e=>{let t=e.length*.75,n=e.length,r,i=0,s,a,o,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Hd[e.charCodeAt(r)],a=Hd[e.charCodeAt(r+1)],o=Hd[e.charCodeAt(r+2)],l=Hd[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|l&63;return c},MU=typeof ArrayBuffer=="function",cS=(e,t)=>{if(typeof e!="string")return{type:"message",data:DR(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:RU(e.substring(1),t)}:Om[n]?e.length>1?{type:Om[n],data:e.substring(1)}:{type:Om[n]}:nx},RU=(e,t)=>{if(MU){const n=$U(e);return DR(n,t)}else return{base64:!0,data:e}},DR=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},PR="",AU=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{lS(s,!1,o=>{r[a]=o,++i===n&&t(r.join(PR))})})},LU=(e,t)=>{const n=e.split(PR),r=[];for(let i=0;i<n.length;i++){const s=cS(n[i],t);if(r.push(s),s.type==="error")break}return r};function DU(){return new TransformStream({transform(e,t){TU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let qy;function Pp(e){return e.reduce((t,n)=>t+n.length,0)}function Op(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function PU(e,t){qy||(qy=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(a,o){for(n.push(a);;){if(r===0){if(Pp(n)<1)break;const l=Op(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Pp(n)<2)break;const l=Op(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Pp(n)<8)break;const l=Op(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){o.enqueue(nx);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Pp(n)<i)break;const l=Op(n,i);o.enqueue(cS(s?l:qy.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(nx);break}}}})}const OR=4;function cn(e){if(e)return OU(e)}function OU(e){for(var t in cn.prototype)e[t]=cn.prototype[t];return e}cn.prototype.on=cn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};cn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};cn.prototype.off=cn.prototype.removeListener=cn.prototype.removeAllListeners=cn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};cn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};cn.prototype.emitReserved=cn.prototype.emit;cn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};cn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const zr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function NR(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NU=zr.setTimeout,IU=zr.clearTimeout;function rv(e,t){t.useNativeTimers?(e.setTimeoutFn=NU.bind(zr),e.clearTimeoutFn=IU.bind(zr)):(e.setTimeoutFn=zr.setTimeout.bind(zr),e.clearTimeoutFn=zr.clearTimeout.bind(zr))}const jU=1.33;function BU(e){return typeof e=="string"?FU(e):Math.ceil((e.byteLength||e.size)*jU)}function FU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function zU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function HU(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class WU extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class uS extends cn{constructor(t){super(),this.writable=!1,rv(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new WU(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=cS(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=zU(t);return n.length?"?"+n:""}}const IR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),rx=64,UU={};let fE=0,Np=0,pE;function mE(e){let t="";do t=IR[e%rx]+t,e=Math.floor(e/rx);while(e>0);return t}function jR(){const e=mE(+new Date);return e!==pE?(fE=0,pE=e):e+"."+mE(fE++)}for(;Np<rx;Np++)UU[IR[Np]]=Np;let BR=!1;try{BR=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const VU=BR;function FR(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||VU))return new XMLHttpRequest}catch{}if(!t)try{return new zr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function qU(){}const KU=function(){return new FR({xdomain:!1}).responseType!=null}();class GU extends uS{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=KU&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};LU(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,AU(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=jR()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Gi(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Gi extends cn{constructor(t,n){super(),rv(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=NR(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new FR(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Gi.requestsCount++,Gi.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=qU,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Gi.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Gi.requestsCount=0;Gi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",gE);else if(typeof addEventListener=="function"){const e="onpagehide"in zr?"pagehide":"unload";addEventListener(e,gE,!1)}}function gE(){for(let e in Gi.requests)Gi.requests.hasOwnProperty(e)&&Gi.requests[e].abort()}const dS=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ip=zr.WebSocket||zr.MozWebSocket,vE=!0,YU="arraybuffer",yE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class XU extends uS{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=yE?{}:NR(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=vE&&!yE?n?new Ip(t,n):new Ip(t):new Ip(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;lS(r,this.supportsBinary,s=>{const a={};try{vE&&this.ws.send(s)}catch{}i&&dS(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=jR()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Ip}}class QU extends uS{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=PU(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=DU();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const s=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),s())}).catch(o=>{})};s();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&dS(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const JU={websocket:XU,webtransport:QU,polling:GU},ZU=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,eV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ix(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=ZU.exec(e||""),s={},a=14;for(;a--;)s[eV[a]]=i[a]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=tV(s,s.path),s.queryKey=nV(s,s.query),s}function tV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function nV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}let zR=class Vl extends cn{constructor(t,n={}){super(),this.binaryType=YU,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=ix(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=ix(n.host).host),rv(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=HU(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=OR,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new JU[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Vl.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Vl.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Vl.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const a=u=>{const h=new Error("probe error: "+u);h.transport=n.name,s(),this.emitReserved("upgradeError",h)};function o(){a("transport closed")}function l(){a("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",o),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",a),n.once("close",o),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Vl.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=BU(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Vl.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};zR.protocol=OR;function rV(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ix(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const iV=typeof ArrayBuffer=="function",sV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,HR=Object.prototype.toString,oV=typeof Blob=="function"||typeof Blob<"u"&&HR.call(Blob)==="[object BlobConstructor]",aV=typeof File=="function"||typeof File<"u"&&HR.call(File)==="[object FileConstructor]";function hS(e){return iV&&(e instanceof ArrayBuffer||sV(e))||oV&&e instanceof Blob||aV&&e instanceof File}function Nm(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Nm(e[n]))return!0;return!1}if(hS(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Nm(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Nm(e[n]))return!0;return!1}function lV(e){const t=[],n=e.data,r=e;return r.data=sx(n,t),r.attachments=t.length,{packet:r,buffers:t}}function sx(e,t){if(!e)return e;if(hS(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=sx(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=sx(e[r],t));return n}return e}function cV(e,t){return e.data=ox(e.data,t),delete e.attachments,e}function ox(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ox(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ox(e[n],t));return e}const uV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],dV=5;var it;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(it||(it={}));class hV{constructor(t){this.replacer=t}encode(t){return(t.type===it.EVENT||t.type===it.ACK)&&Nm(t)?this.encodeAsBinary({type:t.type===it.EVENT?it.BINARY_EVENT:it.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===it.BINARY_EVENT||t.type===it.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=lV(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function _E(e){return Object.prototype.toString.call(e)==="[object Object]"}class fS extends cn{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===it.BINARY_EVENT;r||n.type===it.BINARY_ACK?(n.type=r?it.EVENT:it.ACK,this.reconstructor=new fV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(hS(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(it[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===it.BINARY_EVENT||r.type===it.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(s,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(fS.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case it.CONNECT:return _E(n);case it.DISCONNECT:return n===void 0;case it.CONNECT_ERROR:return typeof n=="string"||_E(n);case it.EVENT:case it.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&uV.indexOf(n[0])===-1);case it.ACK:case it.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class fV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=cV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const pV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:fS,Encoder:hV,get PacketType(){return it},protocol:dV},Symbol.toStringTag,{value:"Module"}));function ui(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const mV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class WR extends cn{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ui(t,"open",this.onopen.bind(this)),ui(t,"packet",this.onpacket.bind(this)),ui(t,"error",this.onerror.bind(this)),ui(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(mV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:it.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,o=n.pop();this._registerAckCallback(a,o),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i),a=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,o)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(a,o)=>a?i(a):r(o);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:it.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case it.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case it.EVENT:case it.BINARY_EVENT:this.onevent(t);break;case it.ACK:case it.BINARY_ACK:this.onack(t);break;case it.DISCONNECT:this.ondisconnect();break;case it.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:it.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:it.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function wu(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}wu.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};wu.prototype.reset=function(){this.attempts=0};wu.prototype.setMin=function(e){this.ms=e};wu.prototype.setMax=function(e){this.max=e};wu.prototype.setJitter=function(e){this.jitter=e};class ax extends cn{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,rv(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new wu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||pV;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new zR(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ui(n,"open",function(){r.onopen(),t&&t()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},a=ui(n,"error",s);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ui(t,"ping",this.onping.bind(this)),ui(t,"data",this.ondata.bind(this)),ui(t,"error",this.onerror.bind(this)),ui(t,"close",this.onclose.bind(this)),ui(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){dS(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new WR(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fd={};function oh(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=rV(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=fd[i]&&s in fd[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return o?l=new ax(r,t):(fd[i]||(fd[i]=new ax(r,t)),l=fd[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(oh,{Manager:ax,Socket:WR,io:oh,connect:oh});const gV=new Date().getFullYear();function ee(...e){return SU(VW(e))}function vV(e){if(typeof e!="string"||!e)return!1;const t=new URL(e,window.location.href);return e.startsWith("/")&&!e.startsWith("//")&&t.hostname===window.location.hostname}const yV=e=>{const t=/^[ \t]*(?=\S)/gm,n=e.substring(e.indexOf(`
`)).match(t);if(!n)return e;const r=n.reduce((s,a)=>Math.min(s,a.length),1/0),i=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(i,"")},Ag=nv.humanizer({round:!0}),UR=nv.humanizer({round:!0,spacer:"",language:"shortEn"}),VR=(e,t="2-digit",n="2-digit",r)=>e.toLocaleTimeString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{hour:t,minute:n,second:r}),pS=(e,t="long")=>e.toLocaleDateString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{dateStyle:t}),_V=(e,t="long")=>pS(new Date(e*1e3),t),bV=(e,t="long",n="medium")=>e.toLocaleString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{dateStyle:t,timeStyle:n}),ic=(e,t="long",n="medium")=>bV(new Date(e*1e3),t,n),qR=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},bE=(e,t=0)=>e.toLocaleString((window==null?void 0:window.nuiSystemLanguages)??navigator.language??"en",{maximumFractionDigits:t}),lx=e=>{const t=new Date(e*1e3),n=t.getFullYear()!==gV;return t.toLocaleString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},mS=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?oh({...t,path:"/socket.io"}):oh("monitor",{...t,path:"/WebPipe/socket.io"})},sl=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},Oh=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),sl(r))},Lg=e=>{if(e==="permanent")return"permanent";if(typeof e=="string")return e;const t=e.value===1?e.unit.slice(0,-1):e.unit;return`${e.value} ${t}`},xV=e=>{if(typeof e=="string")return e==="permanent"?"PERM":e;let t;return e.unit==="hours"?t="h":e.unit==="days"?t="d":e.unit==="weeks"?t="w":e.unit==="months"?t="mo":t=e.unit,`${e.value}${t}`},gS=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ee("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));gS.displayName="Card";const iv=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ee("flex flex-col space-y-1.5 p-6",e),...t}));iv.displayName="CardHeader";const vS=x.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:ee("text-2xl font-semibold leading-none tracking-tight",e),...t}));vS.displayName="CardTitle";const KR=x.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));KR.displayName="CardDescription";const Of=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ee("p-6 pt-0",e),...t}));Of.displayName="CardContent";const Su=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ee("flex items-center p-6 pt-0",e),...t}));Su.displayName="CardFooter";var GR={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xE=Ye.createContext&&Ye.createContext(GR),wV=["attr","size","title"];function SV(e,t){if(e==null)return{};var n=CV(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CV(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Dg(){return Dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dg.apply(this,arguments)}function wE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wE(Object(n),!0).forEach(function(r){kV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kV(e,t,n){return t=EV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=TV(e,"string");return typeof t=="symbol"?t:String(t)}function TV(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YR(e){return e&&e.map((t,n)=>Ye.createElement(t.tag,Pg({key:n},t.attr),YR(t.child)))}function XR(e){return t=>Ye.createElement($V,Dg({attr:Pg({},e.attr)},t),YR(e.child))}function $V(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=SV(e,wV),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),Ye.createElement("svg",Dg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Pg(Pg({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&Ye.createElement("title",null,s),e.children)};return xE!==void 0?Ye.createElement(xE.Consumer,null,n=>t(n)):t(GR)}function MV(e){return XR({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te.apply(this,arguments)}function RV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Nf(...e){return t=>e.forEach(n=>RV(n,t))}function He(...e){return x.useCallback(Nf(...e),e)}const Io=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),s=i.find(AV);if(s){const a=s.props.children,o=i.map(l=>l===s?x.Children.count(a)>1?x.Children.only(null):x.isValidElement(a)?a.props.children:null:l);return x.createElement(cx,te({},r,{ref:t}),x.isValidElement(a)?x.cloneElement(a,void 0,o):null)}return x.createElement(cx,te({},r,{ref:t}),n)});Io.displayName="Slot";const cx=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...LV(r,n.props),ref:t?Nf(t,n.ref):n.ref}):x.Children.count(n)>1?x.Children.only(null):null});cx.displayName="SlotClone";const yS=({children:e})=>x.createElement(x.Fragment,null,e);function AV(e){return x.isValidElement(e)&&e.type===yS}function LV(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function QR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=QR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function DV(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=QR(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,CE=DV,Jo=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return CE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],u=s==null?void 0:s[c];if(d===null)return null;const h=SE(d)||SE(u);return i[c][h]}),o=n&&Object.entries(n).reduce((c,d)=>{let[u,h]=d;return h===void 0||(c[u]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:h,...f}=d;return Object.entries(f).every(b=>{let[y,m]=b;return Array.isArray(m)?m.includes({...s,...o}[y]):{...s,...o}[y]===m})?[...c,u,h]:c},[]);return CE(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},If=Jo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/75",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/75",warning:"bg-warning text-warning-foreground hover:bg-warning/75",success:"bg-success text-success-foreground hover:bg-success/75",info:"bg-info text-info-foreground hover:bg-info/75",outline:"border border-foreground hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/75",ghost:"hover:bg-primary hover:text-primary-foreground",link:"text-accent underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",inline:"h-5 px-1.5 rounded-sm text-xs tracking-wider",xs:"h-7 rounded-sm px-2 text-sm",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ve=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?Io:"button";return v.jsx(a,{className:ee(If({variant:t,size:n,className:e})),ref:s,...i})});Ve.displayName="Button";const PV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$e=PV.reduce((e,t)=>{const n=x.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?Io:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(o,te({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Og(e,t){e&&Yn.flushSync(()=>e.dispatchEvent(t))}const un=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{};function OV(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const yn=e=>{const{present:t,children:n}=e,r=NV(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=He(r.ref,i.ref);return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};yn.displayName="Presence";function NV(e){const[t,n]=x.useState(),r=x.useRef({}),i=x.useRef(e),s=x.useRef("none"),a=e?"mounted":"unmounted",[o,l]=OV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=jp(r.current);s.current=o==="mounted"?c:"none"},[o]),un(()=>{const c=r.current,d=i.current;if(d!==e){const h=s.current,f=jp(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),un(()=>{if(t){const c=u=>{const f=jp(r.current).includes(u.animationName);u.target===t&&f&&Yn.flushSync(()=>l("ANIMATION_END"))},d=u=>{u.target===t&&(s.current=jp(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:x.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function jp(e){return(e==null?void 0:e.animationName)||"none"}function IV(e,t){const n=x.createContext(t);function r(s){const{children:a,...o}=s,l=x.useMemo(()=>o,Object.values(o));return x.createElement(n.Provider,{value:l},a)}function i(s){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,i]}function gr(e,t=[]){let n=[];function r(s,a){const o=x.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:h,children:f,...b}=u,y=(h==null?void 0:h[e][l])||o,m=x.useMemo(()=>b,Object.values(b));return x.createElement(y.Provider,{value:m},f)}function d(u,h){const f=(h==null?void 0:h[e][l])||o,b=x.useContext(f);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}const i=()=>{const s=n.map(a=>x.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return x.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,jV(i,...t)]}function jV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...o,...u}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ct(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const BV=x.createContext(void 0);function Cu(e){const t=x.useContext(BV);return e||t||"ltr"}function ux(e,[t,n]){return Math.min(n,Math.max(t,e))}function pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function FV(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const JR="ScrollArea",[ZR,mPe]=gr(JR),[zV,ni]=ZR(JR),HV=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=x.useState(null),[c,d]=x.useState(null),[u,h]=x.useState(null),[f,b]=x.useState(null),[y,m]=x.useState(null),[p,g]=x.useState(0),[_,S]=x.useState(0),[k,C]=x.useState(!1),[T,w]=x.useState(!1),E=He(t,M=>l(M)),$=Cu(i);return x.createElement(zV,{scope:n,type:r,dir:$,scrollHideDelay:s,scrollArea:o,viewport:c,onViewportChange:d,content:u,onContentChange:h,scrollbarX:f,onScrollbarXChange:b,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:m,scrollbarYEnabled:T,onScrollbarYEnabledChange:w,onCornerWidthChange:g,onCornerHeightChange:S},x.createElement($e.div,te({dir:$},a,{ref:E,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),WV="ScrollAreaViewport",UV=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,s=ni(WV,n),a=x.useRef(null),o=He(t,a,s.onViewportChange);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement($e.div,te({"data-radix-scroll-area-viewport":""},i,{ref:o,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),x.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Hs="ScrollAreaScrollbar",eA=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Hs,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return x.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?x.createElement(VV,te({},r,{ref:t,forceMount:n})):i.type==="scroll"?x.createElement(qV,te({},r,{ref:t,forceMount:n})):i.type==="auto"?x.createElement(tA,te({},r,{ref:t,forceMount:n})):i.type==="always"?x.createElement(_S,te({},r,{ref:t})):null}),VV=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Hs,e.__scopeScrollArea),[s,a]=x.useState(!1);return x.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const c=()=>{window.clearTimeout(l),a(!0)},d=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),x.createElement(yn,{present:n||s},x.createElement(tA,te({"data-state":s?"visible":"hidden"},r,{ref:t})))}),qV=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Hs,e.__scopeScrollArea),s=e.orientation==="horizontal",a=ov(()=>l("SCROLL_END"),100),[o,l]=FV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(o==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[o,i.scrollHideDelay,l]),x.useEffect(()=>{const c=i.viewport,d=s?"scrollLeft":"scrollTop";if(c){let u=c[d];const h=()=>{const f=c[d];u!==f&&(l("SCROLL"),a()),u=f};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[i.viewport,s,l,a]),x.createElement(yn,{present:n||o!=="hidden"},x.createElement(_S,te({"data-state":o==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:pe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:pe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),tA=x.forwardRef((e,t)=>{const n=ni(Hs,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=x.useState(!1),o=e.orientation==="horizontal",l=ov(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?c:d)}},10);return Xc(n.viewport,l),Xc(n.content,l),x.createElement(yn,{present:r||s},x.createElement(_S,te({"data-state":s?"visible":"hidden"},i,{ref:t})))}),_S=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ni(Hs,e.__scopeScrollArea),s=x.useRef(null),a=x.useRef(0),[o,l]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=sA(o.viewport,o.content),d={...r,sizes:o,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>s.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function u(h,f){return eq(h,a.current,o,f)}return n==="horizontal"?x.createElement(KV,te({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollLeft,f=kE(h,o,i.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=u(h,i.dir))}})):n==="vertical"?x.createElement(GV,te({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const h=i.viewport.scrollTop,f=kE(h,o);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=u(h))}})):null}),KV=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=ni(Hs,e.__scopeScrollArea),[a,o]=x.useState(),l=x.useRef(null),c=He(t,l,s.onScrollbarXChange);return x.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),x.createElement(rA,te({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sv(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,u)=>{if(s.viewport){const h=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),aA(h,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ng(a.paddingLeft),paddingEnd:Ng(a.paddingRight)}})}}))}),GV=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=ni(Hs,e.__scopeScrollArea),[a,o]=x.useState(),l=x.useRef(null),c=He(t,l,s.onScrollbarYChange);return x.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),x.createElement(rA,te({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sv(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,u)=>{if(s.viewport){const h=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),aA(h,u)&&d.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ng(a.paddingTop),paddingEnd:Ng(a.paddingBottom)}})}}))}),[YV,nA]=ZR(Hs),rA=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:u,...h}=e,f=ni(Hs,n),[b,y]=x.useState(null),m=He(t,E=>y(E)),p=x.useRef(null),g=x.useRef(""),_=f.viewport,S=r.content-r.viewport,k=Ct(d),C=Ct(l),T=ov(u,10);function w(E){if(p.current){const $=E.clientX-p.current.left,M=E.clientY-p.current.top;c({x:$,y:M})}}return x.useEffect(()=>{const E=$=>{const M=$.target;(b==null?void 0:b.contains(M))&&k($,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[_,b,S,k]),x.useEffect(C,[r,C]),Xc(b,T),Xc(f.content,T),x.createElement(YV,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:Ct(s),onThumbPointerUp:Ct(a),onThumbPositionChange:C,onThumbPointerDown:Ct(o)},x.createElement($e.div,te({},h,{ref:m,style:{position:"absolute",...h.style},onPointerDown:pe(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),p.current=b.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),w(E))}),onPointerMove:pe(e.onPointerMove,w),onPointerUp:pe(e.onPointerUp,E=>{const $=E.target;$.hasPointerCapture(E.pointerId)&&$.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=g.current,f.viewport&&(f.viewport.style.scrollBehavior=""),p.current=null})})))}),dx="ScrollAreaThumb",XV=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=nA(dx,e.__scopeScrollArea);return x.createElement(yn,{present:n||i.hasThumb},x.createElement(QV,te({ref:t},r)))}),QV=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=ni(dx,n),a=nA(dx,n),{onThumbPositionChange:o}=a,l=He(t,u=>a.onThumbChange(u)),c=x.useRef(),d=ov(()=>{c.current&&(c.current(),c.current=void 0)},100);return x.useEffect(()=>{const u=s.viewport;if(u){const h=()=>{if(d(),!c.current){const f=tq(u,o);c.current=f,o()}};return o(),u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[s.viewport,d,o]),x.createElement($e.div,te({"data-state":a.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:pe(e.onPointerDownCapture,u=>{const f=u.target.getBoundingClientRect(),b=u.clientX-f.left,y=u.clientY-f.top;a.onThumbPointerDown({x:b,y})}),onPointerUp:pe(e.onPointerUp,a.onThumbPointerUp)}))}),iA="ScrollAreaCorner",JV=x.forwardRef((e,t)=>{const n=ni(iA,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?x.createElement(ZV,te({},e,{ref:t})):null}),ZV=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ni(iA,n),[s,a]=x.useState(0),[o,l]=x.useState(0),c=!!(s&&o);return Xc(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),Xc(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),a(u)}),c?x.createElement($e.div,te({},r,{ref:t,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Ng(e){return e?parseInt(e,10):0}function sA(e,t){const n=e/t;return isNaN(n)?0:n}function sv(e){const t=sA(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function eq(e,t,n,r="ltr"){const i=sv(n),s=i/2,a=t||s,o=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,d=n.content-n.viewport,u=r==="ltr"?[0,d]:[d*-1,0];return oA([l,c],u)(e)}function kE(e,t,n="ltr"){const r=sv(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,l=n==="ltr"?[0,a]:[a*-1,0],c=ux(e,l);return oA([0,a],[0,o])(c)}function oA(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function aA(e,t){return e>0&&e<t}const tq=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,o=n.top!==s.top;(a||o)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function ov(e,t){const n=Ct(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Xc(e,t){const n=Ct(t);un(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const lA=HV,nq=UV,rq=JV,Si=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(lA,{ref:r,className:ee("relative overflow-hidden",e),...n,children:[v.jsx(nq,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(cA,{}),v.jsx(rq,{})]}));Si.displayName=lA.displayName;const cA=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(eA,{ref:r,orientation:t,className:ee("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(XV,{className:"relative flex-1 rounded-full bg-border"})}));cA.displayName=eA.displayName;function iq({error:e}){const t=()=>{window.location.reload()};return v.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:v.jsx(uA,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:v.jsx(Ve,{variant:"outline",onClick:t,children:"Refresh"})})})}function sq({error:e,resetErrorBoundary:t}){return v.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:v.jsx(uA,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:v.jsx(Ve,{variant:"outline",onClick:t,children:"Go Back"})})})}function uA(e){return v.jsxs(gS,{className:"max-w-xl",children:[v.jsxs(iv,{children:[v.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[v.jsx(MV,{className:"inline-block mr-2"}),e.title]}),v.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),v.jsxs(Of,{children:[v.jsxs("p",{className:"truncate",children:["Page: ",v.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),v.jsxs("p",{children:["Versions: ",v.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),v.jsxs("p",{children:["Message: ",v.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),v.jsx("p",{children:"Stack:"}),v.jsx("pre",{className:"mt-1",children:v.jsx(Si,{className:`p-2 border border-red-800 rounded-sm 
                                font-mono text-muted-foreground text-xs text-red-800
                                h-32 w-full`,children:e.error.stack})})]}),v.jsxs(Su,{className:"flex flex-row justify-between",children:[e.resetButton,v.jsx(Ve,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:v.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}var wn={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let oq=0;function Ge(e,t){const n=`atom${++oq}`,r={toString:()=>n};return typeof e=="function"?r.read=e:(r.init=e,r.read=aq,r.write=lq),t&&(r.write=t),r}function aq(e){return e(this)}function lq(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Ky=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Gy=e=>"init"in e,Yy=e=>!!e.write,Ig=new WeakMap,cq=(e,t)=>{Ig.set(e,t),e.catch(()=>{}).finally(()=>Ig.delete(e))},EE=(e,t)=>{const n=Ig.get(e);n&&(Ig.delete(e),n(t))},TE=(e,t)=>{e.status="fulfilled",e.value=t},$E=(e,t)=>{e.status="rejected",e.reason=t},uq=e=>typeof(e==null?void 0:e.then)=="function",pd=(e,t)=>!!e&&"v"in e&&"v"in t&&Object.is(e.v,t.v),ME=(e,t)=>!!e&&"e"in e&&"e"in t&&Object.is(e.e,t.e),Rl=e=>!!e&&"v"in e&&e.v instanceof Promise,dq=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,Bp=e=>{if("e"in e)throw e.e;return e.v},hq=()=>{const e=new WeakMap,t=new WeakMap,n=[],r=new WeakMap;let i,s;(wn?"production":void 0)!=="production"&&(i=new Set,s=new Set);const a=w=>e.get(w),o=(w,E)=>{E.d.forEach(($,M)=>{var P;if(!r.has(M)){const D=a(M);(P=n[n.length-1])==null||P.add(M),r.set(M,[D,new Set]),D&&o(M,D)}r.get(M)[1].add(w)})},l=(w,E)=>{var $;(wn?"production":void 0)!=="production"&&Object.freeze(E);const M=a(w);if(e.set(w,E),r.has(w)||(($=n[n.length-1])==null||$.add(w),r.set(w,[M,new Set]),o(w,E)),Rl(M)){const P="v"in E?E.v instanceof Promise?E.v:Promise.resolve(E.v):Promise.reject(E.e);M.v!==P&&EE(M.v,P)}},c=(w,E,$,M)=>{const P=new Map(M?E.d:null);let D=!1;$.forEach((R,O)=>{!R&&Ky(w,O)&&(R=E),R?(P.set(O,R),E.d.get(O)!==R&&(D=!0)):(wn?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(D||E.d.size!==P.size)&&(E.d=P)},d=(w,E,$,M)=>{const P=a(w),D={d:(P==null?void 0:P.d)||new Map,v:E};if($&&c(w,D,$,M),pd(P,D)&&P.d===D.d)return P;if(Rl(P)&&Rl(D)&&dq(P,D)){if(P.d===D.d)return P;D.v=P.v}return l(w,D),D},u=(w,E,$,M)=>{if(uq(E)){let P;const D=()=>{const O=a(w);if(!Rl(O)||O.v!==R)return;const N=d(w,R,$);t.has(w)&&O.d!==N.d&&k(w,N,O.d)},R=new Promise((O,N)=>{let I=!1;E.then(j=>{I||(I=!0,TE(R,j),O(j),D())},j=>{I||(I=!0,$E(R,j),N(j),D())}),P=j=>{I||(I=!0,j.then(L=>TE(R,L),L=>$E(R,L)),O(j))}});return R.orig=E,R.status="pending",cq(R,O=>{O&&P(O),M==null||M()}),d(w,R,$,!0)}return d(w,E,$)},h=(w,E,$)=>{const M=a(w),P={d:(M==null?void 0:M.d)||new Map,e:E};return $&&c(w,P,$),ME(M,P)&&M.d===P.d?M:(l(w,P),P)},f=(w,E)=>{const $=a(w);if(!E&&$&&(t.has(w)||Array.from($.d).every(([I,j])=>{if(I===w)return!0;const L=f(I);return L===j||pd(L,j)})))return $;const M=new Map;let P=!0;const D=I=>{if(Ky(w,I)){const L=a(I);if(L)return M.set(I,L),Bp(L);if(Gy(I))return M.set(I,void 0),I.init;throw new Error("no atom init")}const j=f(I);return M.set(I,j),Bp(j)};let R,O;const N={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return(wn?"production":void 0)!=="production"&&!Yy(w)&&console.warn("setSelf function cannot be used with read-only atom"),!O&&Yy(w)&&(O=(...I)=>{if((wn?"production":void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)return p(w,...I)}),O}};try{const I=w.read(D,N);return u(w,I,M,()=>R==null?void 0:R.abort())}catch(I){return h(w,I,M)}finally{P=!1}},b=w=>Bp(f(w)),y=w=>{const E=R=>{var O,N;const I=new Set((O=t.get(R))==null?void 0:O.t);return(N=r.get(R))==null||N[1].forEach(j=>{I.add(j)}),I},$=new Array,M=new Set,P=R=>{if(!M.has(R)){M.add(R);for(const O of E(R))R!==O&&P(O);$.push(R)}};P(w);const D=new Set([w]);for(let R=$.length-1;R>=0;--R){const O=$[R],N=a(O);if(!N)continue;let I=!1;for(const j of N.d.keys())if(j!==O&&D.has(j)){I=!0;break}if(I){const j=f(O,!0);pd(N,j)||D.add(O)}}},m=(w,...E)=>{const $=D=>Bp(f(D)),M=(D,...R)=>{const O=n.length>0;O||n.push(new Set([D]));let N;if(Ky(w,D)){if(!Gy(D))throw new Error("atom not writable");const I=a(D),j=u(D,R[0]);pd(I,j)||y(D)}else N=m(D,...R);if(!O){const I=C(n.pop());(wn?"production":void 0)!=="production"&&i.forEach(j=>j({type:"async-write",flushed:I}))}return N};return w.write($,M,...E)},p=(w,...E)=>{n.push(new Set([w]));const $=m(w,...E),M=C(n.pop());return(wn?"production":void 0)!=="production"&&i.forEach(P=>P({type:"write",flushed:M})),$},g=(w,E,$)=>{var M;const P=t.get(w);if(P)return E&&P.t.add(E),P;const D=$||[];(M=a(w))==null||M.d.forEach((O,N)=>{N!==w&&g(N,w,D)}),f(w);const R={t:new Set(E&&[E]),l:new Set};if(t.set(w,R),(wn?"production":void 0)!=="production"&&s.add(w),Yy(w)&&w.onMount){const{onMount:O}=w;D.push(()=>{const N=O((...I)=>p(w,...I));N&&(R.u=N)})}return $||D.forEach(O=>O()),R},_=(w,E)=>!E.l.size&&(!E.t.size||E.t.size===1&&E.t.has(w)),S=(w,E)=>{if(!_(w,E))return;const $=E.u;$&&$(),t.delete(w),(wn?"production":void 0)!=="production"&&s.delete(w);const M=a(w);M?(Rl(M)&&EE(M.v),M.d.forEach((P,D)=>{if(D!==w){const R=t.get(D);R&&(R.t.delete(w),S(D,R))}})):(wn?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",w)},k=(w,E,$)=>{const M=new Set(E.d.keys()),P=new Set;$==null||$.forEach((D,R)=>{if(M.has(R)){M.delete(R);return}P.add(R);const O=t.get(R);O&&O.t.delete(w)}),M.forEach(D=>{g(D,w)}),P.forEach(D=>{const R=t.get(D);R&&S(D,R)})},C=w=>{let E;(wn?"production":void 0)!=="production"&&(E=new Set);const $=[],M=P=>{var D;if(!r.has(P))return;const[R,O]=r.get(P);r.delete(P),$.push([P,R]),O.forEach(M),(D=a(P))==null||D.d.forEach((N,I)=>M(I))};if(w.forEach(M),$.forEach(([P,D])=>{const R=a(P);if(!R){(wn?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush");return}if(R!==D){const O=t.get(P);O&&R.d!==(D==null?void 0:D.d)&&k(P,R,D==null?void 0:D.d),O&&!(!Rl(D)&&(pd(D,R)||ME(D,R)))&&(O.l.forEach(N=>N()),(wn?"production":void 0)!=="production"&&E.add(P))}}),(wn?"production":void 0)!=="production")return E},T=(w,E)=>{const $=g(w),M=C([w]),P=$.l;return P.add(E),(wn?"production":void 0)!=="production"&&i.forEach(D=>D({type:"sub",flushed:M})),()=>{P.delete(E),S(w,$),(wn?"production":void 0)!=="production"&&i.forEach(D=>D({type:"unsub"}))}};return(wn?"production":void 0)!=="production"?{get:b,set:p,sub:T,dev_subscribe_store:w=>(i.add(w),()=>{i.delete(w)}),dev_get_mounted_atoms:()=>s.values(),dev_get_atom_state:w=>e.get(w),dev_get_mounted:w=>t.get(w),dev_restore_atoms:w=>{n.push(new Set);for(const[$,M]of w)Gy($)&&(u($,M),y($));const E=C(n.pop());i.forEach($=>$({type:"restore",flushed:E}))}}:{get:b,set:p,sub:T}};let md;const fq=()=>(md||(md=hq(),(wn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=md),globalThis.__JOTAI_DEFAULT_STORE__!==md&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),md),pq=fq;var mq={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const gq=x.createContext(void 0),dA=e=>{const t=x.useContext(gq);return(e==null?void 0:e.store)||t||pq()},vq=e=>typeof(e==null?void 0:e.then)=="function",yq=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function lt(e,t){const n=dA(t),[[r,i,s],a]=x.useReducer(c=>{const d=n.get(e);return Object.is(c[0],d)&&c[1]===n&&c[2]===e?c:[d,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;(i!==n||s!==e)&&(a(),o=n.get(e));const l=t==null?void 0:t.delay;return x.useEffect(()=>{const c=n.sub(e,()=>{if(typeof l=="number"){setTimeout(a,l);return}a()});return a(),c},[n,e,l]),x.useDebugValue(o),vq(o)?yq(o):o}function et(e,t){const n=dA(t);return x.useCallback((...i)=>{if((mq?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function fr(e,t){return[lt(e,t),et(e,t)]}function hA(e){const t=Ge(()=>({mounted:!1,inProgress:0,promise:void 0,cleanup:void 0,fromCleanup:!1,recursing:!1,refresh:()=>{},refreshing:!1,get:()=>{},set:()=>{},pendingError:null})),n=Ge(0),r=Ge(null,(s,a)=>{const o=s(t);return o.mounted=!0,o.get=s,o.set=a,o.refresh=()=>{try{o.refreshing=!0,a(n,l=>l+1)}finally{o.refreshing=!1}},a(n,l=>l+1),()=>{o.mounted=!1,RE(o),o.cleanup==null||o.cleanup(),o.cleanup=void 0}});r.onMount=s=>s();const i=Ge(s=>{s(n);const a=s(t);if(!a.mounted||a.recursing||a.inProgress&&!a.refreshing)return a.promise;RE(a);const o=new Map,l=u=>{const h=s(u);return o.set(u,h),h};l.peek=u=>a.get(u);const c=(...u)=>{try{return++a.inProgress,a.set(...u)}finally{--a.inProgress}};c.recurse=(u,...h)=>{if(!a.fromCleanup)try{return a.recursing=!0,a.set(u,...h)}finally{a.recursing=!1,Array.from(o).some(([f,b])=>s(f)!==b)&&a.refresh()}},++a.inProgress;const d=()=>{try{if(a.refreshing=!1,!a.mounted)return;try{a.fromCleanup=!0,a.cleanup==null||a.cleanup()}finally{a.fromCleanup=!1}a.cleanup=e(l,c)}catch(u){a.pendingError=u,a.refresh()}finally{a.promise=void 0,--a.inProgress}};return a.refreshing?d():a.promise=Promise.resolve().then(d)});return Ge(s=>{s(r),s(i)})}function RE(e){if(e.pendingError!==null){const t=e.pendingError;throw e.pendingError=null,t}}const fA=""+new URL("favicon_default.svg",import.meta.url).href,_q=""+new URL("favicon_online.svg",import.meta.url).href,bq=""+new URL("favicon_partial.svg",import.meta.url).href,xq=""+new URL("favicon_offline.svg",import.meta.url).href,ol=Ge(null),pA=Ge(e=>{var t;return((t=e(ol))==null?void 0:t.server.name)??"unconfigured"}),mA=Ge(e=>{var t;return(t=e(ol))==null?void 0:t.server.configPendingStep}),wq=Ge(e=>{var t;return((t=e(ol))==null?void 0:t.server.instantiated)??!1}),Sq=()=>et(ol),gA=()=>lt(ol);function Fn(e,t,n){var r=n||{},i=r.noTrailing,s=i===void 0?!1:i,a=r.noLeading,o=a===void 0?!1:a,l=r.debounceMode,c=l===void 0?void 0:l,d,u=!1,h=0;function f(){d&&clearTimeout(d)}function b(m){var p=m||{},g=p.upcomingOnly,_=g===void 0?!1:g;f(),u=!_}function y(){for(var m=arguments.length,p=new Array(m),g=0;g<m;g++)p[g]=arguments[g];var _=this,S=Date.now()-h;if(u)return;function k(){h=Date.now(),t.apply(_,p)}function C(){d=void 0}!o&&c&&!d&&k(),f(),c===void 0&&S>e?o?(h=Date.now(),s||(d=setTimeout(c?C:k,e))):k():s!==!0&&(d=setTimeout(c?C:k,c===void 0?e-S:e))}return y.cancel=b,y}function bS(e,t,n){var r=n||{},i=r.atBegin,s=i===void 0?!1:i;return Fn(e,t,{debounceMode:s!==!1})}const av=Ge(void 0),xS=Ge(void 0),lv=Ge(void 0),cv=Ge(void 0),wS=Ge(0),Cq=2.5*60*1e3,kq=()=>{const e=et(av),t=et(lv),n=et(wS);return r=>{e(r.playerDrop),t(r.svRuntime),n(Date.now())}},Eq=()=>{const e=et(cv);return x.useCallback(Fn(150,e,{noLeading:!1,noTrailing:!1}),[e])},Tq=()=>{const e=et(av);return t=>{e(n=>{if(!n)return n;const r=n.summaryLast6h.slice(),i=r.findIndex(([s])=>s===t);return i===-1?r.push([t,1]):r[i][1]++,{...n,summaryLast6h:r}})}},SS=()=>{const e=lt(wS);return()=>{const t=Date.now();return{isExpired:t-e>Cq,isStale:t-e>60*1e3,age:t-e}}},CS=Ge([]),uv=Ge(e=>e(CS).length),vA=Ge(null),$q=()=>{const e=Tq(),t=et(CS),n=et(vA);return r=>{const i=r.findIndex(s=>s.type==="fullPlayerlist");i>0&&(r=r.slice(i));for(const s of r)s.type==="fullPlayerlist"?(t(s.playerlist),n(s.mutex)):s.type==="playerJoining"?t(a=>[...a,s]):s.type==="playerDropped"?(t(a=>a.filter(o=>o.netid!==s.netid)),s.reasonCategory&&e(s.reasonCategory)):console.error("Unknown playerlist event type",s)}},yA=Ge(0),dv=()=>{const e=et(yA);return()=>e(Math.random())},_A=Ge(!1),jg="txAdmin",Wd=document.getElementById("favicon"),bA=Ge(jg),xA=()=>{const e=et(bA);return t=>{t?e(t):(e(jg),document.title=jg,Wd.href=fA)}},Mq=hA((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(bA),r=e(ol),i=e(uv);r?(r.server.status==="ONLINE"?Wd.href=_q:r.server.status==="PARTIAL"?Wd.href=bq:Wd.href=xq,document.title=`(${i}) ${r.server.name} · ${n}`):(Wd.href=fA,document.title=jg)}),Rq=150,AE=Fn(Rq,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function kS(e){return e.code==="KeyK"&&e.ctrlKey?(AE("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.ctrlKey&&e.shiftKey&&window.txConsts.showAdvanced?(AE("toggleLightMode"),!0):!1}function wA(e){kS(e)&&e.preventDefault()}function oi({legacyUrl:e}){const t=x.useRef(null),n=location.search??"",r=location.hash??"";return x.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",wA))},[]),v.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function zn({children:e,className:t,...n}){return v.jsx("code",{className:ee("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function Aq({params:e}){return xA()("Not Found"),v.jsx("div",{className:"w-full flex items-center justify-center",children:v.jsxs("div",{className:"text-center",children:[v.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),v.jsxs("p",{className:"mt-2",children:["The page ",v.jsxs(zn,{children:["/",e.fullPath]})," does not seem to be correct."]}),v.jsx(No,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var SA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,o,l){var c=this&&this.__decorate||function(g,_,S,k){var C,T=arguments.length,w=T<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(g,_,S,k);else for(var E=g.length-1;E>=0;E--)(C=g[E])&&(w=(T<3?C(w):T>3?C(_,S,w):C(_,S))||w);return T>3&&w&&Object.defineProperty(_,S,w),w},d=this&&this.__param||function(g,_){return function(S,k){_(S,k,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=l(9042),h=l(9924),f=l(844),b=l(4725),y=l(2585),m=l(3656);let p=o.AccessibilityManager=class extends f.Disposable{constructor(g,_,S,k){super(),this._terminal=g,this._coreBrowserService=S,this._renderService=k,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 C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,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 h.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(C=>this._handleResize(C.rows))),this.register(this._terminal.onRender(C=>this._refreshRows(C.start,C.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(C=>this._handleChar(C))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,m.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,f.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(g){for(let _=0;_<g;_++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,_){this._liveRegionDebouncer.refresh(g,_,this._terminal.rows)}_renderRows(g,_){const S=this._terminal.buffer,k=S.lines.length.toString();for(let C=g;C<=_;C++){const T=S.lines.get(S.ydisp+C),w=[],E=(T==null?void 0:T.translateToString(!0,void 0,void 0,w))||"",$=(S.ydisp+C+1).toString(),M=this._rowElements[C];M&&(E.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=E,this._rowColumns.set(M,w)),M.setAttribute("aria-posinset",$),M.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,_){const S=g.target,k=this._rowElements[_===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==k)return;let C,T;if(_===0?(C=S,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(C=this._rowElements.shift(),T=S,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:g.anchorNode,offset:g.anchorOffset},S={node:g.focusNode,offset:g.focusOffset};if((_.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===S.node&&_.offset>S.offset)&&([_,S]=[S,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const k=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(k)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:k,offset:((E=k.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(S.node))return;const C=({node:$,offset:M})=>{const P=$ instanceof Text?$.parentNode:$;let D=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const R=this._rowColumns.get(P);if(!R)return console.warn("columns is null. Race condition?"),null;let O=M<R.length?R[M]:R.slice(-1)[0]+1;return O>=this._terminal.cols&&(++D,O=0),{row:D,column:O}},T=C(_),w=C(S);if(T&&w){if(T.row>w.row||T.row===w.row&&T.column>=w.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(w.row-T.row)*this._terminal.cols-T.column+w.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_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 g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=p=c([d(1,y.IInstantiationService),d(2,b.ICoreBrowserService),d(3,b.IRenderService)],p)},3614:(a,o)=>{function l(h){return h.replace(/\r?\n/g,"\r")}function c(h,f){return f?"\x1B[200~"+h+"\x1B[201~":h}function d(h,f,b,y){h=c(h=l(h),b.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(h,!0),f.value=""}function u(h,f,b){const y=b.getBoundingClientRect(),m=h.clientX-y.left-10,p=h.clientY-y.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${m}px`,f.style.top=`${p}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=c,o.copyHandler=function(h,f){h.clipboardData&&h.clipboardData.setData("text/plain",f.selectionText),h.preventDefault()},o.handlePasteEvent=function(h,f,b,y){h.stopPropagation(),h.clipboardData&&d(h.clipboardData.getData("text/plain"),f,b,y)},o.paste=d,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(h,f,b,y,m){u(h,f,b),m&&y.rightClickSelect(h),f.value=y.selectionText,f.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const c=l(1505);o.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(d,u,h){this._css.set(d,u,h)}getCss(d,u){return this._css.get(d,u)}setColor(d,u,h){this._color.set(d,u,h)}getColor(d,u){return this._color.get(d,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,c,d,u){l.addEventListener(c,d,u);let h=!1;return{dispose:()=>{h||(h=!0,l.removeEventListener(c,d,u))}}}},6465:function(a,o,l){var c=this&&this.__decorate||function(m,p,g,_){var S,k=arguments.length,C=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,p,g,_);else for(var T=m.length-1;T>=0;T--)(S=m[T])&&(C=(k<3?S(C):k>3?S(p,g,C):S(p,g))||C);return k>3&&C&&Object.defineProperty(p,g,C),C},d=this&&this.__param||function(m,p){return function(g,_){p(g,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier2=void 0;const u=l(3656),h=l(8460),f=l(844),b=l(2585);let y=o.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(m){super(),this._bufferService=m,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new h.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new h.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{var p;this._lastMouseEvent=void 0,this._linkProviders.length=0,(p=this._activeProviderReplies)==null||p.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(m){return this._linkProviders.push(m),{dispose:()=>{const p=this._linkProviders.indexOf(m);p!==-1&&this._linkProviders.splice(p,1)}}}attachToDom(m,p,g){this._element=m,this._mouseService=p,this._renderService=g,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){if(this._lastMouseEvent=m,!this._element||!this._mouseService)return;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const g=m.composedPath();for(let _=0;_<g.length;_++){const S=g[_];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,p){var _,S;this._activeProviderReplies&&p||((_=this._activeProviderReplies)==null||_.forEach(k=>{k==null||k.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=m.y);let g=!1;for(const[k,C]of this._linkProviders.entries())p?(S=this._activeProviderReplies)!=null&&S.get(k)&&(g=this._checkLinkProviderResult(k,m,g)):C.provideLinks(m.y,T=>{var E,$;if(this._isMouseOut)return;const w=T==null?void 0:T.map(M=>({link:M}));(E=this._activeProviderReplies)==null||E.set(k,w),g=this._checkLinkProviderResult(k,m,g),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)})}_removeIntersectingLinks(m,p){const g=new Set;for(let _=0;_<p.size;_++){const S=p.get(_);if(S)for(let k=0;k<S.length;k++){const C=S[k],T=C.link.range.start.y<m?0:C.link.range.start.x,w=C.link.range.end.y>m?this._bufferService.cols:C.link.range.end.x;for(let E=T;E<=w;E++){if(g.has(E)){S.splice(k--,1);break}g.add(E)}}}}_checkLinkProviderResult(m,p,g){var k;if(!this._activeProviderReplies)return g;const _=this._activeProviderReplies.get(m);let S=!1;for(let C=0;C<m;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(S=!0);if(!S&&_){const C=_.find(T=>this._linkAtPosition(T.link,p));C&&(g=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!g)for(let C=0;C<this._activeProviderReplies.size;C++){const T=(k=this._activeProviderReplies.get(C))==null?void 0:k.find(w=>this._linkAtPosition(w.link,p));if(T){g=!0,this._handleNewLink(T);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._element||!this._mouseService||!this._currentLink)return;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,p){this._element&&this._currentLink&&this._lastMouseEvent&&(!m||!p||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(m.link,p)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var g,_;return(_=(g=this._currentLink)==null?void 0:g.state)==null?void 0:_.decorations.pointerCursor},set:g=>{var _,S;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&((S=this._element)==null||S.classList.toggle("xterm-cursor-pointer",g)))}},underline:{get:()=>{var g,_;return(_=(g=this._currentLink)==null?void 0:g.state)==null?void 0:_.decorations.underline},set:g=>{var _,S,k;(_=this._currentLink)!=null&&_.state&&((k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,g))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(g=>{if(!this._currentLink)return;const _=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(_,S),this._lastMouseEvent&&this._element)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(m,p,g){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(g,p.text)}_fireUnderlineEvent(m,p){const g=m.range,_=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-_-1,g.end.x,g.end.y-_-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(m,p,g){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(g,p.text)}_linkAtPosition(m,p){const g=m.range.start.y*this._bufferService.cols+m.range.start.x,_=m.range.end.y*this._bufferService.cols+m.range.end.x,S=p.y*this._bufferService.cols+p.x;return g<=S&&S<=_}_positionFromMouseEvent(m,p,g){const _=g.getCoords(m,p,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,p,g,_,S){return{x1:m,y1:p,x2:g,y2:_,cols:this._bufferService.cols,fg:S}}};o.Linkifier2=y=c([d(0,b.IBufferService)],y)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var c=this&&this.__decorate||function(y,m,p,g){var _,S=arguments.length,k=S<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,m,p,g);else for(var C=y.length-1;C>=0;C--)(_=y[C])&&(k=(S<3?_(k):S>3?_(m,p,k):_(m,p))||k);return S>3&&k&&Object.defineProperty(m,p,k),k},d=this&&this.__param||function(y,m){return function(p,g){m(p,g,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=l(511),h=l(2585);let f=o.OscLinkProvider=class{constructor(y,m,p){this._bufferService=y,this._optionsService=m,this._oscLinkService=p}provideLinks(y,m){var E;const p=this._bufferService.buffer.lines.get(y-1);if(!p)return void m(void 0);const g=[],_=this._optionsService.rawOptions.linkHandler,S=new u.CellData,k=p.getTrimmedLength();let C=-1,T=-1,w=!1;for(let $=0;$<k;$++)if(T!==-1||p.hasContent($)){if(p.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(T===-1){T=$,C=S.extended.urlId;continue}w=S.extended.urlId!==C}else T!==-1&&(w=!0);if(w||T!==-1&&$===k-1){const M=(E=this._oscLinkService.getLinkData(C))==null?void 0:E.uri;if(M){const P={start:{x:T+1,y},end:{x:$+(w||$!==k-1?0:1),y}};let D=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const R=new URL(M);["http:","https:"].includes(R.protocol)||(D=!0)}catch{D=!0}D||g.push({text:M,range:P,activate:(R,O)=>_?_.activate(R,O,P):b(0,O),hover:(R,O)=>{var N;return(N=_==null?void 0:_.hover)==null?void 0:N.call(_,R,O,P)},leave:(R,O)=>{var N;return(N=_==null?void 0:_.leave)==null?void 0:N.call(_,R,O,P)}})}w=!1,S.hasExtendedAttrs()&&S.extended.urlId?(T=$,C=S.extended.urlId):(T=-1,C=-1)}}m(g)}};function b(y,m){if(confirm(`Do you want to navigate to ${m}?

WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=f=c([d(0,h.IBufferService),d(1,h.IOptionsService),d(2,h.IOscLinkService)],f)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(l,c,d){this._rowCount=d,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const c=l(3614),d=l(3656),u=l(6465),h=l(9042),f=l(3730),b=l(1680),y=l(3107),m=l(5744),p=l(2950),g=l(1296),_=l(428),S=l(4269),k=l(5114),C=l(8934),T=l(3230),w=l(9312),E=l(4725),$=l(6731),M=l(8055),P=l(8969),D=l(8460),R=l(844),O=l(6114),N=l(8437),I=l(2584),j=l(7399),L=l(5941),A=l(9074),F=l(2585),H=l(5435),B=l(4567);class G extends P.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(W={}){super(W),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new R.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((U,z)=>this.refresh(U,z))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(U=>this._reportWindowsOptions(U))),this.register(this._inputHandler.onColor(U=>this._handleColorEvent(U))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(U=>this._afterResize(U.cols,U.rows))),this.register((0,R.toDisposable)(()=>{var U,z;this._customKeyEventHandler=void 0,(z=(U=this.element)==null?void 0:U.parentNode)==null||z.removeChild(this.element)}))}_handleColorEvent(W){if(this._themeService)for(const U of W){let z,V="";switch(U.index){case 256:z="foreground",V="10";break;case 257:z="background",V="11";break;case 258:z="cursor",V="12";break;default:z="ansi",V="4;"+U.index}switch(U.type){case 0:const K=M.color.toColorRGB(z==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[z]);this.coreService.triggerDataEvent(`${I.C0.ESC}]${V};${(0,L.toRgbString)(K)}${I.C1_ESCAPED.ST}`);break;case 1:if(z==="ansi")this._themeService.modifyColors(q=>q.ansi[U.index]=M.rgba.toColor(...U.color));else{const q=z;this._themeService.modifyColors(X=>X[q]=M.rgba.toColor(...U.color))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.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 W=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(W);if(!U)return;const z=Math.min(this.buffer.x,this.cols-1),V=this._renderService.dimensions.css.cell.height,K=U.getWidth(z),q=this._renderService.dimensions.css.cell.width*K,X=this.buffer.y*this._renderService.dimensions.css.cell.height,ie=z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ie+"px",this.textarea.style.top=X+"px",this.textarea.style.width=q+"px",this.textarea.style.height=V+"px",this.textarea.style.lineHeight=V+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",U=>{this.hasSelection()&&(0,c.copyHandler)(U,this._selectionService)}));const W=U=>(0,c.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,d.addDisposableDomListener)(this.element,"paste",W)),O.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",U=>{U.button===2&&(0,c.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",U=>{(0,c.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",U=>{U.button===1&&(0,c.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",W=>this._keyUp(W),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",W=>this._keyDown(W),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",W=>this._keyPress(W),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",W=>this._compositionHelper.compositionupdate(W))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,d.addDisposableDomListener)(this.textarea,"input",W=>this._inputEvent(W),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(W){var z;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((z=this.element)==null?void 0:z.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,d.addDisposableDomListener)(this.screenElement,"mousemove",V=>this.updateCursorStyle(V))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",h.promptLabel),O.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(k.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",V=>this._handleTextAreaFocus(V))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(V=>this._onRender.fire(V))),this.onResize(V=>this._renderService.resize(V.cols,V.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(V=>this.scrollLines(V.amount,V.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(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(V=>this.scrollLines(V.amount,V.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(V=>this._renderService.handleSelectionChanged(V.start,V.end,V.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(V=>{this.textarea.value=V,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(V=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,d.addDisposableDomListener)(this.element,"mousedown",V=>this._selectionService.handleMouseDown(V))),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(B.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",V=>this._handleScreenReaderModeOptionChange(V))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",V=>{!this._overviewRulerRenderer&&V&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier2)}bindMouse(){const W=this,U=this.element;function z(q){const X=W._mouseService.getMouseReportCoords(q,W.screenElement);if(!X)return!1;let ie,re;switch(q.overrideType||q.type){case"mousemove":re=32,q.buttons===void 0?(ie=3,q.button!==void 0&&(ie=q.button<3?q.button:3)):ie=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":re=0,ie=q.button<3?q.button:3;break;case"mousedown":re=1,ie=q.button<3?q.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(q)===!1||W.viewport.getLinesScrolled(q)===0)return!1;re=q.deltaY<0?0:1,ie=4;break;default:return!1}return!(re===void 0||ie===void 0||ie>4)&&W.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:ie,action:re,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const V={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:q=>(z(q),q.buttons||(this._document.removeEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.removeEventListener("mousemove",V.mousedrag)),this.cancel(q)),wheel:q=>(z(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&z(q)},mousemove:q=>{q.buttons||z(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?V.mousemove||(U.addEventListener("mousemove",K.mousemove),V.mousemove=K.mousemove):(U.removeEventListener("mousemove",V.mousemove),V.mousemove=null),16&q?V.wheel||(U.addEventListener("wheel",K.wheel,{passive:!1}),V.wheel=K.wheel):(U.removeEventListener("wheel",V.wheel),V.wheel=null),2&q?V.mouseup||(V.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",V.mouseup),V.mouseup=null),4&q?V.mousedrag||(V.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",V.mousedrag),V.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(U,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return z(q),V.mouseup&&this._document.addEventListener("mouseup",V.mouseup),V.mousedrag&&this._document.addEventListener("mousemove",V.mousedrag),this.cancel(q)})),this.register((0,d.addDisposableDomListener)(U,"wheel",q=>{if(!V.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const X=this.viewport.getLinesScrolled(q);if(X===0)return;const ie=I.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let re="";for(let ce=0;ce<Math.abs(X);ce++)re+=ie;return this.coreService.triggerDataEvent(re,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,d.addDisposableDomListener)(U,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,d.addDisposableDomListener)(U,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(W,U){var z;(z=this._renderService)==null||z.refreshRows(W,U)}updateCursorStyle(W){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(W)?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(W,U,z=0){var V;z===1?(super.scrollLines(W,U,z),this.refresh(0,this.rows-1)):(V=this.viewport)==null||V.scrollLines(W)}paste(W){(0,c.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this.linkifier2.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,U,z){this._selectionService.setSelection(W,U,z)}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(){var W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,U){var z;(z=this._selectionService)==null||z.selectLines(W,U)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!U&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const z=(0,j.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),z.type===3||z.type===2){const V=this.rows-1;return this.scrollLines(z.type===2?-V:V),this.cancel(W,!0)}return z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(z.cancel&&this.cancel(W,!0),!z.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(z.key!==I.C0.ETX&&z.key!==I.C0.CR||(this.textarea.value=""),this._onKey.fire({key:z.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(z.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,U){const z=W.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||W.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||W.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?z:z&&(!U.keyCode||U.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)U=W.charCode;else if(W.which===null||W.which===void 0)U=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;U=W.which}return!(!U||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=W.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(W),!0}return!1}resize(W,U){W!==this.cols||U!==this.rows?super.resize(W,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,U){var z,V;(z=this._charSizeService)==null||z.measure(),(V=this.viewport)==null||V.syncScrollArea(!0)}clear(){var W;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 U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(N.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var U,z;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(z=this.viewport)==null||z.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(I.C0.ESC+"[I"):this.coreService.triggerDataEvent(I.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${I.C0.ESC}[4;${z};${U}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const V=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${I.C0.ESC}[6;${K};${V}t`)}}cancel(W,U){if(this.options.cancelEvents||U)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=G},9924:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(l,c=1e3){this._renderCallback=l,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,c,d){this._rowCount=d,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const h=u-this._lastRefreshMs,f=this._debounceThresholdMS-h;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c)}}},1680:function(a,o,l){var c=this&&this.__decorate||function(p,g,_,S){var k,C=arguments.length,T=C<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,g,_,S);else for(var w=p.length-1;w>=0;w--)(k=p[w])&&(T=(C<3?k(T):C>3?k(g,_,T):k(g,_))||T);return C>3&&T&&Object.defineProperty(g,_,T),T},d=this&&this.__param||function(p,g){return function(_,S){g(_,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=l(3656),h=l(4725),f=l(8460),b=l(844),y=l(2585);let m=o.Viewport=class extends b.Disposable{constructor(p,g,_,S,k,C,T,w){super(),this._viewportElement=p,this._scrollArea=g,this._bufferService=_,this._optionsService=S,this._charSizeService=k,this._renderService=C,this._coreBrowserService=T,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 f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,g){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&_<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const g=this._getPixelsScrolled(p);return g!==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+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(p,g))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let g=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(p,g){var w;let _,S="";const k=[],C=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let E=p;E<C;E++){const $=T.get(E);if(!$)continue;const M=(w=T.get(E+1))==null?void 0:w.isWrapped;if(S+=$.translateToString(!M),!M||E===T.length-1){const P=document.createElement("div");P.textContent=S,k.push(P),S.length>0&&(_=P),S=""}}return{bufferElements:k,cursorElement:_}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let g=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(p,g){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&g.altKey||_==="ctrl"&&g.ctrlKey||_==="shift"&&g.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const g=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(p,g))}};o.Viewport=m=c([d(2,y.IBufferService),d(3,y.IOptionsService),d(4,h.ICharSizeService),d(5,h.IRenderService),d(6,h.ICoreBrowserService),d(7,h.IThemeService)],m)},3107:function(a,o,l){var c=this&&this.__decorate||function(y,m,p,g){var _,S=arguments.length,k=S<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,m,p,g);else for(var C=y.length-1;C>=0;C--)(_=y[C])&&(k=(S<3?_(k):S>3?_(m,p,k):_(m,p))||k);return S>3&&k&&Object.defineProperty(m,p,k),k},d=this&&this.__param||function(y,m){return function(p,g){m(p,g,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=l(4725),h=l(844),f=l(2585);let b=o.BufferDecorationRenderer=class extends h.Disposable{constructor(y,m,p,g,_){super(),this._screenElement=y,this._bufferService=m,this._coreBrowserService=p,this._decorationService=g,this._renderService=_,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(S=>this._removeDecoration(S))),this.register((0,h.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 y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var g;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((g=y==null?void 0:y.options)==null?void 0:g.layer)==="top"),m.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=y.options.x??0;return p&&p>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(y,m),m}_refreshStyle(y){const m=y.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let p=this._decorationElements.get(y);p||(p=this._createElement(y),y.element=p,this._decorationElements.set(y,p),this._container.appendChild(p),y.onDispose(()=>{this._decorationElements.delete(y),p.remove()})),p.style.top=m*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(p)}}_refreshXPosition(y,m=y.element){if(!m)return;const p=y.options.x??0;(y.options.anchor||"left")==="right"?m.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var m;(m=this._decorationElements.get(y))==null||m.remove(),this._decorationElements.delete(y),y.dispose()}};o.BufferDecorationRenderer=b=c([d(1,f.IBufferService),d(2,u.ICoreBrowserService),d(3,f.IDecorationService),d(4,u.IRenderService)],b)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(l){if(l.options.overviewRulerOptions){for(const c of this._zones)if(c.color===l.options.overviewRulerOptions.color&&c.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,l.marker.line))return;if(this._lineAdjacentToZone(c,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(c,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,c){return c>=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,d){return c>=l.startBufferLine-this._linePadding[d||"full"]&&c<=l.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(a,o,l){var c=this&&this.__decorate||function(_,S,k,C){var T,w=arguments.length,E=w<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,k):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,S,k,C);else for(var $=_.length-1;$>=0;$--)(T=_[$])&&(E=(w<3?T(E):w>3?T(S,k,E):T(S,k))||E);return w>3&&E&&Object.defineProperty(S,k,E),E},d=this&&this.__param||function(_,S){return function(k,C){S(k,C,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=l(5871),h=l(4725),f=l(844),b=l(2585),y={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let g=o.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,S,k,C,T,w,E){var M;super(),this._viewportElement=_,this._screenElement=S,this._bufferService=k,this._decorationService=C,this._renderService=T,this._optionsService=w,this._coreBrowserService=E,this._colorZoneStore=new u.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(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)(()=>{var P;(P=this._canvas)==null||P.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 _=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=_,m.center=S,m.right=_,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=m.left,p.right=m.left+m.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const S of _)S.position!=="full"&&this._renderColorZone(S);for(const S of _)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(p[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-y[_.position||"full"]/2),m[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[_.position||"full"]))}_queueRefresh(_,S){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=g=c([d(2,b.IBufferService),d(3,b.IDecorationService),d(4,h.IRenderService),d(5,b.IOptionsService),d(6,h.ICoreBrowserService)],g)},2950:function(a,o,l){var c=this&&this.__decorate||function(y,m,p,g){var _,S=arguments.length,k=S<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,m,p,g);else for(var C=y.length-1;C>=0;C--)(_=y[C])&&(k=(S<3?_(k):S>3?_(m,p,k):_(m,p))||k);return S>3&&k&&Object.defineProperty(m,p,k),k},d=this&&this.__param||function(y,m){return function(p,g){m(p,g,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=l(4725),h=l(2585),f=l(2584);let b=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,m,p,g,_,S){this._textarea=y,this._compositionView=m,this._bufferService=p,this._optionsService=g,this._coreService=_,this._renderService=S,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(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}},0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const m=this._textarea.value,p=m.replace(y,"");this._dataAlreadySent=p,m.length>y.length?this._coreService.triggerDataEvent(p,!0):m.length<y.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):m.length===y.length&&m!==y&&this._coreService.triggerDataEvent(m,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=b=c([d(2,h.IBufferService),d(3,h.IOptionsService),d(4,h.ICoreService),d(5,u.IRenderService)],b)},9806:(a,o)=>{function l(c,d,u){const h=u.getBoundingClientRect(),f=c.getComputedStyle(u),b=parseInt(f.getPropertyValue("padding-left")),y=parseInt(f.getPropertyValue("padding-top"));return[d.clientX-h.left-b,d.clientY-h.top-y]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(c,d,u,h,f,b,y,m,p){if(!b)return;const g=l(c,d,u);return g?(g[0]=Math.ceil((g[0]+(p?y/2:0))/y),g[1]=Math.ceil(g[1]/m),g[0]=Math.min(Math.max(g[0],1),h+(p?1:0)),g[1]=Math.min(Math.max(g[1],1),f),g):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const c=l(2584);function d(m,p,g,_){const S=m-u(m,g),k=p-u(p,g),C=Math.abs(S-k)-function(T,w,E){let $=0;const M=T-u(T,E),P=w-u(w,E);for(let D=0;D<Math.abs(M-P);D++){const R=h(T,w)==="A"?-1:1,O=E.buffer.lines.get(M+R*D);O!=null&&O.isWrapped&&$++}return $}(m,p,g);return y(C,b(h(m,p),_))}function u(m,p){let g=0,_=p.buffer.lines.get(m),S=_==null?void 0:_.isWrapped;for(;S&&m>=0&&m<p.rows;)g++,_=p.buffer.lines.get(--m),S=_==null?void 0:_.isWrapped;return g}function h(m,p){return m>p?"A":"B"}function f(m,p,g,_,S,k){let C=m,T=p,w="";for(;C!==g||T!==_;)C+=S?1:-1,S&&C>k.cols-1?(w+=k.buffer.translateBufferLineToString(T,!1,m,C),C=0,m=0,T++):!S&&C<0&&(w+=k.buffer.translateBufferLineToString(T,!1,0,m+1),C=k.cols-1,m=C,T--);return w+k.buffer.translateBufferLineToString(T,!1,m,C)}function b(m,p){const g=p?"O":"[";return c.C0.ESC+g+m}function y(m,p){m=Math.floor(m);let g="";for(let _=0;_<m;_++)g+=p;return g}o.moveToCellSequence=function(m,p,g,_){const S=g.buffer.x,k=g.buffer.y;if(!g.buffer.hasScrollback)return function(w,E,$,M,P,D){return d(E,M,P,D).length===0?"":y(f(w,E,w,E-u(E,P),!1,P).length,b("D",D))}(S,k,0,p,g,_)+d(k,p,g,_)+function(w,E,$,M,P,D){let R;R=d(E,M,P,D).length>0?M-u(M,P):E;const O=M,N=function(I,j,L,A,F,H){let B;return B=d(L,A,F,H).length>0?A-u(A,F):j,I<L&&B<=A||I>=L&&B<A?"C":"D"}(w,E,$,M,P,D);return y(f(w,R,$,O,N==="C",P).length,b(N,D))}(S,k,m,p,g,_);let C;if(k===p)return C=S>m?"D":"C",y(Math.abs(S-m),b(C,_));C=k>p?"D":"C";const T=Math.abs(k-p);return y(function(w,E){return E.cols-w}(k>p?m:S,g)+(T-1)*g.cols+1+((k>p?S:m)-1),b(C,_))}},1296:function(a,o,l){var c=this&&this.__decorate||function(D,R,O,N){var I,j=arguments.length,L=j<3?R:N===null?N=Object.getOwnPropertyDescriptor(R,O):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(D,R,O,N);else for(var A=D.length-1;A>=0;A--)(I=D[A])&&(L=(j<3?I(L):j>3?I(R,O,L):I(R,O))||L);return j>3&&L&&Object.defineProperty(R,O,L),L},d=this&&this.__param||function(D,R){return function(O,N){R(O,N,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=l(3787),h=l(2550),f=l(2223),b=l(6171),y=l(6052),m=l(4725),p=l(8055),g=l(8460),_=l(844),S=l(2585),k="xterm-dom-renderer-owner-",C="xterm-rows",T="xterm-fg-",w="xterm-bg-",E="xterm-focus",$="xterm-selection";let M=1,P=o.DomRenderer=class extends _.Disposable{constructor(D,R,O,N,I,j,L,A,F,H,B,G,J){super(),this._terminal=D,this._document=R,this._element=O,this._screenElement=N,this._viewportElement=I,this._helperContainer=j,this._linkifier2=L,this._charSizeService=F,this._optionsService=H,this._bufferService=B,this._coreBrowserService=G,this._themeService=J,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),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($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(W=>this._injectCss(W))),this._injectCss(this._themeService.colors),this._rowFactory=A.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(k+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(W=>this._handleLinkHover(W))),this.register(this._linkifier2.onHideLinkUnderline(W=>this._handleLinkLeave(W))),this.register((0,_.toDisposable)(()=>{this._element.classList.remove(k+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new h.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const R=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=R,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let R=`${this._terminalSelector} .${C} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;R+=`${this._terminalSelector} .${C} .xterm-dim { color: ${p.color.multiplyOpacity(D.foreground,.5).css};}`,R+=`${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;}`,R+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% {  border-bottom-style: hidden; }}",R+="@keyframes blink_block_"+this._terminalClass+` { 0% {  background-color: ${D.cursor.css};  color: ${D.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${D.cursor.css}; }}`,R+=`${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,R+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[O,N]of D.ansi.entries())R+=`${this._terminalSelector} .${T}${O} { color: ${N.css}; }${this._terminalSelector} .${T}${O}.xterm-dim { color: ${p.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${w}${O} { background-color: ${N.css}; }`;R+=`${this._terminalSelector} .${T}${f.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(D.background).css}; }${this._terminalSelector} .${T}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${w}${f.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=R}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,R){for(let O=this._rowElements.length;O<=R;O++){const N=this._document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>R;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,R){this._refreshRowElements(D,R),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,R,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,R,O),this.renderRows(0,this._bufferService.rows-1),!D||!R)return;this._selectionRenderModel.update(this._terminal,D,R,O);const N=this._selectionRenderModel.viewportStartRow,I=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||L<0)return;const A=this._document.createDocumentFragment();if(O){const F=D[0]>R[0];A.appendChild(this._createSelectionElement(j,F?R[0]:D[0],F?D[0]:R[0],L-j+1))}else{const F=N===j?D[0]:0,H=j===I?R[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(j,F,H));const B=L-j-1;if(A.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,B)),j!==L){const G=I===L?R[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(L,0,G))}}this._selectionContainer.appendChild(A)}_createSelectionElement(D,R,O,N=1){const I=this._document.createElement("div"),j=R*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(O-R);return j+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-j),I.style.height=N*this.dimensions.css.cell.height+"px",I.style.top=D*this.dimensions.css.cell.height+"px",I.style.left=`${j}px`,I.style.width=`${L}px`,I}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 D of this._rowElements)D.replaceChildren()}renderRows(D,R){const O=this._bufferService.buffer,N=O.ybase+O.y,I=Math.min(O.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=D;F<=R;F++){const H=F+O.ydisp,B=this._rowElements[F],G=O.lines.get(H);if(!B||!G)break;B.replaceChildren(...this._rowFactory.createRow(G,H,H===N,L,A,I,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,R,O,N,I,j){O<0&&(D=0),N<0&&(R=0);const L=this._bufferService.rows-1;O=Math.max(Math.min(O,L),0),N=Math.max(Math.min(N,L),0),I=Math.min(I,this._bufferService.cols);const A=this._bufferService.buffer,F=A.ybase+A.y,H=Math.min(A.x,I-1),B=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let W=O;W<=N;++W){const U=W+A.ydisp,z=this._rowElements[W],V=A.lines.get(U);if(!z||!V)break;z.replaceChildren(...this._rowFactory.createRow(V,U,U===F,G,J,H,B,this.dimensions.css.cell.width,this._widthCache,j?W===O?D:0:-1,j?(W===N?R:I)-1:-1))}}};o.DomRenderer=P=c([d(7,S.IInstantiationService),d(8,m.ICharSizeService),d(9,S.IOptionsService),d(10,S.IBufferService),d(11,m.ICoreBrowserService),d(12,m.IThemeService)],P)},3787:function(a,o,l){var c=this&&this.__decorate||function(C,T,w,E){var $,M=arguments.length,P=M<3?T:E===null?E=Object.getOwnPropertyDescriptor(T,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(C,T,w,E);else for(var D=C.length-1;D>=0;D--)($=C[D])&&(P=(M<3?$(P):M>3?$(T,w,P):$(T,w))||P);return M>3&&P&&Object.defineProperty(T,w,P),P},d=this&&this.__param||function(C,T){return function(w,E){T(w,E,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=l(2223),h=l(643),f=l(511),b=l(2585),y=l(8055),m=l(4725),p=l(4269),g=l(6171),_=l(3734);let S=o.DomRendererRowFactory=class{constructor(C,T,w,E,$,M,P){this._document=C,this._characterJoinerService=T,this._optionsService=w,this._coreBrowserService=E,this._coreService=$,this._decorationService=M,this._themeService=P,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,T,w){this._selectionStart=C,this._selectionEnd=T,this._columnSelectMode=w}createRow(C,T,w,E,$,M,P,D,R,O,N){const I=[],j=this._characterJoinerService.getJoinedCharacters(T),L=this._themeService.colors;let A,F=C.getNoBgTrimmedLength();w&&F<M+1&&(F=M+1);let H=0,B="",G=0,J=0,W=0,U=!1,z=0,V=!1,K=0;const q=[],X=O!==-1&&N!==-1;for(let ie=0;ie<F;ie++){C.loadCell(ie,this._workCell);let re=this._workCell.getWidth();if(re===0)continue;let ce=!1,ye=ie,ae=this._workCell;if(j.length>0&&ie===j[0][0]){ce=!0;const be=j.shift();ae=new p.JoinedCellData(this._workCell,C.translateToString(!0,be[0],be[1]),be[1]-be[0]),ye=be[1]-1,re=ae.getWidth()}const Me=this._isCellInSelection(ie,T),Pe=w&&ie===M,ge=X&&ie>=O&&ie<=N;let xe=!1;this._decorationService.forEachDecorationAtCell(ie,T,void 0,be=>{xe=!0});let oe=ae.getChars()||h.WHITESPACE_CELL_CHAR;if(oe===" "&&(ae.isUnderline()||ae.isOverline())&&(oe=" "),K=re*D-R.get(oe,ae.isBold(),ae.isItalic()),A){if(H&&(Me&&V||!Me&&!V&&ae.bg===G)&&(Me&&V&&L.selectionForeground||ae.fg===J)&&ae.extended.ext===W&&ge===U&&K===z&&!Pe&&!ce&&!xe){ae.isInvisible()?B+=h.WHITESPACE_CELL_CHAR:B+=oe,H++;continue}H&&(A.textContent=B),A=this._document.createElement("span"),H=0,B=""}else A=this._document.createElement("span");if(G=ae.bg,J=ae.fg,W=ae.extended.ext,U=ge,z=K,V=Me,ce&&M>=ie&&M<=ye&&(M=ie),!this._coreService.isCursorHidden&&Pe&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&q.push("xterm-cursor-blink"),q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline")}}if(ae.isBold()&&q.push("xterm-bold"),ae.isItalic()&&q.push("xterm-italic"),ae.isDim()&&q.push("xterm-dim"),B=ae.isInvisible()?h.WHITESPACE_CELL_CHAR:ae.getChars()||h.WHITESPACE_CELL_CHAR,ae.isUnderline()&&(q.push(`xterm-underline-${ae.extended.underlineStyle}`),B===" "&&(B=" "),!ae.isUnderlineColorDefault()))if(ae.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(ae.getUnderlineColor()).join(",")})`;else{let be=ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ae.isBold()&&be<8&&(be+=8),A.style.textDecorationColor=L.ansi[be].css}ae.isOverline()&&(q.push("xterm-overline"),B===" "&&(B=" ")),ae.isStrikethrough()&&q.push("xterm-strikethrough"),ge&&(A.style.textDecoration="underline");let se=ae.getFgColor(),fe=ae.getFgColorMode(),Q=ae.getBgColor(),ne=ae.getBgColorMode();const he=!!ae.isInverse();if(he){const be=se;se=Q,Q=be;const mt=fe;fe=ne,ne=mt}let ve,Ce,Te,we=!1;switch(this._decorationService.forEachDecorationAtCell(ie,T,void 0,be=>{be.options.layer!=="top"&&we||(be.backgroundColorRGB&&(ne=50331648,Q=be.backgroundColorRGB.rgba>>8&16777215,ve=be.backgroundColorRGB),be.foregroundColorRGB&&(fe=50331648,se=be.foregroundColorRGB.rgba>>8&16777215,Ce=be.foregroundColorRGB),we=be.options.layer==="top")}),!we&&Me&&(ve=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,Q=ve.rgba>>8&16777215,ne=50331648,we=!0,L.selectionForeground&&(fe=50331648,se=L.selectionForeground.rgba>>8&16777215,Ce=L.selectionForeground)),we&&q.push("xterm-decoration-top"),ne){case 16777216:case 33554432:Te=L.ansi[Q],q.push(`xterm-bg-${Q}`);break;case 50331648:Te=y.rgba.toColor(Q>>16,Q>>8&255,255&Q),this._addStyle(A,`background-color:#${k((Q>>>0).toString(16),"0",6)}`);break;default:he?(Te=L.foreground,q.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Te=L.background}switch(ve||ae.isDim()&&(ve=y.color.multiplyOpacity(Te,.5)),fe){case 16777216:case 33554432:ae.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(A,Te,L.ansi[se],ae,ve,void 0)||q.push(`xterm-fg-${se}`);break;case 50331648:const be=y.rgba.toColor(se>>16&255,se>>8&255,255&se);this._applyMinimumContrast(A,Te,be,ae,ve,Ce)||this._addStyle(A,`color:#${k(se.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,Te,L.foreground,ae,ve,Ce)||he&&q.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}q.length&&(A.className=q.join(" "),q.length=0),Pe||ce||xe?A.textContent=B:H++,K!==this.defaultSpacing&&(A.style.letterSpacing=`${K}px`),I.push(A),ie=ye}return A&&H&&(A.textContent=B),I}_applyMinimumContrast(C,T,w,E,$,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const P=this._getContrastCache(E);let D;if($||M||(D=P.getColor(T.rgba,w.rgba)),D===void 0){const R=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);D=y.color.ensureContrastRatio($||T,M||w,R),P.setColor(($||T).rgba,(M||w).rgba,D??null)}return!!D&&(this._addStyle(C,`color:${D.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,T){C.setAttribute("style",`${C.getAttribute("style")||""}${T};`)}_isCellInSelection(C,T){const w=this._selectionStart,E=this._selectionEnd;return!(!w||!E)&&(this._columnSelectMode?w[0]<=E[0]?C>=w[0]&&T>=w[1]&&C<E[0]&&T<=E[1]:C<w[0]&&T>=w[1]&&C>=E[0]&&T<=E[1]:T>w[1]&&T<E[1]||w[1]===E[1]&&T===w[1]&&C>=w[0]&&C<E[0]||w[1]<E[1]&&T===E[1]&&C<E[0]||w[1]<E[1]&&T===w[1]&&C>=w[0])}};function k(C,T,w){for(;C.length<w;)C=T+C;return C}o.DomRendererRowFactory=S=c([d(1,m.ICharacterJoinerService),d(2,b.IOptionsService),d(3,m.ICoreBrowserService),d(4,b.ICoreService),d(5,b.IDecorationService),d(6,m.IThemeService)],S)},2550:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(l,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=l.createElement("span");d.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const h=l.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontStyle="italic";const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[d,u,h,f],this._container.appendChild(d),this._container.appendChild(u),this._container.appendChild(h),this._container.appendChild(f),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(l,c,d,u){l===this._font&&c===this._fontSize&&d===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=c,this._weight=d,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,c,d){let u=0;if(!c&&!d&&l.length===1&&(u=l.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(l,0);let h=l;c&&(h+="B"),d&&(h+="I");let f=this._holey.get(h);if(f===void 0){let b=0;c&&(b|=1),d&&(b|=2),f=this._measure(l,b),this._holey.set(h,f)}return f}_measure(l,c){const d=this._measureElements[c];return d.textContent=l.repeat(32),d.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const c=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},o.treatGlyphAsBackgroundColor=function(c){return l(c)||function(d){return 9472<=d&&d<=9631}(c)},o.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}}}},o.computeNextVariantOffset=function(c,d,u=0){return(c-(2*Math.round(d)-u))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(d,u,h,f=!1){if(this.selectionStart=u,this.selectionEnd=h,!u||!h||u[0]===h[0]&&u[1]===h[1])return void this.clear();const b=d.buffers.active.ydisp,y=u[1]-b,m=h[1]-b,p=Math.max(y,0),g=Math.min(m,d.rows-1);p>=d.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=y,this.viewportEndRow=m,this.viewportCappedStartRow=p,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=h[0])}isCellSelected(d,u,h){return!!this.hasSelection&&(h-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&h>=this.viewportCappedStartRow&&u<this.endCol&&h<=this.viewportCappedEndRow:u<this.startCol&&h>=this.viewportCappedStartRow&&u>=this.endCol&&h<=this.viewportCappedEndRow:h>this.viewportStartRow&&h<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(l){this._bufferService=l,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,c=this.selectionEnd;return!(!l||!c)&&(l[1]>c[1]||l[1]===c[1]&&l[0]>c[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,l){var c=this&&this.__decorate||function(m,p,g,_){var S,k=arguments.length,C=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,p,g,_);else for(var T=m.length-1;T>=0;T--)(S=m[T])&&(C=(k<3?S(C):k>3?S(p,g,C):S(p,g))||C);return k>3&&C&&Object.defineProperty(p,g,C),C},d=this&&this.__param||function(m,p){return function(g,_){p(g,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=l(2585),h=l(8460),f=l(844);let b=o.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,p,g){super(),this._optionsService=g,this.width=0,this.height=0,this._onCharSizeChange=this.register(new h.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(m,p,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};o.CharSizeService=b=c([d(2,u.IOptionsService)],b);class y{constructor(p,g,_){this._document=p,this._parentElement=g,this._optionsService=_,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const p={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return p.width!==0&&p.height!==0&&(this._result.width=p.width/32,this._result.height=Math.ceil(p.height)),this._result}}},4269:function(a,o,l){var c=this&&this.__decorate||function(p,g,_,S){var k,C=arguments.length,T=C<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,g,_,S);else for(var w=p.length-1;w>=0;w--)(k=p[w])&&(T=(C<3?k(T):C>3?k(g,_,T):k(g,_))||T);return C>3&&T&&Object.defineProperty(g,_,T),T},d=this&&this.__param||function(p,g){return function(_,S){g(_,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(3734),h=l(643),f=l(511),b=l(2585);class y extends u.AttributeData{constructor(g,_,S){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=_,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=y;let m=o.CharacterJoinerService=class CA{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(g){const _={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(_),_.id}deregister(g){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===g)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(g);if(!_||_.length===0)return[];const S=[],k=_.translateToString(!0);let C=0,T=0,w=0,E=_.getFg(0),$=_.getBg(0);for(let M=0;M<_.getTrimmedLength();M++)if(_.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==$){if(M-C>1){const P=this._getJoinedRanges(k,w,T,_,C);for(let D=0;D<P.length;D++)S.push(P[D])}C=M,w=T,E=this._workCell.fg,$=this._workCell.bg}T+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(k,w,T,_,C);for(let P=0;P<M.length;P++)S.push(M[P])}return S}_getJoinedRanges(g,_,S,k,C){const T=g.substring(_,S);let w=[];try{w=this._characterJoiners[0].handler(T)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const $=this._characterJoiners[E].handler(T);for(let M=0;M<$.length;M++)CA._mergeRanges(w,$[M])}catch($){console.error($)}return this._stringRangesToCellRanges(w,k,C),w}_stringRangesToCellRanges(g,_,S){let k=0,C=!1,T=0,w=g[k];if(w){for(let E=S;E<this._bufferService.cols;E++){const $=_.getWidth(E),M=_.getString(E).length||h.WHITESPACE_CELL_CHAR.length;if($!==0){if(!C&&w[0]<=T&&(w[0]=E,C=!0),w[1]<=T){if(w[1]=E,w=g[++k],!w)break;w[0]<=T?(w[0]=E,C=!0):C=!1}T+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(g,_){let S=!1;for(let k=0;k<g.length;k++){const C=g[k];if(S){if(_[1]<=C[0])return g[k-1][1]=_[1],g;if(_[1]<=C[1])return g[k-1][1]=Math.max(_[1],C[1]),g.splice(k,1),g;g.splice(k,1),k--}else{if(_[1]<=C[0])return g.splice(k,0,_),g;if(_[1]<=C[1])return C[0]=Math.min(_[0],C[0]),g;_[0]<C[1]&&(C[0]=Math.min(_[0],C[0]),S=!0)}}return S?g[g.length-1][1]=_[1]:g.push(_),g}};o.CharacterJoinerService=m=c([d(0,b.IBufferService)],m)},5114:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const c=l(844),d=l(8460),u=l(3656);class h extends c.Disposable{constructor(y,m,p){super(),this._textarea=y,this._window=m,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(g=>this._screenDprMonitor.setWindow(g))),this.register((0,d.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(y){this._window!==y&&(this._window=y,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}}o.CoreBrowserService=h;class f extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.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)}}},8934:function(a,o,l){var c=this&&this.__decorate||function(b,y,m,p){var g,_=arguments.length,S=_<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,y,m,p);else for(var k=b.length-1;k>=0;k--)(g=b[k])&&(S=(_<3?g(S):_>3?g(y,m,S):g(y,m))||S);return _>3&&S&&Object.defineProperty(y,m,S),S},d=this&&this.__param||function(b,y){return function(m,p){y(m,p,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=l(4725),h=l(9806);let f=o.MouseService=class{constructor(b,y){this._renderService=b,this._charSizeService=y}getCoords(b,y,m,p,g){return(0,h.getCoords)(window,b,y,m,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(b,y){const m=(0,h.getCoordsRelativeToElement)(window,b,y);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};o.MouseService=f=c([d(0,u.IRenderService),d(1,u.ICharSizeService)],f)},3230:function(a,o,l){var c=this&&this.__decorate||function(g,_,S,k){var C,T=arguments.length,w=T<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(g,_,S,k);else for(var E=g.length-1;E>=0;E--)(C=g[E])&&(w=(T<3?C(w):T>3?C(_,S,w):C(_,S))||w);return T>3&&w&&Object.defineProperty(_,S,w),w},d=this&&this.__param||function(g,_){return function(S,k){_(S,k,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=l(6193),h=l(4725),f=l(8460),b=l(844),y=l(7226),m=l(2585);let p=o.RenderService=class extends b.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,_,S,k,C,T,w,E){super(),this._rowCount=g,this._charSizeService=k,this._renderer=this.register(new b.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new b.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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(($,M)=>this._renderRows($,M),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(T.onResize(()=>this._fullRefresh())),this.register(T.buffers.onBufferActivate(()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()})),this.register(S.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()})),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(T.buffer.y,T.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,_),this.register(w.onWindowChange($=>this._registerIntersectionObserver($,_)))}_registerIntersectionObserver(g,_){if("IntersectionObserver"in g){const S=new g.IntersectionObserver(k=>this._handleIntersectionChange(k[k.length-1]),{threshold:0});S.observe(_),this._observerDisposable.value=(0,b.toDisposable)(()=>S.disconnect())}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,_,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,_,this._rowCount))}_renderRows(g,_){this._renderer.value&&(g=Math.min(g,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(g,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:_}),this._onRender.fire({start:g,end:_}),this._isNextRenderRedrawOnly=!0)}resize(g,_){this._rowCount=_,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw(_=>this.refreshRows(_.start,_.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,_;this._renderer.value&&((_=(g=this._renderer.value).clearTextureAtlas)==null||_.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(g,_)):this._renderer.value.handleResize(g,_),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,_,S){var k;this._selectionState.start=g,this._selectionState.end=_,this._selectionState.columnSelectMode=S,(k=this._renderer.value)==null||k.handleSelectionChanged(g,_,S)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};o.RenderService=p=c([d(2,m.IOptionsService),d(3,h.ICharSizeService),d(4,m.IDecorationService),d(5,m.IBufferService),d(6,h.ICoreBrowserService),d(7,h.IThemeService)],p)},9312:function(a,o,l){var c=this&&this.__decorate||function(w,E,$,M){var P,D=arguments.length,R=D<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,$):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,E,$,M);else for(var O=w.length-1;O>=0;O--)(P=w[O])&&(R=(D<3?P(R):D>3?P(E,$,R):P(E,$))||R);return D>3&&R&&Object.defineProperty(E,$,R),R},d=this&&this.__param||function(w,E){return function($,M){E($,M,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=l(9806),h=l(9504),f=l(456),b=l(4725),y=l(8460),m=l(844),p=l(6114),g=l(4841),_=l(511),S=l(2585),k=" ",C=new RegExp(k,"g");let T=o.SelectionService=class extends m.Disposable{constructor(w,E,$,M,P,D,R,O,N){super(),this._element=w,this._screenElement=E,this._linkifier=$,this._bufferService=M,this._coreService=P,this._mouseService=D,this._optionsService=R,this._renderService=O,this._coreBrowserService=N,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=I=>this._handleMouseMove(I),this._mouseUpListener=I=>this._handleMouseUp(I),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(I=>this._handleTrim(I)),this.register(this._bufferService.buffers.onBufferActivate(I=>this._handleBufferActivate(I))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.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 w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!w||!E||w[0]===E[0]&&w[1]===E[1])}get selectionText(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!w||!E)return"";const $=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(w[0]===E[0])return"";const P=w[0]<E[0]?w[0]:E[0],D=w[0]<E[0]?E[0]:w[0];for(let R=w[1];R<=E[1];R++){const O=$.translateBufferLineToString(R,!0,P,D);M.push(O)}}else{const P=w[1]===E[1]?E[0]:void 0;M.push($.translateBufferLineToString(w[1],!0,w[0],P));for(let D=w[1]+1;D<=E[1]-1;D++){const R=$.lines.get(D),O=$.translateBufferLineToString(D,!0);R!=null&&R.isWrapped?M[M.length-1]+=O:M.push(O)}if(w[1]!==E[1]){const D=$.lines.get(E[1]),R=$.translateBufferLineToString(E[1],!0,0,E[0]);D&&D.isWrapped?M[M.length-1]+=R:M.push(R)}}return M.map(P=>P.replace(C," ")).join(p.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p.isLinux&&w&&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(w){const E=this._getMouseBufferCoords(w),$=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!($&&M&&E)&&this._areCoordsInSelection(E,$,M)}isCellInSelection(w,E){const $=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!$||!M)&&this._areCoordsInSelection([w,E],$,M)}_areCoordsInSelection(w,E,$){return w[1]>E[1]&&w[1]<$[1]||E[1]===$[1]&&w[1]===E[1]&&w[0]>=E[0]&&w[0]<$[0]||E[1]<$[1]&&w[1]===$[1]&&w[0]<$[0]||E[1]<$[1]&&w[1]===E[1]&&w[0]>=E[0]}_selectWordAtCursor(w,E){var P,D;const $=(D=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:D.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(w);return!!M&&(this._selectWordAt(M,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,E){this._model.clearSelection(),w=Math.max(w,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const E=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(w){let E=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=$?0:(E>$&&(E-=$),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(w){return p.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const E=this._getMouseBufferCoords(w);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(w){return w.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const M=$.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const E=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const M=(0,h.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,$=!(!w||!E||w[0]===E[0]&&w[1]===E[1]);$?w&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,E,$)):this._oldHasSelection&&this._fireOnSelectionChange(w,E,$)}_fireOnSelectionChange(w,E,$){this._oldSelectionStart=w,this._oldSelectionEnd=E,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(w,E){let $=E;for(let M=0;E>=M;M++){const P=w.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:P>1&&E!==M&&($+=P-1)}return $}setSelection(w,E,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,E],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,E,$=!0,M=!0){if(w[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,D=P.lines.get(w[1]);if(!D)return;const R=P.translateBufferLineToString(w[1],!1);let O=this._convertViewportColToCharacterIndex(D,w[0]),N=O;const I=w[0]-O;let j=0,L=0,A=0,F=0;if(R.charAt(O)===" "){for(;O>0&&R.charAt(O-1)===" ";)O--;for(;N<R.length&&R.charAt(N+1)===" ";)N++}else{let G=w[0],J=w[0];D.getWidth(G)===0&&(j++,G--),D.getWidth(J)===2&&(L++,J++);const W=D.getString(J).length;for(W>1&&(F+=W-1,N+=W-1);G>0&&O>0&&!this._isCharWordSeparator(D.loadCell(G-1,this._workCell));){D.loadCell(G-1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,G--):U>1&&(A+=U-1,O-=U-1),O--,G--}for(;J<D.length&&N+1<R.length&&!this._isCharWordSeparator(D.loadCell(J+1,this._workCell));){D.loadCell(J+1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,J++):U>1&&(F+=U-1,N+=U-1),N++,J++}}N++;let H=O+I-j+A,B=Math.min(this._bufferService.cols,N-O+j+L-A-F);if(E||R.slice(O,N).trim()!==""){if($&&H===0&&D.getCodePoint(0)!==32){const G=P.lines.get(w[1]-1);if(G&&D.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(J){const W=this._bufferService.cols-J.start;H-=W,B+=W}}}if(M&&H+B===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const G=P.lines.get(w[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const J=this._getWordAt([0,w[1]+1],!1,!1,!0);J&&(B+=J.length)}}return{start:H,length:B}}}_selectWordAt(w,E){const $=this._getWordAt(w,E);if($){for(;$.start<0;)$.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[$.start,w[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(w){const E=this._getWordAt(w,!0);if(E){let $=w[1];for(;E.start<0;)E.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,$]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const E=this._bufferService.buffer.getWrappedRangeForLine(w),$={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)($,this._bufferService.cols)}};o.SelectionService=T=c([d(3,S.IBufferService),d(4,S.ICoreService),d(5,b.IMouseService),d(6,S.IOptionsService),d(7,b.IRenderService),d(8,b.ICoreBrowserService)],T)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const c=l(8343);o.ICharSizeService=(0,c.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),o.IMouseService=(0,c.createDecorator)("MouseService"),o.IRenderService=(0,c.createDecorator)("RenderService"),o.ISelectionService=(0,c.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(a,o,l){var c=this&&this.__decorate||function(T,w,E,$){var M,P=arguments.length,D=P<3?w:$===null?$=Object.getOwnPropertyDescriptor(w,E):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(T,w,E,$);else for(var R=T.length-1;R>=0;R--)(M=T[R])&&(D=(P<3?M(D):P>3?M(w,E,D):M(w,E))||D);return P>3&&D&&Object.defineProperty(w,E,D),D},d=this&&this.__param||function(T,w){return function(E,$){w(E,$,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),h=l(8055),f=l(8460),b=l(844),y=l(2585),m=h.css.toColor("#ffffff"),p=h.css.toColor("#000000"),g=h.css.toColor("#ffffff"),_=h.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let E=0;E<216;E++){const $=w[E/36%6|0],M=w[E/6%6|0],P=w[E%6];T.push({css:h.channels.toCss($,M,P),rgba:h.channels.toRgba($,M,P)})}for(let E=0;E<24;E++){const $=8+10*E;T.push({css:h.channels.toCss($,$,$),rgba:h.channels.toRgba($,$,$)})}return T})());let k=o.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:p,cursor:g,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:h.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:h.color.blend(p,S),ansi:o.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(T={}){const w=this._colors;if(w.foreground=C(T.foreground,m),w.background=C(T.background,p),w.cursor=C(T.cursor,g),w.cursorAccent=C(T.cursorAccent,_),w.selectionBackgroundTransparent=C(T.selectionBackground,S),w.selectionBackgroundOpaque=h.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=C(T.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=h.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=T.selectionForeground?C(T.selectionForeground,h.NULL_COLOR):void 0,w.selectionForeground===h.NULL_COLOR&&(w.selectionForeground=void 0),h.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=h.color.opacity(w.selectionBackgroundTransparent,.3)),h.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=h.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=o.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=C(T.black,o.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=C(T.red,o.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=C(T.green,o.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=C(T.yellow,o.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=C(T.blue,o.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=C(T.magenta,o.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=C(T.cyan,o.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=C(T.white,o.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=C(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=C(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=C(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=C(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=C(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=C(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=C(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=C(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const E=Math.min(w.ansi.length-16,T.extendedAnsi.length);for(let $=0;$<E;$++)w.ansi[$+16]=C(T.extendedAnsi[$],o.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(T){T(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 C(T,w){if(T!==void 0)try{return h.css.toColor(T)}catch{}return w}o.ThemeService=k=c([d(0,y.IOptionsService)],k)},6349:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const c=l(8460),d=l(844);class u extends d.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(f){if(this._maxLength===f)return;const b=new Array(f);for(let y=0;y<Math.min(f,this.length);y++)b[y]=this._array[this._getCyclicIndex(y)];this._array=b,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let b=this._length;b<f;b++)this._array[b]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,b){this._array[this._getCyclicIndex(f)]=b}push(f){this._array[this._getCyclicIndex(this._length)]=f,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(f,b,...y){if(b){for(let m=f;m<this._length-b;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+b)];this._length-=b,this.onDeleteEmitter.fire({index:f,amount:b})}for(let m=this._length-1;m>=f;m--)this._array[this._getCyclicIndex(m+y.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<y.length;m++)this._array[this._getCyclicIndex(f+m)]=y[m];if(y.length&&this.onInsertEmitter.fire({index:f,amount:y.length}),this._length+y.length>this._maxLength){const m=this._length+y.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=y.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,b,y){if(!(b<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=b-1;p>=0;p--)this.set(f+p+y,this.get(f+p));const m=f+b+y-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<b;m++)this.set(f+m+y,this.get(f+m))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}o.CircularList=u},1439:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(c,d=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const h in c)u[h]=d<=1?c[h]:c[h]&&l(c[h],d-1);return u}},8055:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;const c=l(6114);let d=0,u=0,h=0,f=0;var b,y,m,p,g;function _(k){const C=k.toString(16);return C.length<2?"0"+C:C}function S(k,C){return k<C?(C+.05)/(k+.05):(k+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(k){k.toCss=function(C,T,w,E){return E!==void 0?`#${_(C)}${_(T)}${_(w)}${_(E)}`:`#${_(C)}${_(T)}${_(w)}`},k.toRgba=function(C,T,w,E=255){return(C<<24|T<<16|w<<8|E)>>>0}}(b||(o.channels=b={})),function(k){function C(T,w){return f=Math.round(255*w),[d,u,h]=g.toChannels(T.rgba),{css:b.toCss(d,u,h,f),rgba:b.toRgba(d,u,h,f)}}k.blend=function(T,w){if(f=(255&w.rgba)/255,f===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,$=w.rgba>>16&255,M=w.rgba>>8&255,P=T.rgba>>24&255,D=T.rgba>>16&255,R=T.rgba>>8&255;return d=P+Math.round((E-P)*f),u=D+Math.round(($-D)*f),h=R+Math.round((M-R)*f),{css:b.toCss(d,u,h),rgba:b.toRgba(d,u,h)}},k.isOpaque=function(T){return(255&T.rgba)==255},k.ensureContrastRatio=function(T,w,E){const $=g.ensureContrastRatio(T.rgba,w.rgba,E);if($)return g.toColor($>>24&255,$>>16&255,$>>8&255)},k.opaque=function(T){const w=(255|T.rgba)>>>0;return[d,u,h]=g.toChannels(w),{css:b.toCss(d,u,h),rgba:w}},k.opacity=C,k.multiplyOpacity=function(T,w){return f=255&T.rgba,C(T,f*w/255)},k.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}}(y||(o.color=y={})),function(k){let C,T;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(C=E,C.globalCompositeOperation="copy",T=C.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),h=parseInt(w.slice(3,4).repeat(2),16),g.toColor(d,u,h);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),h=parseInt(w.slice(3,4).repeat(2),16),f=parseInt(w.slice(4,5).repeat(2),16),g.toColor(d,u,h,f);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return d=parseInt(E[1]),u=parseInt(E[2]),h=parseInt(E[3]),f=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),g.toColor(d,u,h,f);if(!C||!T)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=T,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[d,u,h,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(d,u,h,f),css:w}}}(m||(o.css=m={})),function(k){function C(T,w,E){const $=T/255,M=w/255,P=E/255;return .2126*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}k.relativeLuminance=function(T){return C(T>>16&255,T>>8&255,255&T)},k.relativeLuminance2=C}(p||(o.rgb=p={})),function(k){function C(w,E,$){const M=w>>24&255,P=w>>16&255,D=w>>8&255;let R=E>>24&255,O=E>>16&255,N=E>>8&255,I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));for(;I<$&&(R>0||O>0||N>0);)R-=Math.max(0,Math.ceil(.1*R)),O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));return(R<<24|O<<16|N<<8|255)>>>0}function T(w,E,$){const M=w>>24&255,P=w>>16&255,D=w>>8&255;let R=E>>24&255,O=E>>16&255,N=E>>8&255,I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));for(;I<$&&(R<255||O<255||N<255);)R=Math.min(255,R+Math.ceil(.1*(255-R))),O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));return(R<<24|O<<16|N<<8|255)>>>0}k.blend=function(w,E){if(f=(255&E)/255,f===1)return E;const $=E>>24&255,M=E>>16&255,P=E>>8&255,D=w>>24&255,R=w>>16&255,O=w>>8&255;return d=D+Math.round(($-D)*f),u=R+Math.round((M-R)*f),h=O+Math.round((P-O)*f),b.toRgba(d,u,h)},k.ensureContrastRatio=function(w,E,$){const M=p.relativeLuminance(w>>8),P=p.relativeLuminance(E>>8);if(S(M,P)<$){if(P<M){const O=C(w,E,$),N=S(M,p.relativeLuminance(O>>8));if(N<$){const I=T(w,E,$);return N>S(M,p.relativeLuminance(I>>8))?O:I}return O}const D=T(w,E,$),R=S(M,p.relativeLuminance(D>>8));if(R<$){const O=C(w,E,$);return R>S(M,p.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=C,k.increaseLuminance=T,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,E,$,M){return{css:b.toCss(w,E,$,M),rgba:b.toRgba(w,E,$,M)}}}(g||(o.rgba=g={})),o.toPaddedHex=_,o.contrastRatio=S},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const c=l(844),d=l(2585),u=l(4348),h=l(7866),f=l(744),b=l(7302),y=l(6975),m=l(8460),p=l(1753),g=l(1480),_=l(7994),S=l(9282),k=l(5435),C=l(5981),T=l(2660);let w=!1;class E extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event(M=>{var P;(P=this._onScrollApi)==null||P.fire(M.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(M){for(const P in M)this.optionsService.options[P]=M[P]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new b.OptionsService(M)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(h.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.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(P=>{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(P=>{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 C.WriteBuffer((P,D)=>this._inputHandler.parse(P,D))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,P){this._writeBuffer.write(M,P)}writeSync(M,P){this._logService.logLevel<=d.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(M,P)}resize(M,P){isNaN(M)||isNaN(P)||(M=Math.max(M,f.MINIMUM_COLS),P=Math.max(P,f.MINIMUM_ROWS),this._bufferService.resize(M,P))}scroll(M,P=!1){this._bufferService.scroll(M,P)}scrollLines(M,P,D){this._bufferService.scrollLines(M,P,D)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const P=M-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(M,P){return this._inputHandler.registerEscHandler(M,P)}registerDcsHandler(M,P){return this._inputHandler.registerDcsHandler(M,P)}registerCsiHandler(M,P){return this._inputHandler.registerCsiHandler(M,P)}registerOscHandler(M,P){return this._inputHandler.registerOscHandler(M,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?M=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const P of M)P.dispose()})}}}o.CoreTerminal=E},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},5435:function(a,o,l){var c=this&&this.__decorate||function(j,L,A,F){var H,B=arguments.length,G=B<3?L:F===null?F=Object.getOwnPropertyDescriptor(L,A):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(j,L,A,F);else for(var J=j.length-1;J>=0;J--)(H=j[J])&&(G=(B<3?H(G):B>3?H(L,A,G):H(L,A))||G);return B>3&&G&&Object.defineProperty(L,A,G),G},d=this&&this.__param||function(j,L){return function(A,F){L(A,F,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=l(2584),h=l(7116),f=l(2015),b=l(844),y=l(482),m=l(8437),p=l(8460),g=l(643),_=l(511),S=l(3734),k=l(2585),C=l(1480),T=l(6242),w=l(6351),E=l(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function P(j,L){if(j>24)return L.setWinLines||!1;switch(j){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var D;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(o.WindowsOptionsReportType=D={}));let R=0;class O extends b.Disposable{getAttrData(){return this._curAttrData}constructor(L,A,F,H,B,G,J,W,U=new f.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=A,this._coreService=F,this._logService=H,this._optionsService=B,this._oscLinkService=G,this._coreMouseService=J,this._unicodeService=W,this._parser=U,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(z=>this._activeBuffer=z.activeBuffer)),this._parser.setCsiHandlerFallback((z,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(z),params:V.toArray()})}),this._parser.setEscHandlerFallback(z=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(z)})}),this._parser.setExecuteHandlerFallback(z=>{this._logService.debug("Unknown EXECUTE code: ",{code:z})}),this._parser.setOscHandlerFallback((z,V,K)=>{this._logService.debug("Unknown OSC code: ",{identifier:z,action:V,data:K})}),this._parser.setDcsHandlerFallback((z,V,K)=>{V==="HOOK"&&(K=K.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(z),action:V,payload:K})}),this._parser.setPrintHandler((z,V,K)=>this.print(z,V,K)),this._parser.registerCsiHandler({final:"@"},z=>this.insertChars(z)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},z=>this.scrollLeft(z)),this._parser.registerCsiHandler({final:"A"},z=>this.cursorUp(z)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},z=>this.scrollRight(z)),this._parser.registerCsiHandler({final:"B"},z=>this.cursorDown(z)),this._parser.registerCsiHandler({final:"C"},z=>this.cursorForward(z)),this._parser.registerCsiHandler({final:"D"},z=>this.cursorBackward(z)),this._parser.registerCsiHandler({final:"E"},z=>this.cursorNextLine(z)),this._parser.registerCsiHandler({final:"F"},z=>this.cursorPrecedingLine(z)),this._parser.registerCsiHandler({final:"G"},z=>this.cursorCharAbsolute(z)),this._parser.registerCsiHandler({final:"H"},z=>this.cursorPosition(z)),this._parser.registerCsiHandler({final:"I"},z=>this.cursorForwardTab(z)),this._parser.registerCsiHandler({final:"J"},z=>this.eraseInDisplay(z,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},z=>this.eraseInDisplay(z,!0)),this._parser.registerCsiHandler({final:"K"},z=>this.eraseInLine(z,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},z=>this.eraseInLine(z,!0)),this._parser.registerCsiHandler({final:"L"},z=>this.insertLines(z)),this._parser.registerCsiHandler({final:"M"},z=>this.deleteLines(z)),this._parser.registerCsiHandler({final:"P"},z=>this.deleteChars(z)),this._parser.registerCsiHandler({final:"S"},z=>this.scrollUp(z)),this._parser.registerCsiHandler({final:"T"},z=>this.scrollDown(z)),this._parser.registerCsiHandler({final:"X"},z=>this.eraseChars(z)),this._parser.registerCsiHandler({final:"Z"},z=>this.cursorBackwardTab(z)),this._parser.registerCsiHandler({final:"`"},z=>this.charPosAbsolute(z)),this._parser.registerCsiHandler({final:"a"},z=>this.hPositionRelative(z)),this._parser.registerCsiHandler({final:"b"},z=>this.repeatPrecedingCharacter(z)),this._parser.registerCsiHandler({final:"c"},z=>this.sendDeviceAttributesPrimary(z)),this._parser.registerCsiHandler({prefix:">",final:"c"},z=>this.sendDeviceAttributesSecondary(z)),this._parser.registerCsiHandler({final:"d"},z=>this.linePosAbsolute(z)),this._parser.registerCsiHandler({final:"e"},z=>this.vPositionRelative(z)),this._parser.registerCsiHandler({final:"f"},z=>this.hVPosition(z)),this._parser.registerCsiHandler({final:"g"},z=>this.tabClear(z)),this._parser.registerCsiHandler({final:"h"},z=>this.setMode(z)),this._parser.registerCsiHandler({prefix:"?",final:"h"},z=>this.setModePrivate(z)),this._parser.registerCsiHandler({final:"l"},z=>this.resetMode(z)),this._parser.registerCsiHandler({prefix:"?",final:"l"},z=>this.resetModePrivate(z)),this._parser.registerCsiHandler({final:"m"},z=>this.charAttributes(z)),this._parser.registerCsiHandler({final:"n"},z=>this.deviceStatus(z)),this._parser.registerCsiHandler({prefix:"?",final:"n"},z=>this.deviceStatusPrivate(z)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},z=>this.softReset(z)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},z=>this.setCursorStyle(z)),this._parser.registerCsiHandler({final:"r"},z=>this.setScrollRegion(z)),this._parser.registerCsiHandler({final:"s"},z=>this.saveCursor(z)),this._parser.registerCsiHandler({final:"t"},z=>this.windowOptions(z)),this._parser.registerCsiHandler({final:"u"},z=>this.restoreCursor(z)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},z=>this.insertColumns(z)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},z=>this.deleteColumns(z)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},z=>this.selectProtected(z)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},z=>this.requestMode(z,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},z=>this.requestMode(z,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new T.OscHandler(z=>(this.setTitle(z),this.setIconName(z),!0))),this._parser.registerOscHandler(1,new T.OscHandler(z=>this.setIconName(z))),this._parser.registerOscHandler(2,new T.OscHandler(z=>this.setTitle(z))),this._parser.registerOscHandler(4,new T.OscHandler(z=>this.setOrReportIndexedColor(z))),this._parser.registerOscHandler(8,new T.OscHandler(z=>this.setHyperlink(z))),this._parser.registerOscHandler(10,new T.OscHandler(z=>this.setOrReportFgColor(z))),this._parser.registerOscHandler(11,new T.OscHandler(z=>this.setOrReportBgColor(z))),this._parser.registerOscHandler(12,new T.OscHandler(z=>this.setOrReportCursorColor(z))),this._parser.registerOscHandler(104,new T.OscHandler(z=>this.restoreIndexedColor(z))),this._parser.registerOscHandler(110,new T.OscHandler(z=>this.restoreFgColor(z))),this._parser.registerOscHandler(111,new T.OscHandler(z=>this.restoreBgColor(z))),this._parser.registerOscHandler(112,new T.OscHandler(z=>this.restoreCursorColor(z))),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 z in h.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:z},()=>this.selectCharset("("+z)),this._parser.registerEscHandler({intermediates:")",final:z},()=>this.selectCharset(")"+z)),this._parser.registerEscHandler({intermediates:"*",final:z},()=>this.selectCharset("*"+z)),this._parser.registerEscHandler({intermediates:"+",final:z},()=>this.selectCharset("+"+z)),this._parser.registerEscHandler({intermediates:"-",final:z},()=>this.selectCharset("-"+z)),this._parser.registerEscHandler({intermediates:".",final:z},()=>this.selectCharset("."+z)),this._parser.registerEscHandler({intermediates:"/",final:z},()=>this.selectCharset("/"+z));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(z=>(this._logService.error("Parsing error: ",z),z)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler((z,V)=>this.requestStatusString(z,V)))}_preserveStack(L,A,F,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=F,this._parseStack.position=H}_logSlowResolvingAsync(L){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([L,new Promise((A,F)=>setTimeout(()=>F("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,A){let F,H=this._activeBuffer.x,B=this._activeBuffer.y,G=0;const J=this._parseStack.paused;if(J){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(F),F;H=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>M&&(G=this._parseStack.position+M)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,z=>String.fromCharCode(z)).join("")}"`),typeof L=="string"?L.split("").map(z=>z.charCodeAt(0)):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(L.length,M))),J||this._dirtyRowTracker.clearRange(),L.length>M)for(let z=G;z<L.length;z+=M){const V=z+M<L.length?z+M:L.length,K=typeof L=="string"?this._stringDecoder.decode(L.substring(z,V),this._parseBuffer):this._utf8Decoder.decode(L.subarray(z,V),this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,K))return this._preserveStack(H,B,K,z),this._logSlowResolvingAsync(F),F}else if(!J){const z=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,z))return this._preserveStack(H,B,z,0),this._logSlowResolvingAsync(F),F}this._activeBuffer.x===H&&this._activeBuffer.y===B||this._onCursorMove.fire();const W=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),U=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);U<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(U,this._bufferService.rows-1),Math.min(W,this._bufferService.rows-1))}print(L,A,F){let H,B;const G=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,W=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,z=this._coreService.modes.insertMode,V=this._curAttrData;let K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&F-A>0&&K.getWidth(this._activeBuffer.x-1)===2&&K.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let q=this._parser.precedingJoinState;for(let X=A;X<F;++X){if(H=L[X],H<127&&G){const ye=G[String.fromCharCode(H)];ye&&(H=ye.charCodeAt(0))}const ie=this._unicodeService.charProperties(H,q);B=C.UnicodeService.extractWidth(ie);const re=C.UnicodeService.extractShouldJoin(ie),ce=re?C.UnicodeService.extractWidth(q):0;if(q=ie,J&&this._onA11yChar.fire((0,y.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+B-ce>W){if(U){const ye=K;let ae=this._activeBuffer.x-ce;for(this._activeBuffer.x=ce,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),K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ce>0&&K instanceof m.BufferLine&&K.copyCellsFrom(ye,ae,0,ce,!1);ae<W;)ye.setCellFromCodepoint(ae++,0,1,V)}else if(this._activeBuffer.x=W-1,B===2)continue}if(re&&this._activeBuffer.x){const ye=K.getWidth(this._activeBuffer.x-1)?1:2;K.addCodepointToCell(this._activeBuffer.x-ye,H,B);for(let ae=B-ce;--ae>=0;)K.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if(z&&(K.insertCells(this._activeBuffer.x,B-ce,this._activeBuffer.getNullCell(V)),K.getWidth(W-1)===2&&K.setCellFromCodepoint(W-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,V)),K.setCellFromCodepoint(this._activeBuffer.x++,H,B,V),B>0)for(;--B;)K.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=q,this._activeBuffer.x<W&&F-A>0&&K.getWidth(this._activeBuffer.x)===0&&!K.hasContent(this._activeBuffer.x)&&K.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,A){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,A):this._parser.registerCsiHandler(L,F=>!P(F.params[0],this._optionsService.rawOptions.windowOptions)||A(F))}registerDcsHandler(L,A){return this._parser.registerDcsHandler(L,new w.DcsHandler(A))}registerEscHandler(L,A){return this._parser.registerEscHandler(L,A)}registerOscHandler(L,A){return this._parser.registerOscHandler(L,new T.OscHandler(A))}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(){var L;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&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,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(L,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=L,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+A)}cursorUp(L){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const A=L.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=L.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const A=L.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,A,F,H=!1,B=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);G.replaceCells(A,F,this._activeBuffer.getNullCell(this._eraseAttrData()),B),H&&(G.isWrapped=!1)}_resetBufferLine(L,A=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),F.isWrapped=!1)}eraseInDisplay(L,A=!1){let F;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);F<this._bufferService.rows;F++)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(F);break;case 1:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(L,A=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;A--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let A=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;A--;)this._activeBuffer.lines.splice(F,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let A=L.params[0]||1;for(;A--;)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(L){let A=L.params[0]||1;for(;A--;)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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=L.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const A=this._parser.precedingJoinState;if(!A)return!0;const F=L.params[0]||1,H=C.UnicodeService.extractWidth(A),B=this._activeBuffer.x-H,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(B),J=new Uint32Array(G.length*F);let W=0;for(let z=0;z<G.length;){const V=G.codePointAt(z)||0;J[W++]=V,z+=V>65535?2:1}let U=W;for(let z=1;z<F;++z)J.copyWithin(U,0,W),U+=W;return this.print(J,0,U),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),this._charsetService.setgCharset(1,h.DEFAULT_CHARSET),this._charsetService.setgCharset(2,h.DEFAULT_CHARSET),this._charsetService.setgCharset(3,h.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(L){for(let A=0;A<L.length;A++)switch(L.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let A=0;A<L.length;A++)switch(L.params[A]){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(),L.params[A]===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(L,A){const F=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:B}=this._coreMouseService,G=this._coreService,{buffers:J,cols:W}=this._bufferService,{active:U,alt:z}=J,V=this._optionsService.rawOptions,K=re=>re?1:2,q=L.params[0];return X=q,ie=A?q===2?4:q===4?K(G.modes.insertMode):q===12?3:q===20?K(V.convertEol):0:q===1?K(F.applicationCursorKeys):q===3?V.windowOptions.setWinLines?W===80?2:W===132?1:0:0:q===6?K(F.origin):q===7?K(F.wraparound):q===8?3:q===9?K(H==="X10"):q===12?K(V.cursorBlink):q===25?K(!G.isCursorHidden):q===45?K(F.reverseWraparound):q===66?K(F.applicationKeypad):q===67?4:q===1e3?K(H==="VT200"):q===1002?K(H==="DRAG"):q===1003?K(H==="ANY"):q===1004?K(F.sendFocus):q===1005?4:q===1006?K(B==="SGR"):q===1015?4:q===1016?K(B==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?K(U===z):q===2004?K(F.bracketedPasteMode):0,G.triggerDataEvent(`${u.C0.ESC}[${A?"":"?"}${X};${ie}$y`),!0;var X,ie}_updateAttrColor(L,A,F,H,B){return A===2?(L|=50331648,L&=-16777216,L|=S.AttributeData.fromColorRGB([F,H,B])):A===5&&(L&=-50331904,L|=33554432|255&F),L}_extractColor(L,A,F){const H=[0,0,-1,0,0,0];let B=0,G=0;do{if(H[G+B]=L.params[A+G],L.hasSubParams(A+G)){const J=L.getSubParams(A+G);let W=0;do H[1]===5&&(B=1),H[G+W+1+B]=J[W];while(++W<J.length&&W+G+1+B<H.length);break}if(H[1]===5&&G+B>=2||H[1]===2&&G+B>=5)break;H[1]&&(B=1)}while(++G+A<L.length&&G+B<H.length);for(let J=2;J<H.length;++J)H[J]===-1&&(H[J]=0);switch(H[0]){case 38:F.fg=this._updateAttrColor(F.fg,H[1],H[3],H[4],H[5]);break;case 48:F.bg=this._updateAttrColor(F.bg,H[1],H[3],H[4],H[5]);break;case 58:F.extended=F.extended.clone(),F.extended.underlineColor=this._updateAttrColor(F.extended.underlineColor,H[1],H[3],H[4],H[5])}return G}_processUnderline(L,A){A.extended=A.extended.clone(),(!~L||L>5)&&(L=1),A.extended.underlineStyle=L,A.fg|=268435456,L===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(L){L.fg=m.DEFAULT_ATTR_DATA.fg,L.bg=m.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=L.length;let F;const H=this._curAttrData;for(let B=0;B<A;B++)F=L.params[B],F>=30&&F<=37?(H.fg&=-50331904,H.fg|=16777216|F-30):F>=40&&F<=47?(H.bg&=-50331904,H.bg|=16777216|F-40):F>=90&&F<=97?(H.fg&=-50331904,H.fg|=16777224|F-90):F>=100&&F<=107?(H.bg&=-50331904,H.bg|=16777224|F-100):F===0?this._processSGR0(H):F===1?H.fg|=134217728:F===3?H.bg|=67108864:F===4?(H.fg|=268435456,this._processUnderline(L.hasSubParams(B)?L.getSubParams(B)[0]:1,H)):F===5?H.fg|=536870912:F===7?H.fg|=67108864:F===8?H.fg|=1073741824:F===9?H.fg|=2147483648:F===2?H.bg|=134217728:F===21?this._processUnderline(2,H):F===22?(H.fg&=-134217729,H.bg&=-134217729):F===23?H.bg&=-67108865:F===24?(H.fg&=-268435457,this._processUnderline(0,H)):F===25?H.fg&=-536870913:F===27?H.fg&=-67108865:F===28?H.fg&=-1073741825:F===29?H.fg&=2147483647:F===39?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):F===49?(H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?B+=this._extractColor(L,B,H):F===53?H.bg|=1073741824:F===55?H.bg&=-1073741825:F===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):F===100?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${A};${F}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const A=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${A};${F}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.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(L){const A=L.params[0]||1;switch(A){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 F=A%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(L){const A=L.params[0]||1;let F;return(L.length<2||(F=L.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(L){if(!P(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){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(L){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(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const A=[],F=L.split(";");for(;F.length>1;){const H=F.shift(),B=F.shift();if(/^\d+$/.exec(H)){const G=parseInt(H);if(I(G))if(B==="?")A.push({type:0,index:G});else{const J=(0,E.parseColor)(B);J&&A.push({type:1,index:G,color:J})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(L){const A=L.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(L,A){this._getCurrentLinkId()&&this._finishHyperlink();const F=L.split(":");let H;const B=F.findIndex(G=>G.startsWith("id="));return B!==-1&&(H=F[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,A){const F=L.split(";");for(let H=0;H<F.length&&!(A>=this._specialColors.length);++H,++A)if(F[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const B=(0,E.parseColor)(F[H]);B&&this._onColor.fire([{type:1,index:this._specialColors[A],color:B}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const A=[],F=L.split(";");for(let H=0;H<F.length;++H)if(/^\d+$/.exec(F[H])){const B=parseInt(F[H]);I(B)&&A.push({type:2,index:B})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){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,h.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset($[L[0]],h.CHARSETS[L[1]]||h.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 L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new _.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const F=this._activeBuffer.ybase+this._activeBuffer.y+A,H=this._activeBuffer.lines.get(F);H&&(H.fill(L),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,A){const F=this._bufferService.buffer,H=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${B}${u.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,A){this._dirtyRowTracker.markRangeDirty(L,A)}}o.InputHandler=O;let N=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,L){j>L&&(R=j,j=L,L=R),j<this.start&&(this.start=j),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function I(j){return 0<=j&&j<256}N=c([d(0,k.IBufferService)],N)},844:(a,o)=>{function l(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(d,u,h){this._data[d]||(this._data[d]={}),this._data[d][u]=h}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,d,u,h,f){this._data.get(c,d)||this._data.set(c,d,new l),this._data.get(c,d).set(u,h,f)}get(c,d,u,h){var f;return(f=this._data.get(c,d))==null?void 0:f.get(u,h)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u";const l=o.isNode?"node":navigator.userAgent,c=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const d=l.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const d=this._getKey(c);if(d===void 0||(l=this._search(d),l===-1)||this._getKey(this._array[l])!==d)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===d);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,d){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do d(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let d=0,u=this._array.length-1;for(;u>=d;){let h=d+u>>1;const f=this._getKey(this._array[h]);if(f>c)u=h-1;else{if(!(f<c)){for(;h>0&&this._getKey(this._array[h-1])===c;)h--;return h}d=h+1}}return d}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let b=0,y=0,m=f.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),y=Math.max(b,y),p=f.timeRemaining(),1.5*y>p)return m-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-b))}ms`),void this._start();m=p}this.clear()}}class u extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const b=Date.now()+f;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const c=l(643);o.updateWindowsModeWrappedState=function(d){const u=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),h=u==null?void 0:u.get(d.cols-1),f=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);f&&h&&(f.isWrapped=h[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&h[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,h=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=h}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const c=l(6349),d=l(7226),u=l(3734),h=l(8437),f=l(4634),b=l(511),y=l(643),m=l(4863),p=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(g,_,S){this._hasScrollback=g,this._optionsService=_,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=h.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,_){return new h.BufferLine(this._bufferService.cols,this.getNullCell(g),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const _=g+this._optionsService.rawOptions.scrollback;return _>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:_}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=h.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,_){const S=this.getNullCell(h.DEFAULT_ATTR_DATA);let k=0;const C=this._getCorrectBufferLength(_);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<g)for(let w=0;w<this.lines.length;w++)k+=+this.lines.get(w).resize(g,S);let T=0;if(this._rows<_)for(let w=this._rows;w<_;w++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new h.BufferLine(g,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new h.BufferLine(g,S)));else for(let w=this._rows;w>_;w--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const w=this.lines.length-C;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=C}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,_-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(g,_),this._cols>g))for(let T=0;T<this.lines.length;T++)k+=+this.lines.get(T).resize(g,S);this._cols=g,this._rows=_,this._memoryCleanupQueue.clear(),k>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,_){this._cols!==g&&(g>this._cols?this._reflowLarger(g,_):this._reflowSmaller(g,_))}_reflowLarger(g,_){const S=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,f.reflowLargerCreateNewLayout)(this.lines,S);(0,f.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(g,_,k.countRemoved)}}_reflowLargerAdjustViewport(g,_,S){const k=this.getNullCell(h.DEFAULT_ATTR_DATA);let C=S;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new h.BufferLine(g,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(g,_){const S=this.getNullCell(h.DEFAULT_ATTR_DATA),k=[];let C=0;for(let T=this.lines.length-1;T>=0;T--){let w=this.lines.get(T);if(!w||!w.isWrapped&&w.getTrimmedLength()<=g)continue;const E=[w];for(;w.isWrapped&&T>0;)w=this.lines.get(--T),E.unshift(w);const $=this.ybase+this.y;if($>=T&&$<T+E.length)continue;const M=E[E.length-1].getTrimmedLength(),P=(0,f.reflowSmallerGetNewLineLengths)(E,this._cols,g),D=P.length-E.length;let R;R=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const O=[];for(let F=0;F<D;F++){const H=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);O.push(H)}O.length>0&&(k.push({start:T+E.length+C,newLines:O}),C+=O.length),E.push(...O);let N=P.length-1,I=P[N];I===0&&(N--,I=P[N]);let j=E.length-D-1,L=M;for(;j>=0;){const F=Math.min(L,I);if(E[N]===void 0)break;if(E[N].copyCellsFrom(E[j],L-F,I-F,F,!0),I-=F,I===0&&(N--,I=P[N]),L-=F,L===0){j--;const H=Math.max(j,0);L=(0,f.getWrappedLineTrimmedLength)(E,H,this._cols)}}for(let F=0;F<E.length;F++)P[F]<g&&E[F].setCell(P[F],S);let A=D-R;for(;A-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+_-1)}if(k.length>0){const T=[],w=[];for(let N=0;N<this.lines.length;N++)w.push(this.lines.get(N));const E=this.lines.length;let $=E-1,M=0,P=k[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let D=0;for(let N=Math.min(this.lines.maxLength-1,E+C-1);N>=0;N--)if(P&&P.start>$+D){for(let I=P.newLines.length-1;I>=0;I--)this.lines.set(N--,P.newLines[I]);N++,T.push({index:$+1,amount:P.newLines.length}),D+=P.newLines.length,P=k[++M]}else this.lines.set(N,w[$--]);let R=0;for(let N=T.length-1;N>=0;N--)T[N].index+=R,this.lines.onInsertEmitter.fire(T[N]),R+=T[N].amount;const O=Math.max(0,E+C-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(g,_,S=0,k){const C=this.lines.get(g);return C?C.translateToString(_,S,k):""}getWrappedRangeForLine(g){let _=g,S=g;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:_,last:S}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===g&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const _=new m.Marker(g);return this.markers.push(_),_.register(this.lines.onTrim(S=>{_.line-=S,_.line<0&&_.dispose()})),_.register(this.lines.onInsert(S=>{_.line>=S.index&&(_.line+=S.amount)})),_.register(this.lines.onDelete(S=>{_.line>=S.index&&_.line<S.index+S.amount&&_.dispose(),_.line>S.index&&(_.line-=S.amount)})),_.register(_.onDispose(()=>this._removeMarker(_))),_}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const c=l(3734),d=l(511),u=l(643),h=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let f=0;class b{constructor(m,p,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const _=p||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let S=0;S<m;++S)this.setCell(S,_);this.length=m}get(m){const p=this._data[3*m+0],g=2097151&p;return[this._data[3*m+1],2097152&p?this._combined[m]:g?(0,h.stringFromCodePoint)(g):"",p>>22,2097152&p?this._combined[m].charCodeAt(this._combined[m].length-1):g]}set(m,p){this._data[3*m+1]=p[u.CHAR_DATA_ATTR_INDEX],p[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=p[1],this._data[3*m+0]=2097152|m|p[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=p[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const p=this._data[3*m+0];return 2097152&p?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&p}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const p=this._data[3*m+0];return 2097152&p?this._combined[m]:2097151&p?(0,h.stringFromCodePoint)(2097151&p):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,p){return f=3*m,p.content=this._data[f+0],p.fg=this._data[f+1],p.bg=this._data[f+2],2097152&p.content&&(p.combinedData=this._combined[m]),268435456&p.bg&&(p.extended=this._extendedAttrs[m]),p}setCell(m,p){2097152&p.content&&(this._combined[m]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[m]=p.extended),this._data[3*m+0]=p.content,this._data[3*m+1]=p.fg,this._data[3*m+2]=p.bg}setCellFromCodepoint(m,p,g,_){268435456&_.bg&&(this._extendedAttrs[m]=_.extended),this._data[3*m+0]=p|g<<22,this._data[3*m+1]=_.fg,this._data[3*m+2]=_.bg}addCodepointToCell(m,p,g){let _=this._data[3*m+0];2097152&_?this._combined[m]+=(0,h.stringFromCodePoint)(p):2097151&_?(this._combined[m]=(0,h.stringFromCodePoint)(2097151&_)+(0,h.stringFromCodePoint)(p),_&=-2097152,_|=2097152):_=p|4194304,g&&(_&=-12582913,_|=g<<22),this._data[3*m+0]=_}insertCells(m,p,g){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,g),p<this.length-m){const _=new d.CellData;for(let S=this.length-m-p-1;S>=0;--S)this.setCell(m+p+S,this.loadCell(m+S,_));for(let S=0;S<p;++S)this.setCell(m+S,g)}else for(let _=m;_<this.length;++_)this.setCell(_,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(m,p,g){if(m%=this.length,p<this.length-m){const _=new d.CellData;for(let S=0;S<this.length-m-p;++S)this.setCell(m+S,this.loadCell(m+p+S,_));for(let S=this.length-p;S<this.length;++S)this.setCell(S,g)}else for(let _=m;_<this.length;++_)this.setCell(_,g);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,g),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,g)}replaceCells(m,p,g,_=!1){if(_)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,g),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,g);m<p&&m<this.length;)this.isProtected(m)||this.setCell(m,g),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,g),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,g);m<p&&m<this.length;)this.setCell(m++,g)}resize(m,p){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const _=new Uint32Array(g);_.set(this._data),this._data=_}for(let _=this.length;_<m;++_)this.setCell(_,p)}else{this._data=this._data.subarray(0,g);const _=Object.keys(this._combined);for(let k=0;k<_.length;k++){const C=parseInt(_[k],10);C>=m&&delete this._combined[C]}const S=Object.keys(this._extendedAttrs);for(let k=0;k<S.length;k++){const C=parseInt(S[k],10);C>=m&&delete this._extendedAttrs[C]}}return this.length=m,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,p=!1){if(p)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,m);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const p in m._combined)this._combined[p]=m._combined[p];this._extendedAttrs={};for(const p in m._extendedAttrs)this._extendedAttrs[p]=m._extendedAttrs[p];this.isWrapped=m.isWrapped}clone(){const m=new b(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const p in this._combined)m._combined[p]=this._combined[p];for(const p in this._extendedAttrs)m._extendedAttrs[p]=this._extendedAttrs[p];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,p,g,_,S){const k=m._data;if(S)for(let T=_-1;T>=0;T--){for(let w=0;w<3;w++)this._data[3*(g+T)+w]=k[3*(p+T)+w];268435456&k[3*(p+T)+2]&&(this._extendedAttrs[g+T]=m._extendedAttrs[p+T])}else for(let T=0;T<_;T++){for(let w=0;w<3;w++)this._data[3*(g+T)+w]=k[3*(p+T)+w];268435456&k[3*(p+T)+2]&&(this._extendedAttrs[g+T]=m._extendedAttrs[p+T])}const C=Object.keys(m._combined);for(let T=0;T<C.length;T++){const w=parseInt(C[T],10);w>=p&&(this._combined[w-p+g]=m._combined[w])}}translateToString(m,p,g,_){p=p??0,g=g??this.length,m&&(g=Math.min(g,this.getTrimmedLength())),_&&(_.length=0);let S="";for(;p<g;){const k=this._data[3*p+0],C=2097151&k,T=2097152&k?this._combined[p]:C?(0,h.stringFromCodePoint)(C):u.WHITESPACE_CELL_CHAR;if(S+=T,_)for(let w=0;w<T.length;++w)_.push(p);p+=k>>22||1}return _&&_.push(p),S}}o.BufferLine=b},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,o)=>{function l(c,d,u){if(d===c.length-1)return c[d].getTrimmedLength();const h=!c[d].hasContent(u-1)&&c[d].getWidth(u-1)===1,f=c[d+1].getWidth(0)===2;return h&&f?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(c,d,u,h,f){const b=[];for(let y=0;y<c.length-1;y++){let m=y,p=c.get(++m);if(!p.isWrapped)continue;const g=[c.get(y)];for(;m<c.length&&p.isWrapped;)g.push(p),p=c.get(++m);if(h>=y&&h<m){y+=g.length-1;continue}let _=0,S=l(g,_,d),k=1,C=0;for(;k<g.length;){const w=l(g,k,d),E=w-C,$=u-S,M=Math.min(E,$);g[_].copyCellsFrom(g[k],C,S,M,!1),S+=M,S===u&&(_++,S=0),C+=M,C===w&&(k++,C=0),S===0&&_!==0&&g[_-1].getWidth(u-1)===2&&(g[_].copyCellsFrom(g[_-1],u-1,S++,1,!1),g[_-1].setCell(u-1,f))}g[_].replaceCells(S,u,f);let T=0;for(let w=g.length-1;w>0&&(w>_||g[w].getTrimmedLength()===0);w--)T++;T>0&&(b.push(y+g.length-T),b.push(T)),y+=g.length-1}return b},o.reflowLargerCreateNewLayout=function(c,d){const u=[];let h=0,f=d[h],b=0;for(let y=0;y<c.length;y++)if(f===y){const m=d[++h];c.onDeleteEmitter.fire({index:y-b,amount:m}),y+=m-1,b+=m,f=d[++h]}else u.push(y);return{layout:u,countRemoved:b}},o.reflowLargerApplyNewLayout=function(c,d){const u=[];for(let h=0;h<d.length;h++)u.push(c.get(d[h]));for(let h=0;h<u.length;h++)c.set(h,u[h]);c.length=d.length},o.reflowSmallerGetNewLineLengths=function(c,d,u){const h=[],f=c.map((p,g)=>l(c,g,d)).reduce((p,g)=>p+g);let b=0,y=0,m=0;for(;m<f;){if(f-m<u){h.push(f-m);break}b+=u;const p=l(c,y,d);b>p&&(b-=p,y++);const g=c[y].getWidth(b-1)===2;g&&b--;const _=g?u-1:u;h.push(_),m+=_}return h},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const c=l(8460),d=l(844),u=l(9092);class h extends d.Disposable{constructor(b,y){super(),this._optionsService=b,this._bufferService=y,this._onBufferActivate=this.register(new c.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),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(b,y){this._normal.resize(b,y),this._alt.resize(b,y),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}o.BufferSet=h},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(482),d=l(643),u=l(3734);class h extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const y=new h;return y.setFromCharData(b),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(b[d.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(b[d.CHAR_DATA_CHAR_INDEX].length===2){const m=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const p=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(m-55296)+p-56320+65536|b[d.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=b[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=h},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const c=l(8460),d=l(844);class u{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}o.Marker=u,u._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,c,d;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT="	",u.LF=`
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(l||(o.C0=l={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(c||(o.C1=c={})),function(u){u.ST=`${l.ESC}\\`}(d||(o.C1_ESCAPED=d={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const c=l(2584),d={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:["'",'"']};o.evaluateKeyboardEvent=function(u,h,f,b){const y={type:0,cancel:!1,key:void 0},m=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?y.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?y.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?y.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(y.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(u.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,u.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(u.metaKey)break;m?(y.key=c.C0.ESC+"[1;"+(m+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(f?"b":"[1;5D"))):y.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;m?(y.key=c.C0.ESC+"[1;"+(m+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(f?"f":"[1;5C"))):y.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;m?(y.key=c.C0.ESC+"[1;"+(m+1)+"A",f||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;m?(y.key=c.C0.ESC+"[1;"+(m+1)+"B",f||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=m?c.C0.ESC+"[3;"+(m+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=m?c.C0.ESC+"[1;"+(m+1)+"H":h?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=m?c.C0.ESC+"[1;"+(m+1)+"F":h?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?y.type=2:u.ctrlKey?y.key=c.C0.ESC+"[5;"+(m+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?y.type=3:u.ctrlKey?y.key=c.C0.ESC+"[6;"+(m+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=m?c.C0.ESC+"[1;"+(m+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=m?c.C0.ESC+"[1;"+(m+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=m?c.C0.ESC+"[1;"+(m+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=m?c.C0.ESC+"[1;"+(m+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=m?c.C0.ESC+"[15;"+(m+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=m?c.C0.ESC+"[17;"+(m+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=m?c.C0.ESC+"[18;"+(m+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=m?c.C0.ESC+"[19;"+(m+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=m?c.C0.ESC+"[20;"+(m+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=m?c.C0.ESC+"[21;"+(m+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=m?c.C0.ESC+"[23;"+(m+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=m?c.C0.ESC+"[24;"+(m+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(f&&!b||!u.altKey||u.metaKey)!f||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?y.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(y.key=c.C0.US),u.key==="@"&&(y.key=c.C0.NUL)):u.keyCode===65&&(y.type=1);else{const p=d[u.keyCode],g=p==null?void 0:p[u.shiftKey?1:0];if(g)y.key=c.C0.ESC+g;else if(u.keyCode>=65&&u.keyCode<=90){const _=u.ctrlKey?u.keyCode-64:u.keyCode+32;let S=String.fromCharCode(_);u.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(u.keyCode===32)y.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let _=u.code.slice(3,4);u.shiftKey||(_=_.toLowerCase()),y.key=c.C0.ESC+_,y.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?y.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?y.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?y.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?y.key=c.C0.DEL:u.keyCode===219?y.key=c.C0.ESC:u.keyCode===220?y.key=c.C0.FS:u.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,c=0,d=l.length){let u="";for(let h=c;h<d;++h){let f=l[h];f>65535?(f-=65536,u+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):u+=String.fromCharCode(f)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const d=l.length;if(!d)return 0;let u=0,h=0;if(this._interim){const f=l.charCodeAt(h++);56320<=f&&f<=57343?c[u++]=1024*(this._interim-55296)+f-56320+65536:(c[u++]=this._interim,c[u++]=f),this._interim=0}for(let f=h;f<d;++f){const b=l.charCodeAt(f);if(55296<=b&&b<=56319){if(++f>=d)return this._interim=b,u;const y=l.charCodeAt(f);56320<=y&&y<=57343?c[u++]=1024*(b-55296)+y-56320+65536:(c[u++]=b,c[u++]=y)}else b!==65279&&(c[u++]=b)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const d=l.length;if(!d)return 0;let u,h,f,b,y=0,m=0,p=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let C,T=0;for(;(C=63&this.interim[++T])&&T<4;)k<<=6,k|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-T;for(;p<E;){if(p>=d)return 0;if(C=l[p++],(192&C)!=128){p--,S=!0;break}this.interim[T++]=C,k<<=6,k|=63&C}S||(w===2?k<128?p--:c[y++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const g=d-4;let _=p;for(;_<d;){for(;!(!(_<g)||128&(u=l[_])||128&(h=l[_+1])||128&(f=l[_+2])||128&(b=l[_+3]));)c[y++]=u,c[y++]=h,c[y++]=f,c[y++]=b,_+=4;if(u=l[_++],u<128)c[y++]=u;else if((224&u)==192){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(m=(31&u)<<6|63&h,m<128){_--;continue}c[y++]=m}else if((240&u)==224){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,y;if(f=l[_++],(192&f)!=128){_--;continue}if(m=(15&u)<<12|(63&h)<<6|63&f,m<2048||m>=55296&&m<=57343||m===65279)continue;c[y++]=m}else if((248&u)==240){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,y;if(f=l[_++],(192&f)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,this.interim[2]=f,y;if(b=l[_++],(192&b)!=128){_--;continue}if(m=(7&u)<<18|(63&h)<<12|(63&f)<<6|63&b,m<65536||m>1114111)continue;c[y++]=m}}return y}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const c=l(1480),d=[[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]],u=[[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 h;o.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let f=0;f<d.length;++f)h.fill(0,d[f][0],d[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?h[f]:function(b,y){let m,p=0,g=y.length-1;if(b<y[0][0]||b>y[g][1])return!1;for(;g>=p;)if(m=p+g>>1,b>y[m][1])p=m+1;else{if(!(b<y[m][0]))return!0;g=m-1}return!1}(f,u)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,b){let y=this.wcwidth(f),m=y===0&&b!==0;if(m){const p=c.UnicodeService.extractWidth(b);p===0?m=!1:p>y&&(y=p)}return c.UnicodeService.createPropertyValue(0,y,m)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const c=l(8460),d=l(844);class u extends d.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,b){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+=f.length,this._writeBuffer.push(f),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(b)}_innerWrite(f=0,b=!0){const y=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],p=this._action(m,b);if(p){const _=S=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,S)):this._innerWrite(y,S);return void p.catch(S=>(queueMicrotask(()=>{throw S}),Promise.resolve(!1))).then(_)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-y>=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()}}o.WriteBuffer=u},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function d(u,h){const f=u.toString(16),b=f.length<2?"0"+f:f;switch(h){case 4:return f[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}o.parseColor=function(u){if(!u)return;let h=u.toLowerCase();if(h.indexOf("rgb:")===0){h=h.slice(4);const f=l.exec(h);if(f){const b=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/b*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/b*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/b*255)]}}else if(h.indexOf("#")===0&&(h=h.slice(1),c.exec(h)&&[3,6,9,12].includes(h.length))){const f=h.length/3,b=[0,0,0];for(let y=0;y<3;++y){const m=parseInt(h.slice(f*y,f*y+f),16);b[y]=f===1?m<<4:f===2?m:f===3?m>>4:m>>8}return b}},o.toRgbString=function(u,h=16){const[f,b,y]=u;return`rgb:${d(f,h)}/${d(b,h)}/${d(y,h)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const c=l(482),d=l(8742),u=l(5770),h=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=h,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}registerHandler(b,y){this._handlers[b]===void 0&&(this._handlers[b]=[]);const m=this._handlers[b];return m.push(y),{dispose:()=>{const p=m.indexOf(y);p!==-1&&m.splice(p,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=h,this._ident=0}hook(b,y){if(this.reset(),this._ident=b,this._active=this._handlers[b]||h,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(b,y,m){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(b,y,m);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(b,y,m))}unhook(b,y=!0){if(this._active.length){let m=!1,p=this._active.length-1,g=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,m=y,g=this._stack.fallThrough,this._stack.paused=!1),!g&&m===!1){for(;p>=0&&(m=this._active[p].unhook(b),m!==!0);p--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,m;p--}for(;p>=0;p--)if(m=this._active[p].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",b);this._active=h,this._ident=0}};const f=new d.Params;f.addParam(0),o.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=f,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():f,this._data="",this._hitLimit=!1}put(b,y,m){this._hitLimit||(this._data+=(0,c.utf32ToString)(b,y,m),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let y=!1;if(this._hitLimit)y=!1;else if(b&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(m=>(this._params=f,this._data="",this._hitLimit=!1,m));return this._params=f,this._data="",this._hitLimit=!1,y}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const c=l(844),d=l(8742),u=l(6242),h=l(6351);class f{constructor(p){this.table=new Uint8Array(p)}setDefault(p,g){this.table.fill(p<<4|g)}add(p,g,_,S){this.table[g<<8|p]=_<<4|S}addMany(p,g,_,S){for(let k=0;k<p.length;k++)this.table[g<<8|p[k]]=_<<4|S}}o.TransitionTable=f;const b=160;o.VT500_TRANSITION_TABLE=function(){const m=new f(4095),p=Array.apply(null,Array(256)).map((T,w)=>w),g=(T,w)=>p.slice(T,w),_=g(32,127),S=g(0,24);S.push(25),S.push.apply(S,g(28,32));const k=g(0,14);let C;for(C in m.setDefault(1,0),m.addMany(_,0,2,0),k)m.addMany([24,26,153,154],C,3,0),m.addMany(g(128,144),C,3,0),m.addMany(g(144,152),C,3,0),m.add(156,C,0,0),m.add(27,C,11,1),m.add(157,C,4,8),m.addMany([152,158,159],C,0,7),m.add(155,C,11,3),m.add(144,C,11,9);return m.addMany(S,0,3,0),m.addMany(S,1,3,1),m.add(127,1,0,1),m.addMany(S,8,0,8),m.addMany(S,3,3,3),m.add(127,3,0,3),m.addMany(S,4,3,4),m.add(127,4,0,4),m.addMany(S,6,3,6),m.addMany(S,5,3,5),m.add(127,5,0,5),m.addMany(S,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(_,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(g(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(_,7,0,7),m.addMany(S,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(g(64,127),3,7,0),m.addMany(g(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(g(48,60),4,8,4),m.addMany(g(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(g(32,64),6,0,6),m.add(127,6,0,6),m.addMany(g(64,127),6,0,0),m.addMany(g(32,48),3,9,5),m.addMany(g(32,48),5,9,5),m.addMany(g(48,64),5,0,6),m.addMany(g(64,127),5,7,0),m.addMany(g(32,48),4,9,5),m.addMany(g(32,48),1,9,2),m.addMany(g(32,48),2,9,2),m.addMany(g(48,127),2,10,0),m.addMany(g(48,80),1,10,0),m.addMany(g(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(g(96,127),1,10,0),m.add(80,1,11,9),m.addMany(S,9,0,9),m.add(127,9,0,9),m.addMany(g(28,32),9,0,9),m.addMany(g(32,48),9,9,12),m.addMany(g(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(S,11,0,11),m.addMany(g(32,128),11,0,11),m.addMany(g(28,32),11,0,11),m.addMany(S,10,0,10),m.add(127,10,0,10),m.addMany(g(28,32),10,0,10),m.addMany(g(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(g(32,48),10,9,12),m.addMany(S,12,0,12),m.add(127,12,0,12),m.addMany(g(28,32),12,0,12),m.addMany(g(32,48),12,9,12),m.addMany(g(48,64),12,0,11),m.addMany(g(64,127),12,12,13),m.addMany(g(64,127),10,12,13),m.addMany(g(64,127),9,12,13),m.addMany(S,13,13,13),m.addMany(_,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(b,0,2,0),m.add(b,8,5,8),m.add(b,6,0,6),m.add(b,11,0,11),m.add(b,13,13,13),m}();class y extends c.Disposable{constructor(p=o.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,_,S)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,_)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new h.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,g=[64,126]){let _=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=p.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<p.intermediates.length;++k){const C=p.intermediates.charCodeAt(k);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=C}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(g[0]>S||S>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return _<<=8,_|=S,_}identToString(p){const g=[];for(;p;)g.push(String.fromCharCode(255&p)),p>>=8;return g.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,g){const _=this._identifier(p,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const S=this._escHandlers[_];return S.push(g),{dispose:()=>{const k=S.indexOf(g);k!==-1&&S.splice(k,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,g){this._executeHandlers[p.charCodeAt(0)]=g}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,g){const _=this._identifier(p);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const S=this._csiHandlers[_];return S.push(g),{dispose:()=>{const k=S.indexOf(g);k!==-1&&S.splice(k,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,g){return this._dcsParser.registerHandler(this._identifier(p),g)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,g){return this._oscParser.registerHandler(p,g)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,g,_,S,k){this._parseStack.state=p,this._parseStack.handlers=g,this._parseStack.handlerPos=_,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(p,g,_){let S,k=0,C=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&E>-1){for(;E>=0&&(S=w[E](this._params),S!==!0);E--)if(S instanceof Promise)return this._parseStack.handlerPos=E,S}this._parseStack.handlers=[];break;case 4:if(_===!1&&E>-1){for(;E>=0&&(S=w[E](),S!==!0);E--)if(S instanceof Promise)return this._parseStack.handlerPos=E,S}this._parseStack.handlers=[];break;case 6:if(k=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=p[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=T;w<g;++w){switch(k=p[w],C=this._transitions.table[this.currentState<<8|(k<160?k:b)],C>>4){case 2:for(let D=w+1;;++D){if(D>=g||(k=p[D])<32||k>126&&k<b){this._printHandler(p,w,D),w=D-1;break}if(++D>=g||(k=p[D])<32||k>126&&k<b){this._printHandler(p,w,D),w=D-1;break}if(++D>=g||(k=p[D])<32||k>126&&k<b){this._printHandler(p,w,D),w=D-1;break}if(++D>=g||(k=p[D])<32||k>126&&k<b){this._printHandler(p,w,D),w=D-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|k];let $=E?E.length-1:-1;for(;$>=0&&(S=E[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,E,$,C,w),S;$<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++w<g&&(k=p[w])>47&&k<60);w--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const M=this._escHandlers[this._collect<<8|k];let P=M?M.length-1:-1;for(;P>=0&&(S=M[P](),S!==!0);P--)if(S instanceof Promise)return this._preserveStack(4,M,P,C,w),S;P<0&&this._escHandlerFb(this._collect<<8|k),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|k,this._params);break;case 13:for(let D=w+1;;++D)if(D>=g||(k=p[D])===24||k===26||k===27||k>127&&k<b){this._dcsParser.put(p,w,D),w=D-1;break}break;case 14:if(S=this._dcsParser.unhook(k!==24&&k!==26),S)return this._preserveStack(6,[],0,C,w),S;k===27&&(C|=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 D=w+1;;D++)if(D>=g||(k=p[D])<32||k>127&&k<b){this._oscParser.put(p,w,D),w=D-1;break}break;case 6:if(S=this._oscParser.end(k!==24&&k!==26),S)return this._preserveStack(5,[],0,C,w),S;k===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}o.EscapeSequenceParser=y},6242:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const c=l(5770),d=l(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(h,f){this._handlers[h]===void 0&&(this._handlers[h]=[]);const b=this._handlers[h];return b.push(f),{dispose:()=>{const y=b.indexOf(f);y!==-1&&b.splice(y,1)}}}clearHandler(h){this._handlers[h]&&delete this._handlers[h]}setHandlerFallback(h){this._handlerFb=h}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let h=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;h>=0;--h)this._active[h].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].start();else this._handlerFb(this._id,"START")}_put(h,f,b){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(h,f,b);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(h,f,b))}start(){this.reset(),this._state=1}put(h,f,b){if(this._state!==3){if(this._state===1)for(;f<b;){const y=h[f++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&b-f>0&&this._put(h,f,b)}}end(h,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,y=this._active.length-1,m=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,b=f,m=this._stack.fallThrough,this._stack.paused=!1),!m&&b===!1){for(;y>=0&&(b=this._active[y].end(h),b!==!0);y--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,b;y--}for(;y>=0;y--)if(b=this._active[y].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",h);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(h){this._handler=h,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(h,f,b){this._hitLimit||(this._data+=(0,d.utf32ToString)(h,f,b),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(h){let f=!1;if(this._hitLimit)f=!1;else if(h&&(f=this._handler(this._data),f instanceof Promise))return f.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,f}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class c{static fromArray(u){const h=new c;if(!u.length)return h;for(let f=Array.isArray(u[0])?1:0;f<u.length;++f){const b=u[f];if(Array.isArray(b))for(let y=0;y<b.length;++y)h.addSubParam(b[y]);else h.addParam(b)}return h}constructor(u=32,h=32){if(this.maxLength=u,this.maxSubParamsLength=h,h>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(h),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let h=0;h<this.length;++h){u.push(this.params[h]);const f=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];b-f>0&&u.push(Array.prototype.slice.call(this._subParams,f,b))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const h=this._subParamsIdx[u]>>8,f=255&this._subParamsIdx[u];return f-h>0?this._subParams.subarray(h,f):null}getSubParamsAll(){const u={};for(let h=0;h<this.length;++h){const f=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];b-f>0&&(u[h]=this._subParams.slice(f,b))}return u}addDigit(u){let h;if(this._rejectDigits||!(h=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,b=f[h-1];f[h-1]=~b?Math.min(10*b+u,l):u}}o.Params=c},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,c){const d={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(d),c.dispose=()=>this._wrappedAddonDispose(d),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===l){c=d;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const c=l(3785),d=l(511);o.BufferApiView=class{constructor(u,h){this._buffer=u,this.type=h}init(u){return this._buffer=u,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(u){const h=this._buffer.lines.get(u);if(h)return new c.BufferLineApiView(h)}getNullCell(){return new d.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const c=l(511);o.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,u){if(!(d<0||d>=this._line.length))return u?(this._line.loadCell(d,u),u):this._line.loadCell(d,new c.CellData)}translateToString(d,u,h){return this._line.translateToString(d,u,h)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const c=l(8771),d=l(8460),u=l(844);class h extends u.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}o.BufferNamespaceApi=h},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,d=>c(d.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(d,u)=>c(d,u.toArray()))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,o,l){var c=this&&this.__decorate||function(m,p,g,_){var S,k=arguments.length,C=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,p,g,_);else for(var T=m.length-1;T>=0;T--)(S=m[T])&&(C=(k<3?S(C):k>3?S(p,g,C):S(p,g))||C);return k>3&&C&&Object.defineProperty(p,g,C),C},d=this&&this.__param||function(m,p){return function(g,_){p(g,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=l(8460),h=l(844),f=l(5295),b=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let y=o.BufferService=class extends h.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(m,this))}resize(m,p){this.cols=m,this.rows=p,this.buffers.resize(m,p),this._onResize.fire({cols:m,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,p=!1){const g=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===m.fg&&_.getBg(0)===m.bg||(_=g.getBlankLine(m,p),this._cachedBlankLine=_),_.isWrapped=p;const S=g.ybase+g.scrollTop,k=g.ybase+g.scrollBottom;if(g.scrollTop===0){const C=g.lines.isFull;k===g.lines.length-1?C?g.lines.recycle().copyFrom(_):g.lines.push(_.clone()):g.lines.splice(k+1,0,_.clone()),C?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const C=k-S+1;g.lines.shiftElements(S+1,C-1,-1),g.lines.set(k,_.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(m,p,g){const _=this.buffer;if(m<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else m+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const S=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+m,_.ybase),0),S!==_.ydisp&&(p||this._onScroll.fire(_.ydisp))}};o.BufferService=y=c([d(0,b.IOptionsService)],y)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(a,o,l){var c=this&&this.__decorate||function(_,S,k,C){var T,w=arguments.length,E=w<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,k):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,S,k,C);else for(var $=_.length-1;$>=0;$--)(T=_[$])&&(E=(w<3?T(E):w>3?T(S,k,E):T(S,k))||E);return w>3&&E&&Object.defineProperty(S,k,E),E},d=this&&this.__param||function(_,S){return function(k,C){S(k,C,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=l(2585),h=l(8460),f=l(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function y(_,S){let k=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(k|=64,k|=_.action):(k|=3&_.button,4&_.button&&(k|=64),8&_.button&&(k|=128),_.action===32?k|=32:_.action!==0||S||(k|=3)),k}const m=String.fromCharCode,p={DEFAULT:_=>{const S=[y(_,!1)+32,_.col+32,_.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${m(S[0])}${m(S[1])}${m(S[2])}`},SGR:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${y(_,!0)};${_.col};${_.row}${S}`},SGR_PIXELS:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${y(_,!0)};${_.x};${_.y}${S}`}};let g=o.CoreMouseService=class extends f.Disposable{constructor(_,S){super(),this._bufferService=_,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new h.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(b))this.addProtocol(k,b[k]);for(const k of Object.keys(p))this.addEncoding(k,p[k]);this.reset()}addProtocol(_,S){this._protocols[_]=S}addEncoding(_,S){this._encodings[_]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const S=this._encodings[this._activeEncoding](_);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,S,k){if(k){if(_.x!==S.x||_.y!==S.y)return!1}else if(_.col!==S.col||_.row!==S.row)return!1;return _.button===S.button&&_.action===S.action&&_.ctrl===S.ctrl&&_.alt===S.alt&&_.shift===S.shift}};o.CoreMouseService=g=c([d(0,u.IBufferService),d(1,u.ICoreService)],g)},6975:function(a,o,l){var c=this&&this.__decorate||function(g,_,S,k){var C,T=arguments.length,w=T<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(g,_,S,k);else for(var E=g.length-1;E>=0;E--)(C=g[E])&&(w=(T<3?C(w):T>3?C(_,S,w):C(_,S))||w);return T>3&&w&&Object.defineProperty(_,S,w),w},d=this&&this.__param||function(g,_){return function(S,k){_(S,k,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=l(1439),h=l(8460),f=l(844),b=l(2585),y=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=o.CoreService=class extends f.Disposable{constructor(g,_,S){super(),this._bufferService=g,this._logService=_,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new h.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new h.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(y),this.decPrivateModes=(0,u.clone)(m)}reset(){this.modes=(0,u.clone)(y),this.decPrivateModes=(0,u.clone)(m)}triggerDataEvent(g,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,()=>g.split("").map(k=>k.charCodeAt(0))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,()=>g.split("").map(_=>_.charCodeAt(0))),this._onBinary.fire(g))}};o.CoreService=p=c([d(0,b.IBufferService),d(1,b.ILogService),d(2,b.IOptionsService)],p)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const c=l(8055),d=l(8460),u=l(844),h=l(6106);let f=0,b=0;class y extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new h.SortedList(g=>g==null?void 0:g.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(g){if(g.marker.isDisposed)return;const _=new m(g);if(_){const S=_.marker.onDispose(()=>_.dispose());_.onDispose(()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),S.dispose())}),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,_,S){let k=0,C=0;for(const T of this._decorations.getKeyIterator(_))k=T.options.x??0,C=k+(T.options.width??1),g>=k&&g<C&&(!S||(T.options.layer??"bottom")===S)&&(yield T)}forEachDecorationAtCell(g,_,S,k){this._decorations.forEachByKey(_,C=>{f=C.options.x??0,b=f+(C.options.width??1),g>=f&&g<b&&(!S||(C.options.layer??"bottom")===S)&&k(C)})}}o.DecorationService=y;class m extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const c=l(2585),d=l(8343);class u{constructor(...f){this._entries=new Map;for(const[b,y]of f)this.set(b,y)}set(f,b){const y=this._entries.get(f);return this._entries.set(f,b),y}forEach(f){for(const[b,y]of this._entries.entries())f(b,y)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(h,f){this._services.set(h,f)}getService(h){return this._services.get(h)}createInstance(h,...f){const b=(0,d.getServiceDependencies)(h).sort((p,g)=>p.index-g.index),y=[];for(const p of b){const g=this._services.get(p.id);if(!g)throw new Error(`[createInstance] ${h.name} depends on UNKNOWN service ${p.id}.`);y.push(g)}const m=b.length>0?b[0].index:f.length;if(f.length!==m)throw new Error(`[createInstance] First service dependency of ${h.name} at position ${m+1} conflicts with ${f.length} static arguments`);return new h(...f,...y)}}},7866:function(a,o,l){var c=this&&this.__decorate||function(m,p,g,_){var S,k=arguments.length,C=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,p,g,_);else for(var T=m.length-1;T>=0;T--)(S=m[T])&&(C=(k<3?S(C):k>3?S(p,g,C):S(p,g))||C);return k>3&&C&&Object.defineProperty(p,g,C),C},d=this&&this.__param||function(m,p){return function(g,_){p(g,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=l(844),h=l(2585),f={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF};let b,y=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let p=0;p<m.length;p++)typeof m[p]=="function"&&(m[p]=m[p]())}_log(m,p,g){this._evalLazyOptionalParams(g),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...g)}trace(m,...p){var g;this._logLevel<=h.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,m,p)}debug(m,...p){var g;this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,m,p)}info(m,...p){var g;this._logLevel<=h.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,m,p)}warn(m,...p){var g;this._logLevel<=h.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,m,p)}error(m,...p){var g;this._logLevel<=h.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,m,p)}};o.LogService=y=c([d(0,h.IOptionsService)],y),o.setTraceLogger=function(m){b=m},o.traceCall=function(m,p,g){if(typeof g.value!="function")throw new Error("not supported");const _=g.value;g.value=function(...S){if(b.logLevel!==h.LogLevelEnum.TRACE)return _.apply(this,S);b.trace(`GlyphRenderer#${_.name}(${S.map(C=>JSON.stringify(C)).join(", ")})`);const k=_.apply(this,S);return b.trace(`GlyphRenderer#${_.name} return`,k),k}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const c=l(8460),d=l(844),u=l(6114);o.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:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const h=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends d.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...o.DEFAULT_OPTIONS};for(const p in y)if(p in m)try{const g=y[p];m[p]=this._sanitizeAndValidateOption(p,g)}catch(g){console.error(g)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,d.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(y,m){return this.onOptionChange(p=>{p===y&&m(this.rawOptions[y])})}onMultipleOptionChange(y,m){return this.onOptionChange(p=>{y.indexOf(p)!==-1&&m()})}_setupOptions(){const y=p=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},m=(p,g)=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);g=this._sanitizeAndValidateOption(p,g),this.rawOptions[p]!==g&&(this.rawOptions[p]=g,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const g={get:y.bind(this,p),set:m.bind(this,p)};Object.defineProperty(this.options,p,g)}}_sanitizeAndValidateOption(y,m){switch(y){case"cursorStyle":if(m||(m=o.DEFAULT_OPTIONS[y]),!function(p){return p==="block"||p==="underline"||p==="bar"}(m))throw new Error(`"${m}" is not a valid value for ${y}`);break;case"wordSeparator":m||(m=o.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=h.includes(m)?m:o.DEFAULT_OPTIONS[y];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${y} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${y} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}o.OptionsService=f},2660:function(a,o,l){var c=this&&this.__decorate||function(f,b,y,m){var p,g=arguments.length,_=g<3?b:m===null?m=Object.getOwnPropertyDescriptor(b,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(f,b,y,m);else for(var S=f.length-1;S>=0;S--)(p=f[S])&&(_=(g<3?p(_):g>3?p(b,y,_):p(b,y))||_);return g>3&&_&&Object.defineProperty(b,y,_),_},d=this&&this.__param||function(f,b){return function(y,m){b(y,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=l(2585);let h=o.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const b=this._bufferService.buffer;if(f.id===void 0){const S=b.addMarker(b.ybase+b.y),k={data:f,id:this._nextId++,lines:[S]};return S.onDispose(()=>this._removeMarkerFromLink(k,S)),this._dataByLinkId.set(k.id,k),k.id}const y=f,m=this._getEntryIdKey(y),p=this._entriesWithId.get(m);if(p)return this.addLineToLink(p.id,b.ybase+b.y),p.id;const g=b.addMarker(b.ybase+b.y),_={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[g]};return g.onDispose(()=>this._removeMarkerFromLink(_,g)),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(f,b){const y=this._dataByLinkId.get(f);if(y&&y.lines.every(m=>m.line!==b)){const m=this._bufferService.buffer.addMarker(b);y.lines.push(m),m.onDispose(()=>this._removeMarkerFromLink(y,m))}}getLinkData(f){var b;return(b=this._dataByLinkId.get(f))==null?void 0:b.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,b){const y=f.lines.indexOf(b);y!==-1&&(f.lines.splice(y,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};o.OscLinkService=h=c([d(0,u.IBufferService)],h)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[c]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const u=function(h,f,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,m,p){m[l]===m?m[c].push({id:y,index:p}):(m[c]=[{id:y,index:p}],m[l]=m)})(u,h,b)};return u.toString=()=>d,o.serviceRegistry.set(d,u),u}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const c=l(8343);var d;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(o.LogLevelEnum=d={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const c=l(8460),d=l(225);class u{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,b,y=!1){return(16777215&f)<<3|(3&b)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const f=new d.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let b=0,y=0;const m=f.length;for(let p=0;p<m;++p){let g=f.charCodeAt(p);if(55296<=g&&g<=56319){if(++p>=m)return b+this.wcwidth(g);const k=f.charCodeAt(p);56320<=k&&k<=57343?g=1024*(g-55296)+k-56320+65536:b+=this.wcwidth(k)}const _=this.charProperties(g,y);let S=u.extractWidth(_);u.extractShouldJoin(_)&&(S-=u.extractWidth(y)),b+=S,y=_}return b}charProperties(f,b){return this._activeProvider.charProperties(f,b)}}o.UnicodeService=u}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=i(9042),l=i(3236),c=i(844),d=i(5741),u=i(8285),h=i(7975),f=i(7090),b=["cols","rows"];class y extends c.Disposable{constructor(p){super(),this._core=this.register(new l.Terminal(p)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const g=S=>this._core.options[S],_=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:g.bind(this,S),set:_.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(p){if(b.includes(p))throw new Error(`Option "${p}" 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 h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const g in p)this._publicOptions[g]=p[g]}blur(){this._core.blur()}focus(){this._core.focus()}resize(p,g){this._verifyIntegers(p,g),this._core.resize(p,g)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,g,_){this._verifyIntegers(p,g,_),this._core.select(p,g,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,g){this._verifyIntegers(p,g),this._core.selectLines(p,g)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,g){this._core.write(p,g)}writeln(p,g){this._core.write(p),this._core.write(`\r
`,g)}paste(p){this._core.paste(p)}refresh(p,g){this._verifyIntegers(p,g),this._core.refresh(p,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return o}_verifyIntegers(...p){for(const g of p)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const g of p)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}a.Terminal=y})(),s})())})(SA);var kA=SA.exports,EA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={903:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseRenderLayer=void 0;const c=l(274),d=l(627),u=l(237),h=l(860),f=l(374),b=l(296),y=l(345),m=l(859),p=l(399),g=l(855);class _ extends m.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var C;return(C=this._charAtlas)==null?void 0:C.pages[0].canvas}constructor(C,T,w,E,$,M,P,D,R,O){super(),this._terminal=C,this._container=T,this._alpha=$,this._themeService=M,this._bufferService=P,this._optionsService=D,this._decorationService=R,this._coreBrowserService=O,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,b.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new m.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new y.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${w}-layer`),this._canvas.style.zIndex=E.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(N=>{this._refreshCharAtlas(N),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,m.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,f.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(C,T){}handleSelectionChanged(C,T,w=!1){this._selectionModel.update(this._terminal._core,C,T,w)}_setTransparency(C){if(C===this._alpha)return;const T=this._canvas;this._alpha=C,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,T),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(C){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,d.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,C,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,y.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let T=0;T<this._charAtlas.pages.length;T++)this._bitmapGenerator[T]=new S(this._charAtlas.pages[T].canvas)}}resize(C){this._deviceCellWidth=C.device.cell.width,this._deviceCellHeight=C.device.cell.height,this._deviceCharWidth=C.device.char.width,this._deviceCharHeight=C.device.char.height,this._deviceCharLeft=C.device.char.left,this._deviceCharTop=C.device.char.top,this._canvas.width=C.device.canvas.width,this._canvas.height=C.device.canvas.height,this._canvas.style.width=`${C.css.canvas.width}px`,this._canvas.style.height=`${C.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var C;(C=this._charAtlas)==null||C.clearTexture()}_fillCells(C,T,w,E){this._ctx.fillRect(C*this._deviceCellWidth,T*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight)}_fillMiddleLineAtCells(C,T,w=1){const E=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(C*this._deviceCellWidth,(T+1)*this._deviceCellHeight-E-this._coreBrowserService.dpr,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(C,T,w=1,E=0){this._ctx.fillRect(C*this._deviceCellWidth,(T+1)*this._deviceCellHeight+E-this._coreBrowserService.dpr-1,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(C,T,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E;for(let $=0;$<w;$++){const M=(C+$)*this._deviceCellWidth,P=(C+$+.5)*this._deviceCellWidth,D=(C+$+1)*this._deviceCellWidth,R=(T+1)*this._deviceCellHeight-E-1,O=R-E,N=R+E;this._ctx.moveTo(M,R),this._ctx.bezierCurveTo(M,O,P,O,P,R),this._ctx.bezierCurveTo(P,N,D,N,D,R)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(C,T,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E,this._ctx.setLineDash([2*E,E]);const $=C*this._deviceCellWidth,M=(T+1)*this._deviceCellHeight-E-1;this._ctx.moveTo($,M);for(let P=0;P<w;P++){const D=(C+w+P)*this._deviceCellWidth;this._ctx.lineTo(D,M)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(C,T,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E,this._ctx.setLineDash([4*E,3*E]);const $=C*this._deviceCellWidth,M=(C+w)*this._deviceCellWidth,P=(T+1)*this._deviceCellHeight-E-1;this._ctx.moveTo($,P),this._ctx.lineTo(M,P),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(C,T,w){this._ctx.fillRect(C*this._deviceCellWidth,T*this._deviceCellHeight,this._coreBrowserService.dpr*w,this._deviceCellHeight)}_strokeRectAtCell(C,T,w,E){const $=this._coreBrowserService.dpr;this._ctx.lineWidth=$,this._ctx.strokeRect(C*this._deviceCellWidth+$/2,T*this._deviceCellHeight+$/2,w*this._deviceCellWidth-$,E*this._deviceCellHeight-$)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(C,T,w,E){this._alpha?this._ctx.clearRect(C*this._deviceCellWidth,T*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(C*this._deviceCellWidth,T*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight))}_fillCharTrueColor(C,T,w){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=u.TEXT_BASELINE,this._clipRow(w);let E=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(E=(0,h.tryDrawCustomChar)(this._ctx,C.getChars(),T*this._deviceCellWidth,w*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),E||this._ctx.fillText(C.getChars(),T*this._deviceCellWidth+this._deviceCharLeft,w*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(C,T,w){var M,P,D,R;const E=C.getChars();if(this._cellColorResolver.resolve(C,T,this._bufferService.buffer.ydisp+w,this._deviceCellWidth),!this._charAtlas)return;let $;$=E&&E.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(E,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(C.getCode()||g.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),$.size.x&&$.size.y&&(this._ctx.save(),this._clipRow(w),this._bitmapGenerator[$.texturePage]&&this._charAtlas.pages[$.texturePage].canvas!==this._bitmapGenerator[$.texturePage].canvas&&((P=(M=this._bitmapGenerator[$.texturePage])==null?void 0:M.bitmap)==null||P.close(),delete this._bitmapGenerator[$.texturePage]),this._charAtlas.pages[$.texturePage].version!==((D=this._bitmapGenerator[$.texturePage])==null?void 0:D.version)&&(this._bitmapGenerator[$.texturePage]||(this._bitmapGenerator[$.texturePage]=new S(this._charAtlas.pages[$.texturePage].canvas)),this._bitmapGenerator[$.texturePage].refresh(),this._bitmapGenerator[$.texturePage].version=this._charAtlas.pages[$.texturePage].version),this._ctx.drawImage(((R=this._bitmapGenerator[$.texturePage])==null?void 0:R.bitmap)||this._charAtlas.pages[$.texturePage].canvas,$.texturePosition.x,$.texturePosition.y,$.size.x,$.size.y,T*this._deviceCellWidth+this._deviceCharLeft-$.offset.x,w*this._deviceCellHeight+this._deviceCharTop-$.offset.y,$.size.x,$.size.y),this._ctx.restore())}_clipRow(C){this._ctx.beginPath(),this._ctx.rect(0,C*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(C,T){return`${T?"italic":""} ${C?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}o.BaseRenderLayer=_;class S{get bitmap(){return this._bitmap}constructor(C){this.canvas=C,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var C;(C=this._bitmap)==null||C.close(),this._bitmap=void 0,p.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var C;this._state===0&&((C=this._bitmap)==null||C.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(T=>{this._state===2?this.refresh():this._bitmap=T,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CanvasRenderer=void 0;const c=l(627),d=l(56),u=l(374),h=l(345),f=l(859),b=l(873),y=l(43),m=l(630),p=l(744);class g extends f.Disposable{constructor(S,k,C,T,w,E,$,M,P,D,R){super(),this._terminal=S,this._screenElement=k,this._bufferService=T,this._charSizeService=w,this._optionsService=E,this._coreBrowserService=P,this._themeService=R,this._observerDisposable=this.register(new f.MutableDisposable),this._onRequestRedraw=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new h.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new h.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const O=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new p.TextRenderLayer(this._terminal,this._screenElement,0,O,this._bufferService,this._optionsService,$,D,this._coreBrowserService,R),new m.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,D,this._optionsService,R),new y.LinkRenderLayer(this._terminal,this._screenElement,2,C,this._bufferService,this._optionsService,D,this._coreBrowserService,R),new b.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,D,R)];for(const N of this._renderLayers)(0,h.forwardEvent)(N.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,u.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,d.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(N,I)=>this._setCanvasDevicePixelDimensions(N,I)),this.register(this._coreBrowserService.onWindowChange(N=>{this._observerDisposable.value=(0,d.observeDevicePixelDimensions)(this._renderLayers[0].canvas,N,(I,j)=>this._setCanvasDevicePixelDimensions(I,j))})),this.register((0,f.toDisposable)(()=>{for(const N of this._renderLayers)N.dispose();(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(S,k){this._updateDimensions();for(const C of this._renderLayers)C.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(S=>S.handleBlur())}handleFocus(){this._runOperation(S=>S.handleFocus())}handleSelectionChanged(S,k,C=!1){this._runOperation(T=>T.handleSelectionChanged(S,k,C)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(S=>S.handleCursorMove())}clear(){this._runOperation(S=>S.reset())}_runOperation(S){for(const k of this._renderLayers)S(k)}renderRows(S,k){for(const C of this._renderLayers)C.handleGridChanged(S,k)}clearTextureAtlas(){for(const S of this._renderLayers)S.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*S),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/S),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(S,k){this.dimensions.device.canvas.height=k,this.dimensions.device.canvas.width=S;for(const C of this._renderLayers)C.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}o.CanvasRenderer=g},873:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorRenderLayer=void 0;const c=l(457),d=l(859),u=l(399),h=l(782),f=l(903);class b extends f.BaseRenderLayer{constructor(m,p,g,_,S,k,C,T,w,E){super(m,p,"cursor",g,!0,E,S,k,w,T),this._onRequestRedraw=_,this._coreService=C,this._cursorBlinkStateManager=this.register(new d.MutableDisposable),this._cell=new h.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(m){super.resize(m),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var m;this._clearCursor(),(m=this._cursorBlinkStateManager.value)==null||m.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var m;(m=this._cursorBlinkStateManager.value)==null||m.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var m;(m=this._cursorBlinkStateManager.value)==null||m.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new c.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var m;(m=this._cursorBlinkStateManager.value)==null||m.restartBlinkAnimation()}handleGridChanged(m,p){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(m){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const p=this._bufferService.buffer.ybase+this._bufferService.buffer.y,g=p-this._bufferService.buffer.ydisp;if(g<0||g>=this._bufferService.rows)return void this._clearCursor();const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(p).loadCell(_,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const S=this._optionsService.rawOptions.cursorStyle,k=this._optionsService.rawOptions.cursorInactiveStyle;return k&&k!=="none"&&this._cursorRenderers[k](_,g,this._cell),this._ctx.restore(),this._state.x=_,this._state.y=g,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===_&&this._state.y===g&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](_,g,this._cell),this._ctx.restore(),this._state.x=_,this._state.y=g,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(u.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(m,p,g){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(m,p,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(m,p,g){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(m,p,g.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(g,m,p),this._ctx.restore()}_renderUnderlineCursor(m,p,g){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(m,p),this._ctx.restore()}_renderOutlineCursor(m,p,g){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(m,p,g.getWidth(),1),this._ctx.restore()}}o.CursorRenderLayer=b},574:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GridCache=void 0,o.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let d=0;d<l;d++){this.cache.length<=d&&this.cache.push([]);for(let u=this.cache[d].length;u<c;u++)this.cache[d].push(void 0);this.cache[d].length=c}this.cache.length=l}clear(){for(let l=0;l<this.cache.length;l++)for(let c=0;c<this.cache[l].length;c++)this.cache[l][c]=void 0}}},43:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const c=l(197),d=l(237),u=l(903);class h extends u.BaseRenderLayer{constructor(b,y,m,p,g,_,S,k,C){super(b,y,"link",m,!0,C,g,_,S,k),this.register(p.onShowLinkUnderline(T=>this._handleShowLinkUnderline(T))),this.register(p.onHideLinkUnderline(T=>this._handleHideLinkUnderline(T)))}resize(b){super.resize(b),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const b=this._state.y2-this._state.y1-1;b>0&&this._clearCells(0,this._state.y1+1,this._state.cols,b),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(b){if(b.fg===d.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:b.fg&&(0,c.is256Color)(b.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[b.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,b.y1===b.y2)this._fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this._fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(let y=b.y1+1;y<b.y2;y++)this._fillBottomLineAtCells(0,y,b.cols);this._fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b}_handleHideLinkUnderline(b){this._clearCurrentLink()}}o.LinkRenderLayer=h},630:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionRenderLayer=void 0;const c=l(903);class d extends c.BaseRenderLayer{constructor(h,f,b,y,m,p,g,_){super(h,f,"selection",b,!0,_,y,g,p,m),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(h){super.resize(h),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(h,f,b){super.handleSelectionChanged(h,f,b),this._redrawSelection(h,f,b)}_redrawSelection(h,f,b){if(!this._didStateChange(h,f,b,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!h||!f)return void this._clearState();const y=h[1]-this._bufferService.buffer.ydisp,m=f[1]-this._bufferService.buffer.ydisp,p=Math.max(y,0),g=Math.min(m,this._bufferService.rows-1);if(p>=this._bufferService.rows||g<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,b){const _=h[0],S=f[0]-_,k=g-p+1;this._fillCells(_,p,S,k)}else{const _=y===p?h[0]:0,S=p===m?f[0]:this._bufferService.cols;this._fillCells(_,p,S-_,1);const k=Math.max(g-p-1,0);if(this._fillCells(0,p+1,this._bufferService.cols,k),p!==g){const C=m===g?f[0]:this._bufferService.cols;this._fillCells(0,g,C,1)}}this._state.start=[h[0],h[1]],this._state.end=[f[0],f[1]],this._state.columnSelectMode=b,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(h,f,b,y){return!this._areCoordinatesEqual(h,this._state.start)||!this._areCoordinatesEqual(f,this._state.end)||b!==this._state.columnSelectMode||y!==this._state.ydisp}_areCoordinatesEqual(h,f){return!(!h||!f)&&h[0]===f[0]&&h[1]===f[1]}}o.SelectionRenderLayer=d},744:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextRenderLayer=void 0;const c=l(577),d=l(147),u=l(782),h=l(855),f=l(903),b=l(574);class y extends f.BaseRenderLayer{constructor(p,g,_,S,k,C,T,w,E,$){super(p,g,"text",_,S,$,k,C,w,E),this._characterJoinerService=T,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new u.CellData,this._state=new b.GridCache,this.register(C.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(p){super.resize(p);const g=this._getFont(!1,!1);this._characterWidth===p.device.char.width&&this._characterFont===g||(this._characterWidth=p.device.char.width,this._characterFont=g,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(p,g,_){for(let S=p;S<=g;S++){const k=S+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(k),T=this._characterJoinerService.getJoinedCharacters(k);for(let w=0;w<this._bufferService.cols;w++){C.loadCell(w,this._workCell);let E=this._workCell,$=!1,M=w;if(E.getWidth()!==0){if(T.length>0&&w===T[0][0]){$=!0;const P=T.shift();E=new c.JoinedCellData(this._workCell,C.translateToString(!0,P[0],P[1]),P[1]-P[0]),M=P[1]-1}!$&&this._isOverlapping(E)&&M<C.length-1&&C.getCodePoint(M+1)===h.NULL_CELL_CODE&&(E.content&=-12582913,E.content|=8388608),_(E,w,S),w=M}}}}_drawBackground(p,g){const _=this._ctx,S=this._bufferService.cols;let k=0,C=0,T=null;_.save(),this._forEachCell(p,g,(w,E,$)=>{let M=null;w.isInverse()?M=w.isFgDefault()?this._themeService.colors.foreground.css:w.isFgRGB()?`rgb(${d.AttributeData.toColorRGB(w.getFgColor()).join(",")})`:this._themeService.colors.ansi[w.getFgColor()].css:w.isBgRGB()?M=`rgb(${d.AttributeData.toColorRGB(w.getBgColor()).join(",")})`:w.isBgPalette()&&(M=this._themeService.colors.ansi[w.getBgColor()].css);let P=!1;this._decorationService.forEachDecorationAtCell(E,this._bufferService.buffer.ydisp+$,void 0,D=>{D.options.layer!=="top"&&P||(D.backgroundColorRGB&&(M=D.backgroundColorRGB.css),P=D.options.layer==="top")}),T===null&&(k=E,C=$),$!==C?(_.fillStyle=T||"",this._fillCells(k,C,S-k,1),k=E,C=$):T!==M&&(_.fillStyle=T||"",this._fillCells(k,C,E-k,1),k=E,C=$),T=M}),T!==null&&(_.fillStyle=T,this._fillCells(k,C,S-k,1)),_.restore()}_drawForeground(p,g){this._forEachCell(p,g,(_,S,k)=>this._drawChars(_,S,k))}handleGridChanged(p,g){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,p,this._bufferService.cols,g-p+1),this._drawBackground(p,g),this._drawForeground(p,g))}_isOverlapping(p){if(p.getWidth()!==1||p.getCode()<256)return!1;const g=p.getChars();if(this._characterOverlapCache.hasOwnProperty(g))return this._characterOverlapCache[g];this._ctx.save(),this._ctx.font=this._characterFont;const _=Math.floor(this._ctx.measureText(g).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[g]=_,_}}o.TextRenderLayer=y},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const c=l(855),d=l(160),u=l(374);let h,f=0,b=0,y=!1,m=!1,p=!1,g=0;o.CellColorResolver=class{constructor(_,S,k,C,T,w){this._terminal=_,this._optionService=S,this._selectionRenderModel=k,this._decorationService=C,this._coreBrowserService=T,this._themeService=w,this.result={fg:0,bg:0,ext:0}}resolve(_,S,k,C){if(this.result.bg=_.bg,this.result.fg=_.fg,this.result.ext=268435456&_.bg?_.extended.ext:0,b=0,f=0,m=!1,y=!1,p=!1,h=this._themeService.colors,g=0,_.getCode()!==c.NULL_CELL_CODE&&_.extended.underlineStyle===4){const T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));g=S*C%(2*Math.round(T))}if(this._decorationService.forEachDecorationAtCell(S,k,"bottom",T=>{T.backgroundColorRGB&&(b=T.backgroundColorRGB.rgba>>8&16777215,m=!0),T.foregroundColorRGB&&(f=T.foregroundColorRGB.rgba>>8&16777215,y=!0)}),p=this._selectionRenderModel.isCellSelected(this._terminal,S,k),p){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=-256&this.result.bg|255}b=d.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else b=(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(m=!0,h.selectionForeground&&(f=h.selectionForeground.rgba>>8&16777215,y=!0),(0,u.treatGlyphAsBackgroundColor)(_.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))f=(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=-256&this.result.bg|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=d.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}y=!0}}this._decorationService.forEachDecorationAtCell(S,k,"top",T=>{T.backgroundColorRGB&&(b=T.backgroundColorRGB.rgba>>8&16777215,m=!0),T.foregroundColorRGB&&(f=T.foregroundColorRGB.rgba>>8&16777215,y=!0)}),m&&(b=p?-16777216&_.bg&-134217729|b|50331648:-16777216&_.bg|b|50331648),y&&(f=-16777216&_.fg&-67108865|f|50331648),67108864&this.result.fg&&(m&&!y&&(f=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&h.background.rgba>>8|50331648,y=!0),!m&&y&&(b=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&h.foreground.rgba>>8|50331648,m=!0)),h=void 0,this.result.bg=m?b:this.result.bg,this.result.fg=y?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=g<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const c=l(509),d=l(197),u=[];o.acquireTextureAtlas=function(h,f,b,y,m,p,g,_){const S=(0,d.generateConfig)(y,m,p,g,f,b,_);for(let T=0;T<u.length;T++){const w=u[T],E=w.ownedBy.indexOf(h);if(E>=0){if((0,d.configEquals)(w.config,S))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),u.splice(T,1)):w.ownedBy.splice(E,1);break}}for(let T=0;T<u.length;T++){const w=u[T];if((0,d.configEquals)(w.config,S))return w.ownedBy.push(h),w.atlas}const k=h._core,C={atlas:new c.TextureAtlas(document,S,k.unicodeService),config:S,ownedBy:[h]};return u.push(C),C.atlas},o.removeTerminalFromCache=function(h){for(let f=0;f<u.length;f++){const b=u[f].ownedBy.indexOf(h);if(b!==-1){u[f].ownedBy.length===1?(u[f].atlas.dispose(),u.splice(f,1)):u[f].ownedBy.splice(b,1);break}}}},197:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const c=l(160);o.generateConfig=function(d,u,h,f,b,y,m){const p={foreground:y.foreground,background:y.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:y.ansi.slice(),contrastCache:y.contrastCache,halfContrastCache:y.halfContrastCache};return{customGlyphs:b.customGlyphs,devicePixelRatio:m,letterSpacing:b.letterSpacing,lineHeight:b.lineHeight,deviceCellWidth:d,deviceCellHeight:u,deviceCharWidth:h,deviceCharHeight:f,fontFamily:b.fontFamily,fontSize:b.fontSize,fontWeight:b.fontWeight,fontWeightBold:b.fontWeightBold,allowTransparency:b.allowTransparency,drawBoldTextInBrightColors:b.drawBoldTextInBrightColors,minimumContrastRatio:b.minimumContrastRatio,colors:p}},o.configEquals=function(d,u){for(let h=0;h<d.colors.ansi.length;h++)if(d.colors.ansi[h].rgba!==u.colors.ansi[h].rgba)return!1;return d.devicePixelRatio===u.devicePixelRatio&&d.customGlyphs===u.customGlyphs&&d.lineHeight===u.lineHeight&&d.letterSpacing===u.letterSpacing&&d.fontFamily===u.fontFamily&&d.fontSize===u.fontSize&&d.fontWeight===u.fontWeight&&d.fontWeightBold===u.fontWeightBold&&d.allowTransparency===u.allowTransparency&&d.deviceCharWidth===u.deviceCharWidth&&d.deviceCharHeight===u.deviceCharHeight&&d.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&d.minimumContrastRatio===u.minimumContrastRatio&&d.colors.foreground.rgba===u.colors.foreground.rgba&&d.colors.background.rgba===u.colors.background.rgba},o.is256Color=function(d){return(50331648&d)==16777216||(50331648&d)==33554432}},237:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.CursorBlinkStateManager=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const c=l(374);o.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const d={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};o.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"║":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╒":{1:(y,m)=>`M.5,1 L.5,${.5-m} L1,${.5-m} M.5,${.5+m} L1,${.5+m}`},"╓":{1:(y,m)=>`M${.5-y},1 L${.5-y},.5 L1,.5 M${.5+y},.5 L${.5+y},1`},"╔":{1:(y,m)=>`M1,${.5-m} L${.5-y},${.5-m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1`},"╕":{1:(y,m)=>`M0,${.5-m} L.5,${.5-m} L.5,1 M0,${.5+m} L.5,${.5+m}`},"╖":{1:(y,m)=>`M${.5+y},1 L${.5+y},.5 L0,.5 M${.5-y},.5 L${.5-y},1`},"╗":{1:(y,m)=>`M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M0,${.5-m} L${.5+y},${.5-m} L${.5+y},1`},"╘":{1:(y,m)=>`M.5,0 L.5,${.5+m} L1,${.5+m} M.5,${.5-m} L1,${.5-m}`},"╙":{1:(y,m)=>`M1,.5 L${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╚":{1:(y,m)=>`M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0 M1,${.5+m} L${.5-y},${.5+m} L${.5-y},0`},"╛":{1:(y,m)=>`M0,${.5+m} L.5,${.5+m} L.5,0 M0,${.5-m} L.5,${.5-m}`},"╜":{1:(y,m)=>`M0,.5 L${.5+y},.5 L${.5+y},0 M${.5-y},.5 L${.5-y},0`},"╝":{1:(y,m)=>`M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M0,${.5+m} L${.5+y},${.5+m} L${.5+y},0`},"╞":{1:(y,m)=>`M.5,0 L.5,1 M.5,${.5-m} L1,${.5-m} M.5,${.5+m} L1,${.5+m}`},"╟":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1 M${.5+y},.5 L1,.5`},"╠":{1:(y,m)=>`M${.5-y},0 L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╡":{1:(y,m)=>`M.5,0 L.5,1 M0,${.5-m} L.5,${.5-m} M0,${.5+m} L.5,${.5+m}`},"╢":{1:(y,m)=>`M0,.5 L${.5-y},.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╣":{1:(y,m)=>`M${.5+y},0 L${.5+y},1 M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0`},"╤":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m} M.5,${.5+m} L.5,1`},"╥":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},1 M${.5+y},.5 L${.5+y},1`},"╦":{1:(y,m)=>`M0,${.5-m} L1,${.5-m} M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1`},"╧":{1:(y,m)=>`M.5,0 L.5,${.5-m} M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"╨":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╩":{1:(y,m)=>`M0,${.5+m} L1,${.5+m} M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╪":{1:(y,m)=>`M.5,0 L.5,1 M0,${.5-m} L1,${.5-m} M0,${.5+m} L1,${.5+m}`},"╫":{1:(y,m)=>`M0,.5 L1,.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╬":{1:(y,m)=>`M0,${.5+m} L${.5-y},${.5+m} L${.5-y},1 M1,${.5+m} L${.5+y},${.5+m} L${.5+y},1 M0,${.5-m} L${.5-y},${.5-m} L${.5-y},0 M1,${.5-m} L${.5+y},${.5-m} L${.5+y},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(y,m)=>`M.5,1 L.5,${.5+m/.15*.5} C.5,${.5+m/.15*.5},.5,.5,1,.5`},"╮":{1:(y,m)=>`M.5,1 L.5,${.5+m/.15*.5} C.5,${.5+m/.15*.5},.5,.5,0,.5`},"╯":{1:(y,m)=>`M.5,0 L.5,${.5-m/.15*.5} C.5,${.5-m/.15*.5},.5,.5,0,.5`},"╰":{1:(y,m)=>`M.5,0 L.5,${.5-m/.15*.5} C.5,${.5-m/.15*.5},.5,.5,1,.5`}},o.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.tryDrawCustomChar=function(y,m,p,g,_,S,k,C){const T=o.blockElementDefinitions[m];if(T)return function(M,P,D,R,O,N){for(let I=0;I<P.length;I++){const j=P[I],L=O/8,A=N/8;M.fillRect(D+j.x*L,R+j.y*A,j.w*L,j.h*A)}}(y,T,p,g,_,S),!0;const w=d[m];if(w)return function(M,P,D,R,O,N){let I=u.get(P);I||(I=new Map,u.set(P,I));const j=M.fillStyle;if(typeof j!="string")throw new Error(`Unexpected fillStyle type "${j}"`);let L=I.get(j);if(!L){const A=P[0].length,F=P.length,H=M.canvas.ownerDocument.createElement("canvas");H.width=A,H.height=F;const B=(0,c.throwIfFalsy)(H.getContext("2d")),G=new ImageData(A,F);let J,W,U,z;if(j.startsWith("#"))J=parseInt(j.slice(1,3),16),W=parseInt(j.slice(3,5),16),U=parseInt(j.slice(5,7),16),z=j.length>7&&parseInt(j.slice(7,9),16)||1;else{if(!j.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${j}" when drawing pattern glyph`);[J,W,U,z]=j.substring(5,j.length-1).split(",").map(V=>parseFloat(V))}for(let V=0;V<F;V++)for(let K=0;K<A;K++)G.data[4*(V*A+K)]=J,G.data[4*(V*A+K)+1]=W,G.data[4*(V*A+K)+2]=U,G.data[4*(V*A+K)+3]=P[V][K]*(255*z);B.putImageData(G,0,0),L=(0,c.throwIfFalsy)(M.createPattern(H,null)),I.set(j,L)}M.fillStyle=L,M.fillRect(D,R,O,N)}(y,w,p,g,_,S),!0;const E=o.boxDrawingDefinitions[m];if(E)return function(M,P,D,R,O,N,I){M.strokeStyle=M.fillStyle;for(const[j,L]of Object.entries(P)){let A;M.beginPath(),M.lineWidth=I*Number.parseInt(j),A=typeof L=="function"?L(.15,.15/N*O):L;for(const F of A.split(" ")){const H=F[0],B=f[H];if(!B){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=F.substring(1).split(",");G[0]&&G[1]&&B(M,b(G,O,N,D,R,!0,I))}M.stroke(),M.closePath()}}(y,E,p,g,_,S,C),!0;const $=o.powerlineDefinitions[m];return!!$&&(function(M,P,D,R,O,N,I,j){const L=new Path2D;L.rect(D,R,O,N),M.clip(L),M.beginPath();const A=I/12;M.lineWidth=j*A;for(const F of P.d.split(" ")){const H=F[0],B=f[H];if(!B){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=F.substring(1).split(",");G[0]&&G[1]&&B(M,b(G,O,N,D,R,!1,j,(P.leftPadding??0)*(A/2),(P.rightPadding??0)*(A/2)))}P.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()}(y,$,p,g,_,S,k,C),!0)};const u=new Map;function h(y,m,p=0){return Math.max(Math.min(y,m),p)}const f={C:(y,m)=>y.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]),L:(y,m)=>y.lineTo(m[0],m[1]),M:(y,m)=>y.moveTo(m[0],m[1])};function b(y,m,p,g,_,S,k,C=0,T=0){const w=y.map(E=>parseFloat(E)||parseInt(E));if(w.length<2)throw new Error("Too few arguments for instruction");for(let E=0;E<w.length;E+=2)w[E]*=m-C*k-T*k,S&&w[E]!==0&&(w[E]=h(Math.round(w[E]+.5)-.5,m,0)),w[E]+=g+C*k;for(let E=1;E<w.length;E+=2)w[E]*=p,S&&w[E]!==0&&(w[E]=h(Math.round(w[E]+.5)-.5,p,0)),w[E]+=_;return w}},56:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const c=l(859);o.observeDevicePixelDimensions=function(d,u,h){let f=new u.ResizeObserver(b=>{const y=b.find(g=>g.target===d);if(!y)return;if(!("devicePixelContentBoxSize"in y))return f==null||f.disconnect(),void(f=void 0);const m=y.devicePixelContentBoxSize[0].inlineSize,p=y.devicePixelContentBoxSize[0].blockSize;m>0&&p>0&&h(m,p)});try{f.observe(d,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,c.toDisposable)(()=>f==null?void 0:f.disconnect())}},374:(a,o)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},o.treatGlyphAsBackgroundColor=function(c){return l(c)||function(d){return 9472<=d&&d<=9631}(c)},o.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}}}},o.computeNextVariantOffset=function(c,d,u=0){return(c-(2*Math.round(d)-u))%(2*Math.round(d))}},296:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(d,u,h,f=!1){if(this.selectionStart=u,this.selectionEnd=h,!u||!h||u[0]===h[0]&&u[1]===h[1])return void this.clear();const b=d.buffers.active.ydisp,y=u[1]-b,m=h[1]-b,p=Math.max(y,0),g=Math.min(m,d.rows-1);p>=d.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=y,this.viewportEndRow=m,this.viewportCappedStartRow=p,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=h[0])}isCellSelected(d,u,h){return!!this.hasSelection&&(h-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&h>=this.viewportCappedStartRow&&u<this.endCol&&h<=this.viewportCappedEndRow:u<this.startCol&&h>=this.viewportCappedStartRow&&u>=this.endCol&&h<=this.viewportCappedEndRow:h>this.viewportStartRow&&h<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&h===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},509:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const c=l(237),d=l(860),u=l(374),h=l(160),f=l(345),b=l(485),y=l(385),m=l(147),p=l(855),g={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let _;class S{get pages(){return this._pages}constructor(E,$,M){this._document=E,this._config=$,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new b.FourKeyMap,this._cacheMapCombined=new b.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new m.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new y.IdleTaskQueue;for(let $=33;$<126;$++)E.enqueue(()=>{if(!this._cacheMap.get($,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT)){const M=this._drawToCache($,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT);this._cacheMap.set($,p.DEFAULT_COLOR,p.DEFAULT_COLOR,p.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const $=this._pages.filter(I=>2*I.canvas.width<=(S.maxTextureSize||4096)).sort((I,j)=>j.canvas.width!==I.canvas.width?j.canvas.width-I.canvas.width:j.percentageUsed-I.percentageUsed);let M=-1,P=0;for(let I=0;I<$.length;I++)if($[I].canvas.width!==P)M=I,P=$[I].canvas.width;else if(I-M==3)break;const D=$.slice(M,M+4),R=D.map(I=>I.glyphs[0].texturePage).sort((I,j)=>I>j?1:-1),O=this.pages.length-D.length,N=this._mergePages(D,O);N.version++;for(let I=R.length-1;I>=0;I--)this._deletePage(R[I]);this.pages.push(N),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(N.canvas)}const E=new k(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,$){const M=2*E[0].canvas.width,P=new k(this._document,M,E);for(const[D,R]of E.entries()){const O=D*R.canvas.width%M,N=Math.floor(D/2)*R.canvas.height;P.ctx.drawImage(R.canvas,O,N);for(const j of R.glyphs)j.texturePage=$,j.sizeClipSpace.x=j.size.x/M,j.sizeClipSpace.y=j.size.y/M,j.texturePosition.x+=O,j.texturePosition.y+=N,j.texturePositionClipSpace.x=j.texturePosition.x/M,j.texturePositionClipSpace.y=j.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(R.canvas);const I=this._activePages.indexOf(R);I!==-1&&this._activePages.splice(I,1)}return P}_deletePage(E){this._pages.splice(E,1);for(let $=E;$<this._pages.length;$++){const M=this._pages[$];for(const P of M.glyphs)P.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(E,$,M,P,D){return this._getFromCacheMap(this._cacheMapCombined,E,$,M,P,D)}getRasterizedGlyph(E,$,M,P,D){return this._getFromCacheMap(this._cacheMap,E,$,M,P,D)}_getFromCacheMap(E,$,M,P,D,R=!1){return _=E.get($,M,P,D),_||(_=this._drawToCache($,M,P,D,R),E.set($,M,P,D,_)),_}_getColorFromAnsiIndex(E){if(E>=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,$,M,P){if(this._config.allowTransparency)return h.NULL_COLOR;let D;switch(E){case 16777216:case 33554432:D=this._getColorFromAnsiIndex($);break;case 50331648:const R=m.AttributeData.toColorRGB($);D=h.rgba.toColor(R[0],R[1],R[2]);break;default:D=M?h.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(E,$,M,P,D,R,O,N,I,j){const L=this._getMinimumContrastColor(E,$,M,P,D,R,O,I,N,j);if(L)return L;let A;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&I&&R<8&&(R+=8),A=this._getColorFromAnsiIndex(R);break;case 50331648:const F=m.AttributeData.toColorRGB(R);A=h.rgba.toColor(F[0],F[1],F[2]);break;default:A=O?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(A=h.color.opaque(A)),N&&(A=h.color.multiplyOpacity(A,c.DIM_OPACITY)),A}_resolveBackgroundRgba(E,$,M){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex($).rgba;case 50331648:return $<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,$,M,P){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&P&&$<8&&($+=8),this._getColorFromAnsiIndex($).rgba;case 50331648:return $<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,$,M,P,D,R,O,N,I,j){if(this._config.minimumContrastRatio===1||j)return;const L=this._getContrastCache(I),A=L.getColor(E,P);if(A!==void 0)return A||void 0;const F=this._resolveBackgroundRgba($,M,O),H=this._resolveForegroundRgba(D,R,O,N),B=h.rgba.ensureContrastRatio(F,H,this._config.minimumContrastRatio/(I?2:1));if(!B)return void L.setColor(E,P,null);const G=h.rgba.toColor(B>>24&255,B>>16&255,B>>8&255);return L.setColor(E,P,G),G}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,$,M,P,D=!1){const R=typeof E=="number"?String.fromCharCode(E):E,O=Math.min(this._config.deviceCellWidth*Math.max(R.length,2)+4,this._textureSize);this._tmpCanvas.width<O&&(this._tmpCanvas.width=O);const N=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<N&&(this._tmpCanvas.height=N),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=$,this._workAttributeData.extended.ext=P,this._workAttributeData.isInvisible())return g;const I=!!this._workAttributeData.isBold(),j=!!this._workAttributeData.isInverse(),L=!!this._workAttributeData.isDim(),A=!!this._workAttributeData.isItalic(),F=!!this._workAttributeData.isUnderline(),H=!!this._workAttributeData.isStrikethrough(),B=!!this._workAttributeData.isOverline();let G=this._workAttributeData.getFgColor(),J=this._workAttributeData.getFgColorMode(),W=this._workAttributeData.getBgColor(),U=this._workAttributeData.getBgColorMode();if(j){const se=G;G=W,W=se;const fe=J;J=U,U=fe}const z=this._getBackgroundColor(U,W,j,L);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const V=I?this._config.fontWeightBold:this._config.fontWeight,K=A?"italic":"";this._tmpCtx.font=`${K} ${V} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const q=R.length===1&&(0,u.isPowerlineGlyph)(R.charCodeAt(0)),X=R.length===1&&(0,u.isRestrictedPowerlineGlyph)(R.charCodeAt(0)),ie=this._getForegroundColor($,U,W,M,J,G,j,L,I,(0,u.treatGlyphAsBackgroundColor)(R.charCodeAt(0)));this._tmpCtx.fillStyle=ie.css;const re=X?0:4;let ce=!1;this._config.customGlyphs!==!1&&(ce=(0,d.tryDrawCustomChar)(this._tmpCtx,R,re,re,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ye,ae=!q;if(ye=typeof E=="number"?this._unicodeService.wcwidth(E):this._unicodeService.getStringCellWidth(E),F){this._tmpCtx.save();const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),fe=se%2==1?.5:0;if(this._tmpCtx.lineWidth=se,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ae=!1,this._tmpCtx.strokeStyle=`rgb(${m.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ae=!1;let Te=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Te<8&&(Te+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Te).css}this._tmpCtx.beginPath();const Q=re,ne=Math.ceil(re+this._config.deviceCharHeight)-fe-(D?2*se:0),he=ne+se,ve=ne+2*se;let Ce=this._workAttributeData.getUnderlineVariantOffset();for(let Te=0;Te<ye;Te++){this._tmpCtx.save();const we=Q+Te*this._config.deviceCellWidth,be=Q+(Te+1)*this._config.deviceCellWidth,mt=we+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(we,ne),this._tmpCtx.lineTo(be,ne),this._tmpCtx.moveTo(we,ve),this._tmpCtx.lineTo(be,ve);break;case 3:const Je=se<=1?ve:Math.ceil(re+this._config.deviceCharHeight-se/2)-fe,qe=se<=1?ne:Math.ceil(re+this._config.deviceCharHeight+se/2)-fe,ct=new Path2D;ct.rect(we,ne,this._config.deviceCellWidth,ve-ne),this._tmpCtx.clip(ct),this._tmpCtx.moveTo(we-this._config.deviceCellWidth/2,he),this._tmpCtx.bezierCurveTo(we-this._config.deviceCellWidth/2,qe,we,qe,we,he),this._tmpCtx.bezierCurveTo(we,Je,mt,Je,mt,he),this._tmpCtx.bezierCurveTo(mt,qe,be,qe,be,he),this._tmpCtx.bezierCurveTo(be,Je,be+this._config.deviceCellWidth/2,Je,be+this._config.deviceCellWidth/2,he);break;case 4:const nt=Ce===0?0:Ce>=se?2*se-Ce:se-Ce;Ce>=se||nt===0?(this._tmpCtx.setLineDash([Math.round(se),Math.round(se)]),this._tmpCtx.moveTo(we+nt,ne),this._tmpCtx.lineTo(be,ne)):(this._tmpCtx.setLineDash([Math.round(se),Math.round(se)]),this._tmpCtx.moveTo(we,ne),this._tmpCtx.lineTo(we+nt,ne),this._tmpCtx.moveTo(we+nt+se,ne),this._tmpCtx.lineTo(be,ne)),Ce=(0,u.computeNextVariantOffset)(be-we,se,Ce);break;case 5:const Ie=.6,Ke=.3,rt=be-we,Xe=Math.floor(Ie*rt),ut=Math.floor(Ke*rt),gt=rt-Xe-ut;this._tmpCtx.setLineDash([Xe,ut,gt]),this._tmpCtx.moveTo(we,ne),this._tmpCtx.lineTo(be,ne);break;default:this._tmpCtx.moveTo(we,ne),this._tmpCtx.lineTo(be,ne)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ce&&this._config.fontSize>=12&&!this._config.allowTransparency&&R!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Te=this._tmpCtx.measureText(R);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Te&&Te.actualBoundingBoxDescent>0){this._tmpCtx.save();const we=new Path2D;we.rect(Q,ne-Math.ceil(se/2),this._config.deviceCellWidth*ye,ve-ne+Math.ceil(se/2)),this._tmpCtx.clip(we),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(R,re,re+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(B){const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),fe=se%2==1?.5:0;this._tmpCtx.lineWidth=se,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(re,re+fe),this._tmpCtx.lineTo(re+this._config.deviceCharWidth*ye,re+fe),this._tmpCtx.stroke()}if(ce||this._tmpCtx.fillText(R,re,re+this._config.deviceCharHeight),R==="_"&&!this._config.allowTransparency){let se=C(this._tmpCtx.getImageData(re,re,this._config.deviceCellWidth,this._config.deviceCellHeight),z,ie,ae);if(se)for(let fe=1;fe<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(R,re,re+this._config.deviceCharHeight-fe),se=C(this._tmpCtx.getImageData(re,re,this._config.deviceCellWidth,this._config.deviceCellHeight),z,ie,ae),se);fe++);}if(H){const se=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),fe=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=se,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(re,re+Math.floor(this._config.deviceCharHeight/2)-fe),this._tmpCtx.lineTo(re+this._config.deviceCharWidth*ye,re+Math.floor(this._config.deviceCharHeight/2)-fe),this._tmpCtx.stroke()}this._tmpCtx.restore();const Me=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Pe;if(Pe=this._config.allowTransparency?function(se){for(let fe=0;fe<se.data.length;fe+=4)if(se.data[fe+3]>0)return!1;return!0}(Me):C(Me,z,ie,ae),Pe)return g;const ge=this._findGlyphBoundingBox(Me,this._workBoundingBox,O,X,ce,re);let xe,oe;for(;;){if(this._activePages.length===0){const se=this._createNewPage();xe=se,oe=se.currentRow,oe.height=ge.size.y;break}xe=this._activePages[this._activePages.length-1],oe=xe.currentRow;for(const se of this._activePages)ge.size.y<=se.currentRow.height&&(xe=se,oe=se.currentRow);for(let se=this._activePages.length-1;se>=0;se--)for(const fe of this._activePages[se].fixedRows)fe.height<=oe.height&&ge.size.y<=fe.height&&(xe=this._activePages[se],oe=fe);if(oe.y+ge.size.y>=xe.canvas.height||oe.height>ge.size.y+2){let se=!1;if(xe.currentRow.y+xe.currentRow.height+ge.size.y>=xe.canvas.height){let fe;for(const Q of this._activePages)if(Q.currentRow.y+Q.currentRow.height+ge.size.y<Q.canvas.height){fe=Q;break}if(fe)xe=fe;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&oe.y+ge.size.y<=xe.canvas.height&&oe.height>=ge.size.y&&oe.x+ge.size.x<=xe.canvas.width)se=!0;else{const Q=this._createNewPage();xe=Q,oe=Q.currentRow,oe.height=ge.size.y,se=!0}}se||(xe.currentRow.height>0&&xe.fixedRows.push(xe.currentRow),oe={x:0,y:xe.currentRow.y+xe.currentRow.height,height:ge.size.y},xe.fixedRows.push(oe),xe.currentRow={x:0,y:oe.y+oe.height,height:0})}if(oe.x+ge.size.x<=xe.canvas.width)break;oe===xe.currentRow?(oe.x=0,oe.y+=oe.height,oe.height=0):xe.fixedRows.splice(xe.fixedRows.indexOf(oe),1)}return ge.texturePage=this._pages.indexOf(xe),ge.texturePosition.x=oe.x,ge.texturePosition.y=oe.y,ge.texturePositionClipSpace.x=oe.x/xe.canvas.width,ge.texturePositionClipSpace.y=oe.y/xe.canvas.height,ge.sizeClipSpace.x/=xe.canvas.width,ge.sizeClipSpace.y/=xe.canvas.height,oe.height=Math.max(oe.height,ge.size.y),oe.x+=ge.size.x,xe.ctx.putImageData(Me,ge.texturePosition.x-this._workBoundingBox.left,ge.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ge.size.x,ge.size.y),xe.addGlyph(ge),xe.version++,ge}_findGlyphBoundingBox(E,$,M,P,D,R){$.top=0;const O=P?this._config.deviceCellHeight:this._tmpCanvas.height,N=P?this._config.deviceCellWidth:M;let I=!1;for(let j=0;j<O;j++){for(let L=0;L<N;L++){const A=j*this._tmpCanvas.width*4+4*L+3;if(E.data[A]!==0){$.top=j,I=!0;break}}if(I)break}$.left=0,I=!1;for(let j=0;j<R+N;j++){for(let L=0;L<O;L++){const A=L*this._tmpCanvas.width*4+4*j+3;if(E.data[A]!==0){$.left=j,I=!0;break}}if(I)break}$.right=N,I=!1;for(let j=R+N-1;j>=R;j--){for(let L=0;L<O;L++){const A=L*this._tmpCanvas.width*4+4*j+3;if(E.data[A]!==0){$.right=j,I=!0;break}}if(I)break}$.bottom=O,I=!1;for(let j=O-1;j>=0;j--){for(let L=0;L<N;L++){const A=j*this._tmpCanvas.width*4+4*L+3;if(E.data[A]!==0){$.bottom=j,I=!0;break}}if(I)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:$.right-$.left+1,y:$.bottom-$.top+1},sizeClipSpace:{x:$.right-$.left+1,y:$.bottom-$.top+1},offset:{x:-$.left+R+(P||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-$.top+R+(P||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=S;class k{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(E){this._glyphs.push(E),this._usedPixels+=E.size.x*E.size.y}constructor(E,$,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const P of M)this._glyphs.push(...P.glyphs),this._usedPixels+=P._usedPixels;this.canvas=T(E,$,$),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function C(w,E,$,M){const P=E.rgba>>>24,D=E.rgba>>>16&255,R=E.rgba>>>8&255,O=$.rgba>>>24,N=$.rgba>>>16&255,I=$.rgba>>>8&255,j=Math.floor((Math.abs(P-O)+Math.abs(D-N)+Math.abs(R-I))/12);let L=!0;for(let A=0;A<w.data.length;A+=4)w.data[A]===P&&w.data[A+1]===D&&w.data[A+2]===R||M&&Math.abs(w.data[A]-P)+Math.abs(w.data[A+1]-D)+Math.abs(w.data[A+2]-R)<j?w.data[A+3]=0:L=!1;return L}function T(w,E,$){const M=w.createElement("canvas");return M.width=E,M.height=$,M}},577:function(a,o,l){var c=this&&this.__decorate||function(p,g,_,S){var k,C=arguments.length,T=C<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,g,_,S);else for(var w=p.length-1;w>=0;w--)(k=p[w])&&(T=(C<3?k(T):C>3?k(g,_,T):k(g,_))||T);return C>3&&T&&Object.defineProperty(g,_,T),T},d=this&&this.__param||function(p,g){return function(_,S){g(_,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=l(147),h=l(855),f=l(782),b=l(97);class y extends u.AttributeData{constructor(g,_,S){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=_,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=y;let m=o.CharacterJoinerService=class TA{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(g){const _={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(_),_.id}deregister(g){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===g)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(g);if(!_||_.length===0)return[];const S=[],k=_.translateToString(!0);let C=0,T=0,w=0,E=_.getFg(0),$=_.getBg(0);for(let M=0;M<_.getTrimmedLength();M++)if(_.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==$){if(M-C>1){const P=this._getJoinedRanges(k,w,T,_,C);for(let D=0;D<P.length;D++)S.push(P[D])}C=M,w=T,E=this._workCell.fg,$=this._workCell.bg}T+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(k,w,T,_,C);for(let P=0;P<M.length;P++)S.push(M[P])}return S}_getJoinedRanges(g,_,S,k,C){const T=g.substring(_,S);let w=[];try{w=this._characterJoiners[0].handler(T)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const $=this._characterJoiners[E].handler(T);for(let M=0;M<$.length;M++)TA._mergeRanges(w,$[M])}catch($){console.error($)}return this._stringRangesToCellRanges(w,k,C),w}_stringRangesToCellRanges(g,_,S){let k=0,C=!1,T=0,w=g[k];if(w){for(let E=S;E<this._bufferService.cols;E++){const $=_.getWidth(E),M=_.getString(E).length||h.WHITESPACE_CELL_CHAR.length;if($!==0){if(!C&&w[0]<=T&&(w[0]=E,C=!0),w[1]<=T){if(w[1]=E,w=g[++k],!w)break;w[0]<=T?(w[0]=E,C=!0):C=!1}T+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(g,_){let S=!1;for(let k=0;k<g.length;k++){const C=g[k];if(S){if(_[1]<=C[0])return g[k-1][1]=_[1],g;if(_[1]<=C[1])return g[k-1][1]=Math.max(_[1],C[1]),g.splice(k,1),g;g.splice(k,1),k--}else{if(_[1]<=C[0])return g.splice(k,0,_),g;if(_[1]<=C[1])return C[0]=Math.min(_[0],C[0]),g;_[0]<C[1]&&(C[0]=Math.min(_[0],C[0]),S=!0)}}return S?g[g.length-1][1]=_[1]:g.push(_),g}};o.CharacterJoinerService=m=c([d(0,b.IBufferService)],m)},160:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;const c=l(399);let d=0,u=0,h=0,f=0;var b,y,m,p,g;function _(k){const C=k.toString(16);return C.length<2?"0"+C:C}function S(k,C){return k<C?(C+.05)/(k+.05):(k+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(k){k.toCss=function(C,T,w,E){return E!==void 0?`#${_(C)}${_(T)}${_(w)}${_(E)}`:`#${_(C)}${_(T)}${_(w)}`},k.toRgba=function(C,T,w,E=255){return(C<<24|T<<16|w<<8|E)>>>0}}(b||(o.channels=b={})),function(k){function C(T,w){return f=Math.round(255*w),[d,u,h]=g.toChannels(T.rgba),{css:b.toCss(d,u,h,f),rgba:b.toRgba(d,u,h,f)}}k.blend=function(T,w){if(f=(255&w.rgba)/255,f===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,$=w.rgba>>16&255,M=w.rgba>>8&255,P=T.rgba>>24&255,D=T.rgba>>16&255,R=T.rgba>>8&255;return d=P+Math.round((E-P)*f),u=D+Math.round(($-D)*f),h=R+Math.round((M-R)*f),{css:b.toCss(d,u,h),rgba:b.toRgba(d,u,h)}},k.isOpaque=function(T){return(255&T.rgba)==255},k.ensureContrastRatio=function(T,w,E){const $=g.ensureContrastRatio(T.rgba,w.rgba,E);if($)return g.toColor($>>24&255,$>>16&255,$>>8&255)},k.opaque=function(T){const w=(255|T.rgba)>>>0;return[d,u,h]=g.toChannels(w),{css:b.toCss(d,u,h),rgba:w}},k.opacity=C,k.multiplyOpacity=function(T,w){return f=255&T.rgba,C(T,f*w/255)},k.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}}(y||(o.color=y={})),function(k){let C,T;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(C=E,C.globalCompositeOperation="copy",T=C.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return d=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),h=parseInt(w.slice(3,4).repeat(2),16),g.toColor(d,u,h);case 5:return d=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),h=parseInt(w.slice(3,4).repeat(2),16),f=parseInt(w.slice(4,5).repeat(2),16),g.toColor(d,u,h,f);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return d=parseInt(E[1]),u=parseInt(E[2]),h=parseInt(E[3]),f=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),g.toColor(d,u,h,f);if(!C||!T)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=T,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[d,u,h,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(d,u,h,f),css:w}}}(m||(o.css=m={})),function(k){function C(T,w,E){const $=T/255,M=w/255,P=E/255;return .2126*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}k.relativeLuminance=function(T){return C(T>>16&255,T>>8&255,255&T)},k.relativeLuminance2=C}(p||(o.rgb=p={})),function(k){function C(w,E,$){const M=w>>24&255,P=w>>16&255,D=w>>8&255;let R=E>>24&255,O=E>>16&255,N=E>>8&255,I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));for(;I<$&&(R>0||O>0||N>0);)R-=Math.max(0,Math.ceil(.1*R)),O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));return(R<<24|O<<16|N<<8|255)>>>0}function T(w,E,$){const M=w>>24&255,P=w>>16&255,D=w>>8&255;let R=E>>24&255,O=E>>16&255,N=E>>8&255,I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));for(;I<$&&(R<255||O<255||N<255);)R=Math.min(255,R+Math.ceil(.1*(255-R))),O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),I=S(p.relativeLuminance2(R,O,N),p.relativeLuminance2(M,P,D));return(R<<24|O<<16|N<<8|255)>>>0}k.blend=function(w,E){if(f=(255&E)/255,f===1)return E;const $=E>>24&255,M=E>>16&255,P=E>>8&255,D=w>>24&255,R=w>>16&255,O=w>>8&255;return d=D+Math.round(($-D)*f),u=R+Math.round((M-R)*f),h=O+Math.round((P-O)*f),b.toRgba(d,u,h)},k.ensureContrastRatio=function(w,E,$){const M=p.relativeLuminance(w>>8),P=p.relativeLuminance(E>>8);if(S(M,P)<$){if(P<M){const O=C(w,E,$),N=S(M,p.relativeLuminance(O>>8));if(N<$){const I=T(w,E,$);return N>S(M,p.relativeLuminance(I>>8))?O:I}return O}const D=T(w,E,$),R=S(M,p.relativeLuminance(D>>8));if(R<$){const O=C(w,E,$);return R>S(M,p.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=C,k.increaseLuminance=T,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,E,$,M){return{css:b.toCss(w,E,$,M),rgba:b.toRgba(w,E,$,M)}}}(g||(o.rgba=g={})),o.toPaddedHex=_,o.contrastRatio=S},345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},859:(a,o)=>{function l(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(d,u,h){this._data[d]||(this._data[d]={}),this._data[d][u]=h}get(d,u){return this._data[d]?this._data[d][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,d,u,h,f){this._data.get(c,d)||this._data.set(c,d,new l),this._data.get(c,d).set(u,h,f)}get(c,d,u,h){var f;return(f=this._data.get(c,d))==null?void 0:f.get(u,h)}clear(){this._data.clear()}}},399:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u";const l=o.isNode?"node":navigator.userAgent,c=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const d=l.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},385:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(399);class d{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let b=0,y=0,m=f.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),y=Math.max(b,y),p=f.timeRemaining(),1.5*y>p)return m-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-b))}ms`),void this._start();m=p}this.clear()}}class u extends d{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const b=Date.now()+f;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},147:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,h=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=h}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},782:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(133),d=l(855),u=l(147);class h extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const y=new h;return y.setFromCharData(b),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(b[d.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(b[d.CHAR_DATA_CHAR_INDEX].length===2){const m=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const p=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(m-55296)+p-56320+65536|b[d.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=b[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[d.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=b[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=h},855:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},133:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,c=0,d=l.length){let u="";for(let h=c;h<d;++h){let f=l[h];f>65535?(f-=65536,u+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):u+=String.fromCharCode(f)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const d=l.length;if(!d)return 0;let u=0,h=0;if(this._interim){const f=l.charCodeAt(h++);56320<=f&&f<=57343?c[u++]=1024*(this._interim-55296)+f-56320+65536:(c[u++]=this._interim,c[u++]=f),this._interim=0}for(let f=h;f<d;++f){const b=l.charCodeAt(f);if(55296<=b&&b<=56319){if(++f>=d)return this._interim=b,u;const y=l.charCodeAt(f);56320<=y&&y<=57343?c[u++]=1024*(b-55296)+y-56320+65536:(c[u++]=b,c[u++]=y)}else b!==65279&&(c[u++]=b)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const d=l.length;if(!d)return 0;let u,h,f,b,y=0,m=0,p=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let C,T=0;for(;(C=63&this.interim[++T])&&T<4;)k<<=6,k|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-T;for(;p<E;){if(p>=d)return 0;if(C=l[p++],(192&C)!=128){p--,S=!0;break}this.interim[T++]=C,k<<=6,k|=63&C}S||(w===2?k<128?p--:c[y++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const g=d-4;let _=p;for(;_<d;){for(;!(!(_<g)||128&(u=l[_])||128&(h=l[_+1])||128&(f=l[_+2])||128&(b=l[_+3]));)c[y++]=u,c[y++]=h,c[y++]=f,c[y++]=b,_+=4;if(u=l[_++],u<128)c[y++]=u;else if((224&u)==192){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(m=(31&u)<<6|63&h,m<128){_--;continue}c[y++]=m}else if((240&u)==224){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,y;if(f=l[_++],(192&f)!=128){_--;continue}if(m=(15&u)<<12|(63&h)<<6|63&f,m<2048||m>=55296&&m<=57343||m===65279)continue;c[y++]=m}else if((248&u)==240){if(_>=d)return this.interim[0]=u,y;if(h=l[_++],(192&h)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,y;if(f=l[_++],(192&f)!=128){_--;continue}if(_>=d)return this.interim[0]=u,this.interim[1]=h,this.interim[2]=f,y;if(b=l[_++],(192&b)!=128){_--;continue}if(m=(7&u)<<18|(63&h)<<12|(63&f)<<6|63&b,m<65536||m>1114111)continue;c[y++]=m}}return y}}},776:function(a,o,l){var c=this&&this.__decorate||function(m,p,g,_){var S,k=arguments.length,C=k<3?p:_===null?_=Object.getOwnPropertyDescriptor(p,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,p,g,_);else for(var T=m.length-1;T>=0;T--)(S=m[T])&&(C=(k<3?S(C):k>3?S(p,g,C):S(p,g))||C);return k>3&&C&&Object.defineProperty(p,g,C),C},d=this&&this.__param||function(m,p){return function(g,_){p(g,_,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=l(859),h=l(97),f={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF};let b,y=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let p=0;p<m.length;p++)typeof m[p]=="function"&&(m[p]=m[p]())}_log(m,p,g){this._evalLazyOptionalParams(g),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...g)}trace(m,...p){var g;this._logLevel<=h.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,m,p)}debug(m,...p){var g;this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,m,p)}info(m,...p){var g;this._logLevel<=h.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,m,p)}warn(m,...p){var g;this._logLevel<=h.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,m,p)}error(m,...p){var g;this._logLevel<=h.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,m,p)}};o.LogService=y=c([d(0,h.IOptionsService)],y),o.setTraceLogger=function(m){b=m},o.traceCall=function(m,p,g){if(typeof g.value!="function")throw new Error("not supported");const _=g.value;g.value=function(...S){if(b.logLevel!==h.LogLevelEnum.TRACE)return _.apply(this,S);b.trace(`GlyphRenderer#${_.name}(${S.map(C=>JSON.stringify(C)).join(", ")})`);const k=_.apply(this,S);return b.trace(`GlyphRenderer#${_.name} return`,k),k}}},726:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[c]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const u=function(h,f,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,m,p){m[l]===m?m[c].push({id:y,index:p}):(m[c]=[{id:y,index:p}],m[l]=m)})(u,h,b)};return u.toString=()=>d,o.serviceRegistry.set(d,u),u}},97:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const c=l(726);var d;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(d||(o.LogLevelEnum=d={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.createDecorator)("DecorationService")}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasAddon=void 0;const o=i(345),l=i(859),c=i(776),d=i(949);class u extends l.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var f;return(f=this._renderer)==null?void 0:f.textureAtlas}activate(f){const b=f._core;if(!f.element)return void this.register(b.onWillOpen(()=>this.activate(f)));this._terminal=f;const y=b.coreService,m=b.optionsService,p=b.screenElement,g=b.linkifier2,_=b,S=_._bufferService,k=_._renderService,C=_._characterJoinerService,T=_._charSizeService,w=_._coreBrowserService,E=_._decorationService,$=_._logService,M=_._themeService;(0,c.setTraceLogger)($),this._renderer=new d.CanvasRenderer(f,p,g,S,T,m,C,y,w,E,M),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),k.setRenderer(this._renderer),k.handleResize(S.cols,S.rows),this.register((0,l.toDisposable)(()=>{var P;k.setRenderer(this._terminal._core._createRenderer()),k.handleResize(f.cols,f.rows),(P=this._renderer)==null||P.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var f;(f=this._renderer)==null||f.clearTextureAtlas()}}a.CanvasAddon=u})(),s})())})(EA);var $A=EA.exports,MA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const s=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(s._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,s=i._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),c=Math.max(0,parseInt(o.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),u=l-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),h=c-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(h/s.css.cell.width)),rows:Math.max(1,Math.floor(u/s.css.cell.height))}}}})(),n})())})(MA);var RA=MA.exports,AA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const d=[];for(let u=0;u<this._listeners.length;u++)d.push(this._listeners[u]);for(let u=0;u<d.length;u++)d[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(d=>c.fire(d))},o.runAndSubscribe=function(l,c){return c(void 0),l(d=>c(d))}},859:(a,o)=>{function l(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.SearchAddon=void 0;const o=i(345),l=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class d extends l.Disposable{constructor(h){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new o.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(h==null?void 0:h.highlightLimit)??1e3}activate(h){this._terminal=h,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var h;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((h=this._lastSearchOptions)!=null&&h.decorations)&&(this._highlightTimeout=setTimeout(()=>{const f=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(f,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(h){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),h||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(h,f){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const b=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,f);this._lastSearchOptions=f,f!=null&&f.decorations&&(this._cachedSearchTerm===void 0||h!==this._cachedSearchTerm||b)&&this._highlightAllMatches(h,f);const y=this._findNextAndSelect(h,f);return this._fireResults(f),this._cachedSearchTerm=h,y}_highlightAllMatches(h,f){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!h||h.length===0)return void this.clearDecorations();f=f||{},this.clearDecorations(!0);const b=[];let y,m=this._find(h,0,0,f);for(;m&&((y==null?void 0:y.row)!==m.row||(y==null?void 0:y.col)!==m.col)&&!(b.length>=this._highlightLimit);)y=m,b.push(y),m=this._find(h,y.col+y.term.length>=this._terminal.cols?y.row+1:y.row,y.col+y.term.length>=this._terminal.cols?0:y.col+1,f);for(const p of b){const g=this._createResultDecoration(p,f.decorations);g&&(this._highlightedLines.add(g.marker.line),this._highlightDecorations.push({decoration:g,match:p,dispose(){g.dispose()}}))}}_find(h,f,b,y){var g;if(!this._terminal||!h||h.length===0)return(g=this._terminal)==null||g.clearSelection(),void this.clearDecorations();if(b>this._terminal.cols)throw new Error(`Invalid col: ${b} to search in terminal of ${this._terminal.cols} cols`);let m;this._initLinesCache();const p={startRow:f,startCol:b};if(m=this._findInLine(h,p,y),!m)for(let _=f+1;_<this._terminal.buffer.active.baseY+this._terminal.rows&&(p.startRow=_,p.startCol=0,m=this._findInLine(h,p,y),!m);_++);return m}_findNextAndSelect(h,f){var _;if(!this._terminal||!h||h.length===0)return(_=this._terminal)==null||_.clearSelection(),this.clearDecorations(),!1;const b=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=0,m=0;b&&(this._cachedSearchTerm===h?(y=b.end.x,m=b.end.y):(y=b.start.x,m=b.start.y)),this._initLinesCache();const p={startRow:m,startCol:y};let g=this._findInLine(h,p,f);if(!g)for(let S=m+1;S<this._terminal.buffer.active.baseY+this._terminal.rows&&(p.startRow=S,p.startCol=0,g=this._findInLine(h,p,f),!g);S++);if(!g&&m!==0)for(let S=0;S<m&&(p.startRow=S,p.startCol=0,g=this._findInLine(h,p,f),!g);S++);return!g&&b&&(p.startRow=b.start.y,p.startCol=0,g=this._findInLine(h,p,f)),this._selectResult(g,f==null?void 0:f.decorations,f==null?void 0:f.noScroll)}findPrevious(h,f){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const b=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,f);this._lastSearchOptions=f,f!=null&&f.decorations&&(this._cachedSearchTerm===void 0||h!==this._cachedSearchTerm||b)&&this._highlightAllMatches(h,f);const y=this._findPreviousAndSelect(h,f);return this._fireResults(f),this._cachedSearchTerm=h,y}_didOptionsChange(h,f){return!!f&&(h.caseSensitive!==f.caseSensitive||h.regex!==f.regex||h.wholeWord!==f.wholeWord)}_fireResults(h){if(h!=null&&h.decorations){let f=-1;if(this._selectedDecoration.value){const b=this._selectedDecoration.value.match;for(let y=0;y<this._highlightDecorations.length;y++){const m=this._highlightDecorations[y].match;if(m.row===b.row&&m.col===b.col&&m.size===b.size){f=y;break}}}this._onDidChangeResults.fire({resultIndex:f,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(h,f){var S;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!h||h.length===0)return(S=this._terminal)==null||S.clearSelection(),this.clearDecorations(),!1;const b=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=this._terminal.buffer.active.baseY+this._terminal.rows-1,m=this._terminal.cols;const p=!0;this._initLinesCache();const g={startRow:y,startCol:m};let _;if(b&&(g.startRow=y=b.start.y,g.startCol=m=b.start.x,this._cachedSearchTerm!==h&&(_=this._findInLine(h,g,f,!1),_||(g.startRow=y=b.end.y,g.startCol=m=b.end.x))),_||(_=this._findInLine(h,g,f,p)),!_){g.startCol=Math.max(g.startCol,this._terminal.cols);for(let k=y-1;k>=0&&(g.startRow=k,_=this._findInLine(h,g,f,p),!_);k--);}if(!_&&y!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let k=this._terminal.buffer.active.baseY+this._terminal.rows-1;k>=y&&(g.startRow=k,_=this._findInLine(h,g,f,p),!_);k--);return this._selectResult(_,f==null?void 0:f.decorations,f==null?void 0:f.noScroll)}_initLinesCache(){const h=this._terminal;this._linesCache||(this._linesCache=new Array(h.buffer.active.length),this._cursorMoveListener=h.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=h.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(h,f,b){return(h===0||c.includes(f[h-1]))&&(h+b.length===f.length||c.includes(f[h+b.length]))}_findInLine(h,f,b={},y=!1){var M;const m=this._terminal,p=f.startRow,g=f.startCol,_=m.buffer.active.getLine(p);if(_!=null&&_.isWrapped)return y?void(f.startCol+=m.cols):(f.startRow--,f.startCol+=m.cols,this._findInLine(h,f,b));let S=(M=this._linesCache)==null?void 0:M[p];S||(S=this._translateBufferLineToStringWithWrap(p,!0),this._linesCache&&(this._linesCache[p]=S));const[k,C]=S,T=this._bufferColsToStringOffset(p,g),w=b.caseSensitive?h:h.toLowerCase(),E=b.caseSensitive?k:k.toLowerCase();let $=-1;if(b.regex){const P=RegExp(w,"g");let D;if(y)for(;D=P.exec(E.slice(0,T));)$=P.lastIndex-D[0].length,h=D[0],P.lastIndex-=h.length-1;else D=P.exec(E.slice(T)),D&&D[0].length>0&&($=T+(P.lastIndex-D[0].length),h=D[0])}else y?T-w.length>=0&&($=E.lastIndexOf(w,T-w.length)):$=E.indexOf(w,T);if($>=0){if(b.wholeWord&&!this._isWholeWord($,E,h))return;let P=0;for(;P<C.length-1&&$>=C[P+1];)P++;let D=P;for(;D<C.length-1&&$+h.length>=C[D+1];)D++;const R=$-C[P],O=$+h.length-C[D],N=this._stringLengthToBufferSize(p+P,R);return{term:h,col:N,row:p+P,size:this._stringLengthToBufferSize(p+D,O)-N+m.cols*(D-P)}}}_stringLengthToBufferSize(h,f){const b=this._terminal.buffer.active.getLine(h);if(!b)return 0;for(let y=0;y<f;y++){const m=b.getCell(y);if(!m)break;const p=m.getChars();p.length>1&&(f-=p.length-1);const g=b.getCell(y+1);g&&g.getWidth()===0&&f++}return f}_bufferColsToStringOffset(h,f){const b=this._terminal;let y=h,m=0,p=b.buffer.active.getLine(y);for(;f>0&&p;){for(let g=0;g<f&&g<b.cols;g++){const _=p.getCell(g);if(!_)break;_.getWidth()&&(m+=_.getCode()===0?1:_.getChars().length)}if(y++,p=b.buffer.active.getLine(y),p&&!p.isWrapped)break;f-=b.cols}return m}_translateBufferLineToStringWithWrap(h,f){var g;const b=this._terminal,y=[],m=[0];let p=b.buffer.active.getLine(h);for(;p;){const _=b.buffer.active.getLine(h+1),S=!!_&&_.isWrapped;let k=p.translateToString(!S&&f);if(S&&_){const C=p.getCell(p.length-1);C&&C.getCode()===0&&C.getWidth()===1&&((g=_.getCell(0))==null?void 0:g.getWidth())===2&&(k=k.slice(0,-1))}if(y.push(k),!S)break;m.push(m[m.length-1]+k.length),h++,p=_}return[y.join(""),m]}_selectResult(h,f,b){const y=this._terminal;if(this._selectedDecoration.clear(),!h)return y.clearSelection(),!1;if(y.select(h.col,h.row,h.size),f){const m=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+h.row);if(m){const p=y.registerDecoration({marker:m,x:h.col,width:h.size,backgroundColor:f.activeMatchBackground,layer:"top",overviewRulerOptions:{color:f.activeMatchColorOverviewRuler}});if(p){const g=[];g.push(m),g.push(p.onRender(_=>this._applyStyles(_,f.activeMatchBorder,!0))),g.push(p.onDispose(()=>(0,l.disposeArray)(g))),this._selectedDecoration.value={decoration:p,match:h,dispose(){p.dispose()}}}}}if(!b&&(h.row>=y.buffer.active.viewportY+y.rows||h.row<y.buffer.active.viewportY)){let m=h.row-y.buffer.active.viewportY;m-=Math.floor(y.rows/2),y.scrollLines(m)}return!0}_applyStyles(h,f,b){h.classList.contains("xterm-find-result-decoration")||(h.classList.add("xterm-find-result-decoration"),f&&(h.style.outline=`1px solid ${f}`)),b&&h.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(h,f){const b=this._terminal,y=b.registerMarker(-b.buffer.active.baseY-b.buffer.active.cursorY+h.row);if(!y)return;const m=b.registerDecoration({marker:y,x:h.col,width:h.size,backgroundColor:f.matchBackground,overviewRulerOptions:this._highlightedLines.has(y.line)?void 0:{color:f.matchOverviewRuler,position:"center"}});if(m){const p=[];p.push(y),p.push(m.onRender(g=>this._applyStyles(g,f.matchBorder,!1))),p.push(m.onDispose(()=>(0,l.disposeArray)(p)))}return m}}a.SearchAddon=d})(),s})())})(AA);var LA=AA.exports,DA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(c,d,u,h={}){this._terminal=c,this._regex=d,this._handler=u,this._options=h}provideLinks(c,d){const u=l.computeLink(c,this._regex,this._terminal,this._handler);d(this._addCallbacks(u))}_addCallbacks(c){return c.map(d=>(d.leave=this._options.leave,d.hover=(u,h)=>{if(this._options.hover){const{range:f}=d;this._options.hover(u,h,f)}},d))}};class l{static computeLink(d,u,h,f){const b=new RegExp(u.source,(u.flags||"")+"g"),[y,m]=l._getWindowedLineStrings(d-1,h),p=y.join("");let g;const _=[];for(;g=b.exec(p);){const S=g[0];try{const $=new URL(S),M=decodeURI($.toString());if(S!==M&&S+"/"!==M)continue}catch{continue}const[k,C]=l._mapStrIdx(h,m,0,g.index),[T,w]=l._mapStrIdx(h,k,C,S.length);if(k===-1||C===-1||T===-1||w===-1)continue;const E={start:{x:C+1,y:k+1},end:{x:w,y:T+1}};_.push({range:E,text:S,activate:f})}return _}static _getWindowedLineStrings(d,u){let h,f=d,b=d,y=0,m="";const p=[];if(h=u.buffer.active.getLine(d)){const g=h.translateToString(!0);if(h.isWrapped&&g[0]!==" "){for(y=0;(h=u.buffer.active.getLine(--f))&&y<2048&&(m=h.translateToString(!0),y+=m.length,p.push(m),h.isWrapped&&m.indexOf(" ")===-1););p.reverse()}for(p.push(g),y=0;(h=u.buffer.active.getLine(++b))&&h.isWrapped&&y<2048&&(m=h.translateToString(!0),y+=m.length,p.push(m),m.indexOf(" ")===-1););}return[p,f]}static _mapStrIdx(d,u,h,f){const b=d.buffer.active,y=b.getNullCell();let m=h;for(;f;){const p=b.getLine(u);if(!p)return[-1,-1];for(let g=m;g<p.length;++g){p.getCell(g,y);const _=y.getChars();if(y.getWidth()&&(f-=_.length||1,g===p.length-1&&_==="")){const S=b.getLine(u+1);S&&S.isWrapped&&(S.getCell(0,y),y.getWidth()===2&&(f+=1))}if(f<0)return[u,g]}u++,m=0}return[u,m]}}o.LinkComputer=l}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=i(6),l=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(d,u){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(d=c,u={}){this._handler=d,this._options=u}activate(d){this._terminal=d;const u=this._options,h=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,h,this._handler,u))}dispose(){var d;(d=this._linkProvider)==null||d.dispose()}}})(),s})())})(DA);var PA=DA.exports;/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Lq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const me=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:o="",children:l,...c},d)=>x.createElement("svg",{ref:d,...Lq,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:["lucide",`lucide-${Dq(e)}`,o].join(" "),...c},[...t.map(([u,h])=>x.createElement(u,h)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pq=me("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oq=me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nq=me("BarChartHorizontal",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Iq=me("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jq=me("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bq=me("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fq=me("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zq=me("CaseSensitive",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["circle",{cx:"18",cy:"12",r:"3",key:"1kchzo"}],["path",{d:"M21 9v6",key:"anns31"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ES=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ku=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hq=me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OA=me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NA=me("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hx=me("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wq=me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uq=me("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vq=me("CircleChevronRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qq=me("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kq=me("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gq=me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yq=me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xq=me("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qq=me("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LE=me("CloudDownload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m8 17 4 4 4-4",key:"1ul180"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jq=me("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zq=me("Dna",[["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m17 6-2.5-2.5",key:"5cdfhj"}],["path",{d:"m14 8-1-1",key:"15nbz5"}],["path",{d:"m7 18 2.5 2.5",key:"16tu1a"}],["path",{d:"m3.5 14.5.5.5",key:"hapbhd"}],["path",{d:"m20 9 .5.5",key:"1n7z02"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m10 16 1.5 1.5",key:"11lckj"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jo=me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eK=me("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tK=me("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nK=me("FilePen",[["path",{d:"M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v10",key:"x7tsz2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10.4 12.6a2 2 0 1 1 3 3L8 21l-4 1 1-4Z",key:"o3xyfb"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rK=me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iK=me("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sK=me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bg=me("Gavel",[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oK=me("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aK=me("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lK=me("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TS=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cK=me("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uK=me("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dK=me("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fg=me("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dn=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hK=me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fK=me("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pK=me("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DE=me("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mK=me("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gK=me("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vK=me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yK=me("OctagonAlert",[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _K=me("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bK=me("PersonStanding",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IA=me("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jA=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xK=me("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wK=me("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SK=me("Regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CK=me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kK=me("Scroll",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EK=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TK=me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $K=me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BA=me("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MK=me("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RK=me("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AK=me("SquareUserRound",[["path",{d:"M18 21a6 6 0 0 0-12 0",key:"kaz2du"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LK=me("StarOff",[["path",{d:"M8.34 8.34 2 9.27l5 4.87L5.82 21 12 17.77 18.18 21l-.59-3.43",key:"16m0ql"}],["path",{d:"M18.42 12.76 22 9.27l-6.91-1L12 2l-1.44 2.91",key:"1vt8nq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DK=me("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PK=me("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OK=me("TimerOff",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FA=me("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NK=me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IK=me("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zg=me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zA=me("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11",key:"llx8ln"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PE=me("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $S=me("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jK=me("WholeWord",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ns=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.368.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BK=me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),sn=x.forwardRef(({className:e,type:t,...n},r)=>v.jsx("input",{type:t,className:ee("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30 placeholder:opacity-50",e),ref:r,...n}));sn.displayName="Input";var Eu=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(){}},Qc=typeof window>"u"||"Deno"in globalThis;function Ir(){}function FK(e,t){return typeof e=="function"?e(t):e}function fx(e){return typeof e=="number"&&e>=0&&e!==1/0}function HA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function OE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==MS(a,t.options))return!1}else if(!Nh(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function NE(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Va(t.options.mutationKey)!==Va(s))return!1}else if(!Nh(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function MS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Va)(e)}function Va(e){return JSON.stringify(e,(t,n)=>px(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Nh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Nh(e[n],t[n])):!1}function WA(e,t){if(e===t)return e;const n=IE(e)&&IE(t);if(n||px(e)&&px(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),a=s.length,o=n?[]:{};let l=0;for(let c=0;c<a;c++){const d=n?c:s[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(o[d]=void 0,l++):(o[d]=WA(e[d],t[d]),o[d]===e[d]&&e[d]!==void 0&&l++)}return i===a&&l===i?e:o}return t}function Hg(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 IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function px(e){if(!jE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jE(n)||!n.hasOwnProperty("isPrototypeOf"))}function jE(e){return Object.prototype.toString.call(e)==="[object Object]"}function zK(e){return new Promise(t=>{setTimeout(t,e)})}function mx(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WA(e,t):t}function HK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var RS=Symbol(),Ca,lo,Tc,q$,UK=(q$=class extends Eu{constructor(){super();Ee(this,Ca,void 0);Ee(this,lo,void 0);Ee(this,Tc,void 0);_e(this,Tc,t=>{if(!Qc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Y(this,lo)||this.setEventListener(Y(this,Tc))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,lo))==null||t.call(this),_e(this,lo,void 0))}setEventListener(t){var n;_e(this,Tc,t),(n=Y(this,lo))==null||n.call(this),_e(this,lo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Y(this,Ca)!==t&&(_e(this,Ca,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Y(this,Ca)=="boolean"?Y(this,Ca):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ca=new WeakMap,lo=new WeakMap,Tc=new WeakMap,q$),AS=new UK,$c,co,Mc,K$,VK=(K$=class extends Eu{constructor(){super();Ee(this,$c,!0);Ee(this,co,void 0);Ee(this,Mc,void 0);_e(this,Mc,t=>{if(!Qc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Y(this,co)||this.setEventListener(Y(this,Mc))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,co))==null||t.call(this),_e(this,co,void 0))}setEventListener(t){var n;_e(this,Mc,t),(n=Y(this,co))==null||n.call(this),_e(this,co,t(this.setOnline.bind(this)))}setOnline(t){Y(this,$c)!==t&&(_e(this,$c,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Y(this,$c)}},$c=new WeakMap,co=new WeakMap,Mc=new WeakMap,K$),Wg=new VK;function qK(e){return Math.min(1e3*2**e,3e4)}function LS(e){return(e??"online")==="online"?Wg.isOnline():!0}var UA=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Xy(e){return e instanceof UA}function VA(e){let t=!1,n=0,r=!1,i,s,a;const o=new Promise((m,p)=>{s=m,a=p}),l=m=>{var p;r||(f(new UA(m)),(p=e.abort)==null||p.call(e))},c=()=>{t=!0},d=()=>{t=!1},u=()=>!AS.isFocused()||e.networkMode!=="always"&&!Wg.isOnline(),h=m=>{var p;r||(r=!0,(p=e.onSuccess)==null||p.call(e,m),i==null||i(),s(m))},f=m=>{var p;r||(r=!0,(p=e.onError)==null||p.call(e,m),i==null||i(),a(m))},b=()=>new Promise(m=>{var p;i=g=>{const _=r||!u();return _&&m(g),_},(p=e.onPause)==null||p.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),y=()=>{if(r)return;let m;try{m=e.fn()}catch(p){m=Promise.reject(p)}Promise.resolve(m).then(h).catch(p=>{var C;if(r)return;const g=e.retry??(Qc?0:3),_=e.retryDelay??qK,S=typeof _=="function"?_(n,p):_,k=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,p);if(t||!k){f(p);return}n++,(C=e.onFail)==null||C.call(e,n,p),zK(S).then(()=>{if(u())return b()}).then(()=>{t?f(p):y()})})};return LS(e.networkMode)?y():b().then(y),{promise:o,cancel:l,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:c,continueRetry:d}}function KK(){let e=[],t=0,n=h=>{h()},r=h=>{h()},i=h=>setTimeout(h,0);const s=h=>{i=h},a=h=>{let f;t++;try{f=h()}finally{t--,t||c()}return f},o=h=>{t?e.push(h):i(()=>{n(h)})},l=h=>(...f)=>{o(()=>{h(...f)})},c=()=>{const h=e;e=[],h.length&&i(()=>{r(()=>{h.forEach(f=>{n(f)})})})};return{batch:a,batchCalls:l,schedule:o,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:s}}var mn=KK(),ka,G$,qA=(G$=class{constructor(){Ee(this,ka,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fx(this.gcTime)&&_e(this,ka,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qc?1/0:5*60*1e3))}clearGcTimeout(){Y(this,ka)&&(clearTimeout(Y(this,ka)),_e(this,ka,void 0))}},ka=new WeakMap,G$),Rc,Ac,Or,Vn,Sn,gf,Ea,li,fs,Y$,GK=(Y$=class extends qA{constructor(t){super();Ee(this,li);Ee(this,Rc,void 0);Ee(this,Ac,void 0);Ee(this,Or,void 0);Ee(this,Vn,void 0);Ee(this,Sn,void 0);Ee(this,gf,void 0);Ee(this,Ea,void 0);_e(this,Ea,!1),_e(this,gf,t.defaultOptions),this.setOptions(t.options),_e(this,Sn,[]),_e(this,Or,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,Rc,t.state||YK(this.options)),this.state=Y(this,Rc),this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...Y(this,gf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!Y(this,Sn).length&&this.state.fetchStatus==="idle"&&Y(this,Or).remove(this)}setData(t,n){const r=mx(this.state.data,t,this.options);return Ue(this,li,fs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ue(this,li,fs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Y(this,Vn))==null?void 0:r.promise;return(i=Y(this,Vn))==null||i.cancel(t),n?n.then(Ir).catch(Ir):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Rc))}isActive(){return Y(this,Sn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?Y(this,Sn).some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!HA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Y(this,Sn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,Vn))==null||n.continue()}onOnline(){var n;const t=Y(this,Sn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,Vn))==null||n.continue()}addObserver(t){Y(this,Sn).includes(t)||(Y(this,Sn).push(t),this.clearGcTimeout(),Y(this,Or).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Y(this,Sn).includes(t)&&(_e(this,Sn,Y(this,Sn).filter(n=>n!==t)),Y(this,Sn).length||(Y(this,Vn)&&(Y(this,Ea)?Y(this,Vn).cancel({revert:!0}):Y(this,Vn).cancelRetry()),this.scheduleGc()),Y(this,Or).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Y(this,Sn).length}invalidate(){this.state.isInvalidated||Ue(this,li,fs).call(this,{type:"invalidate"})}fetch(t,n){var c,d,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Y(this,Vn))return Y(this,Vn).continueRetry(),Y(this,Vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=Y(this,Sn).find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(_e(this,Ea,!0),r.signal)})};s(i);const a=()=>!this.options.queryFn||this.options.queryFn===RS?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(_e(this,Ea,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)),o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),_e(this,Ac,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&Ue(this,li,fs).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const l=h=>{var f,b,y,m;Xy(h)&&h.silent||Ue(this,li,fs).call(this,{type:"error",error:h}),Xy(h)||((b=(f=Y(this,Or).config).onError)==null||b.call(f,h,this),(m=(y=Y(this,Or).config).onSettled)==null||m.call(y,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return _e(this,Vn,VA({fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var f,b,y,m;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(h),(b=(f=Y(this,Or).config).onSuccess)==null||b.call(f,h,this),(m=(y=Y(this,Or).config).onSettled)==null||m.call(y,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(h,f)=>{Ue(this,li,fs).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Ue(this,li,fs).call(this,{type:"pause"})},onContinue:()=>{Ue(this,li,fs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode})),Y(this,Vn).promise}},Rc=new WeakMap,Ac=new WeakMap,Or=new WeakMap,Vn=new WeakMap,Sn=new WeakMap,gf=new WeakMap,Ea=new WeakMap,li=new WeakSet,fs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KA(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Xy(i)&&i.revert&&Y(this,Ac)?{...Y(this,Ac),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),mn.batch(()=>{Y(this,Sn).forEach(r=>{r.onQueryUpdate()}),Y(this,Or).notify({query:this,type:"updated",action:t})})},Y$);function KA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function YK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ni,X$,XK=(X$=class extends Eu{constructor(t={}){super();Ee(this,Ni,void 0);this.config=t,_e(this,Ni,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??MS(i,n);let a=this.get(s);return a||(a=new GK({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){Y(this,Ni).has(t.queryHash)||(Y(this,Ni).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Y(this,Ni).get(t.queryHash);n&&(t.destroy(),n===t&&Y(this,Ni).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){mn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Y(this,Ni).get(t)}getAll(){return[...Y(this,Ni).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>OE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>OE(t,r)):n}notify(t){mn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){mn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){mn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ni=new WeakMap,X$),Ii,vf,wr,Lc,ji,Js,Q$,QK=(Q$=class extends qA{constructor(t){super();Ee(this,ji);Ee(this,Ii,void 0);Ee(this,vf,void 0);Ee(this,wr,void 0);Ee(this,Lc,void 0);this.mutationId=t.mutationId,_e(this,vf,t.defaultOptions),_e(this,wr,t.mutationCache),_e(this,Ii,[]),this.state=t.state||GA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Y(this,vf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Y(this,Ii).includes(t)||(Y(this,Ii).push(t),this.clearGcTimeout(),Y(this,wr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,Ii,Y(this,Ii).filter(n=>n!==t)),this.scheduleGc(),Y(this,wr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Y(this,Ii).length||(this.state.status==="pending"?this.scheduleGc():Y(this,wr).remove(this))}continue(){var t;return((t=Y(this,Lc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,o,l,c,d,u,h,f,b,y,m,p,g,_,S,k,C,T;const n=()=>(_e(this,Lc,VA({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,E)=>{Ue(this,ji,Js).call(this,{type:"failed",failureCount:w,error:E})},onPause:()=>{Ue(this,ji,Js).call(this,{type:"pause"})},onContinue:()=>{Ue(this,ji,Js).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Y(this,Lc).promise),r=this.state.status==="pending";try{if(!r){Ue(this,ji,Js).call(this,{type:"pending",variables:t}),await((s=(i=Y(this,wr).config).onMutate)==null?void 0:s.call(i,t,this));const E=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,t));E!==this.state.context&&Ue(this,ji,Js).call(this,{type:"pending",context:E,variables:t})}const w=await n();return await((c=(l=Y(this,wr).config).onSuccess)==null?void 0:c.call(l,w,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,w,t,this.state.context)),await((f=(h=Y(this,wr).config).onSettled)==null?void 0:f.call(h,w,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,w,null,t,this.state.context)),Ue(this,ji,Js).call(this,{type:"success",data:w}),w}catch(w){try{throw await((p=(m=Y(this,wr).config).onError)==null?void 0:p.call(m,w,t,this.state.context,this)),await((_=(g=this.options).onError)==null?void 0:_.call(g,w,t,this.state.context)),await((k=(S=Y(this,wr).config).onSettled)==null?void 0:k.call(S,void 0,w,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,w,t,this.state.context)),w}finally{Ue(this,ji,Js).call(this,{type:"error",error:w})}}}},Ii=new WeakMap,vf=new WeakMap,wr=new WeakMap,Lc=new WeakMap,ji=new WeakSet,Js=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!LS(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),mn.batch(()=>{Y(this,Ii).forEach(r=>{r.onMutationUpdate(t)}),Y(this,wr).notify({mutation:this,type:"updated",action:t})})},Q$);function GA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nr,yf,Ta,J$,JK=(J$=class extends Eu{constructor(t={}){super();Ee(this,Nr,void 0);Ee(this,yf,void 0);Ee(this,Ta,void 0);this.config=t,_e(this,Nr,[]),_e(this,yf,0)}build(t,n,r){const i=new QK({mutationCache:this,mutationId:++mp(this,yf)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Y(this,Nr).push(t),this.notify({type:"added",mutation:t})}remove(t){_e(this,Nr,Y(this,Nr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){mn.batch(()=>{Y(this,Nr).forEach(t=>{this.remove(t)})})}getAll(){return Y(this,Nr)}find(t){const n={exact:!0,...t};return Y(this,Nr).find(r=>NE(n,r))}findAll(t={}){return Y(this,Nr).filter(n=>NE(t,n))}notify(t){mn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return _e(this,Ta,(Y(this,Ta)??Promise.resolve()).then(()=>{const t=Y(this,Nr).filter(n=>n.state.isPaused);return mn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ir)),Promise.resolve()))}).then(()=>{_e(this,Ta,void 0)})),Y(this,Ta)}},Nr=new WeakMap,yf=new WeakMap,Ta=new WeakMap,J$);function ZK(e){return{onFetch:(t,n)=>{const r=async()=>{var b,y,m,p,g;const i=t.options,s=(m=(y=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:y.fetchMore)==null?void 0:m.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},u=t.options.queryFn&&t.options.queryFn!==RS?t.options.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`)),h=async(_,S,k)=>{if(c)return Promise.reject();if(S==null&&_.pages.length)return Promise.resolve(_);const C={queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};d(C);const T=await u(C),{maxPages:w}=t.options,E=k?WK:HK;return{pages:E(_.pages,T,w),pageParams:E(_.pageParams,S,w)}};let f;if(s&&a.length){const _=s==="backward",S=_?eG:BE,k={pages:a,pageParams:o},C=S(i,k);f=await h(k,C,_)}else{f=await h(l,o[0]??i.initialPageParam);const _=e??a.length;for(let S=1;S<_;S++){const k=BE(i,f);f=await h(f,k)}}return f};t.options.persister?t.fetchFn=()=>{var i,s;return(s=(i=t.options).persister)==null?void 0:s.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function BE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function eG(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Zt,uo,ho,Dc,Pc,fo,Oc,Nc,Z$,tG=(Z$=class{constructor(e={}){Ee(this,Zt,void 0);Ee(this,uo,void 0);Ee(this,ho,void 0);Ee(this,Dc,void 0);Ee(this,Pc,void 0);Ee(this,fo,void 0);Ee(this,Oc,void 0);Ee(this,Nc,void 0);_e(this,Zt,e.queryCache||new XK),_e(this,uo,e.mutationCache||new JK),_e(this,ho,e.defaultOptions||{}),_e(this,Dc,new Map),_e(this,Pc,new Map),_e(this,fo,0)}mount(){mp(this,fo)._++,Y(this,fo)===1&&(_e(this,Oc,AS.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,Zt).onFocus())})),_e(this,Nc,Wg.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,Zt).onOnline())})))}unmount(){var e,t;mp(this,fo)._--,Y(this,fo)===0&&((e=Y(this,Oc))==null||e.call(this),_e(this,Oc,void 0),(t=Y(this,Nc))==null||t.call(this),_e(this,Nc,void 0))}isFetching(e){return Y(this,Zt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,uo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,Zt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=Y(this,Zt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(n.staleTime)&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return Y(this,Zt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Y(this,Zt).get(r.queryHash),s=i==null?void 0:i.state.data,a=FK(t,s);if(a!==void 0)return Y(this,Zt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return mn.batch(()=>Y(this,Zt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,Zt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Y(this,Zt);mn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Y(this,Zt),r={type:"active",...e};return mn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=mn.batch(()=>Y(this,Zt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ir).catch(Ir)}invalidateQueries(e={},t={}){return mn.batch(()=>{if(Y(this,Zt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=mn.batch(()=>Y(this,Zt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ir)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ir)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Y(this,Zt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ir).catch(Ir)}fetchInfiniteQuery(e){return e.behavior=ZK(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ir).catch(Ir)}resumePausedMutations(){return Wg.isOnline()?Y(this,uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,Zt)}getMutationCache(){return Y(this,uo)}getDefaultOptions(){return Y(this,ho)}setDefaultOptions(e){_e(this,ho,e)}setQueryDefaults(e,t){Y(this,Dc).set(Va(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Y(this,Dc).values()];let n={};return t.forEach(r=>{Nh(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Y(this,Pc).set(Va(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Y(this,Pc).values()];let n={};return t.forEach(r=>{Nh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Y(this,ho).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=MS(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.enabled!==!0&&t.queryFn===RS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,ho).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,Zt).clear(),Y(this,uo).clear()}},Zt=new WeakMap,uo=new WeakMap,ho=new WeakMap,Dc=new WeakMap,Pc=new WeakMap,fo=new WeakMap,Oc=new WeakMap,Nc=new WeakMap,Z$),rr,Tt,_f,qn,$a,Ic,Bi,bf,jc,Bc,Ma,Ra,po,Fc,Aa,Ud,xf,gx,wf,vx,Sf,yx,Cf,_x,kf,bx,Ef,xx,Tf,wx,I0,YA,e7,nG=(e7=class extends Eu{constructor(t,n){super();Ee(this,Aa);Ee(this,xf);Ee(this,wf);Ee(this,Sf);Ee(this,Cf);Ee(this,kf);Ee(this,Ef);Ee(this,Tf);Ee(this,I0);Ee(this,rr,void 0);Ee(this,Tt,void 0);Ee(this,_f,void 0);Ee(this,qn,void 0);Ee(this,$a,void 0);Ee(this,Ic,void 0);Ee(this,Bi,void 0);Ee(this,bf,void 0);Ee(this,jc,void 0);Ee(this,Bc,void 0);Ee(this,Ma,void 0);Ee(this,Ra,void 0);Ee(this,po,void 0);Ee(this,Fc,new Set);this.options=n,_e(this,rr,t),_e(this,Bi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,Tt).addObserver(this),FE(Y(this,Tt),this.options)?Ue(this,Aa,Ud).call(this):this.updateResult(),Ue(this,Cf,_x).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sx(Y(this,Tt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sx(Y(this,Tt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,kf,bx).call(this),Ue(this,Ef,xx).call(this),Y(this,Tt).removeObserver(this)}setOptions(t,n){const r=this.options,i=Y(this,Tt);if(this.options=Y(this,rr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Ue(this,Tf,wx).call(this),Y(this,Tt).setOptions(this.options),r._defaulted&&!Hg(this.options,r)&&Y(this,rr).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,Tt),observer:this});const s=this.hasListeners();s&&zE(Y(this,Tt),i,this.options,r)&&Ue(this,Aa,Ud).call(this),this.updateResult(n),s&&(Y(this,Tt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ue(this,xf,gx).call(this);const a=Ue(this,wf,vx).call(this);s&&(Y(this,Tt)!==i||this.options.enabled!==r.enabled||a!==Y(this,po))&&Ue(this,Sf,yx).call(this,a)}getOptimisticResult(t){const n=Y(this,rr).getQueryCache().build(Y(this,rr),t),r=this.createResult(n,t);return iG(this,r)&&(_e(this,qn,r),_e(this,Ic,this.options),_e(this,$a,Y(this,Tt).state)),r}getCurrentResult(){return Y(this,qn)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){Y(this,Fc).add(t)}getCurrentQuery(){return Y(this,Tt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Y(this,rr).defaultQueryOptions(t),r=Y(this,rr).getQueryCache().build(Y(this,rr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ue(this,Aa,Ud).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,qn)))}createResult(t,n){var T;const r=Y(this,Tt),i=this.options,s=Y(this,qn),a=Y(this,$a),o=Y(this,Ic),c=t!==r?t.state:Y(this,_f),{state:d}=t;let u={...d},h=!1,f;if(n._optimisticResults){const w=this.hasListeners(),E=!w&&FE(t,n),$=w&&zE(t,r,n,i);(E||$)&&(u={...u,...KA(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:b,errorUpdatedAt:y,status:m}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(a==null?void 0:a.data)&&n.select===Y(this,bf))f=Y(this,jc);else try{_e(this,bf,n.select),f=n.select(u.data),f=mx(s==null?void 0:s.data,f,n),_e(this,jc,f),_e(this,Bi,null)}catch(w){_e(this,Bi,w)}else f=u.data;if(n.placeholderData!==void 0&&f===void 0&&m==="pending"){let w;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))w=s.data;else if(w=typeof n.placeholderData=="function"?n.placeholderData((T=Y(this,Bc))==null?void 0:T.state.data,Y(this,Bc)):n.placeholderData,n.select&&w!==void 0)try{w=n.select(w),_e(this,Bi,null)}catch(E){_e(this,Bi,E)}w!==void 0&&(m="success",f=mx(s==null?void 0:s.data,w,n),h=!0)}Y(this,Bi)&&(b=Y(this,Bi),f=Y(this,jc),y=Date.now(),m="error");const p=u.fetchStatus==="fetching",g=m==="pending",_=m==="error",S=g&&p,k=f!==void 0;return{status:m,fetchStatus:u.fetchStatus,isPending:g,isSuccess:m==="success",isError:_,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:u.dataUpdatedAt,error:b,errorUpdatedAt:y,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:p,isRefetching:p&&!g,isLoadingError:_&&!k,isPaused:u.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&k,isStale:DS(t,n),refetch:this.refetch}}updateResult(t){const n=Y(this,qn),r=this.createResult(Y(this,Tt),this.options);if(_e(this,$a,Y(this,Tt).state),_e(this,Ic,this.options),Y(this,$a).data!==void 0&&_e(this,Bc,Y(this,Tt)),Hg(r,n))return;_e(this,qn,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Y(this,Fc).size)return!0;const l=new Set(o??Y(this,Fc));return this.options.throwOnError&&l.add("error"),Object.keys(Y(this,qn)).some(c=>{const d=c;return Y(this,qn)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Ue(this,I0,YA).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,Cf,_x).call(this)}},rr=new WeakMap,Tt=new WeakMap,_f=new WeakMap,qn=new WeakMap,$a=new WeakMap,Ic=new WeakMap,Bi=new WeakMap,bf=new WeakMap,jc=new WeakMap,Bc=new WeakMap,Ma=new WeakMap,Ra=new WeakMap,po=new WeakMap,Fc=new WeakMap,Aa=new WeakSet,Ud=function(t){Ue(this,Tf,wx).call(this);let n=Y(this,Tt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ir)),n},xf=new WeakSet,gx=function(){if(Ue(this,kf,bx).call(this),Qc||Y(this,qn).isStale||!fx(this.options.staleTime))return;const n=HA(Y(this,qn).dataUpdatedAt,this.options.staleTime)+1;_e(this,Ma,setTimeout(()=>{Y(this,qn).isStale||this.updateResult()},n))},wf=new WeakSet,vx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,Tt)):this.options.refetchInterval)??!1},Sf=new WeakSet,yx=function(t){Ue(this,Ef,xx).call(this),_e(this,po,t),!(Qc||this.options.enabled===!1||!fx(Y(this,po))||Y(this,po)===0)&&_e(this,Ra,setInterval(()=>{(this.options.refetchIntervalInBackground||AS.isFocused())&&Ue(this,Aa,Ud).call(this)},Y(this,po)))},Cf=new WeakSet,_x=function(){Ue(this,xf,gx).call(this),Ue(this,Sf,yx).call(this,Ue(this,wf,vx).call(this))},kf=new WeakSet,bx=function(){Y(this,Ma)&&(clearTimeout(Y(this,Ma)),_e(this,Ma,void 0))},Ef=new WeakSet,xx=function(){Y(this,Ra)&&(clearInterval(Y(this,Ra)),_e(this,Ra,void 0))},Tf=new WeakSet,wx=function(){const t=Y(this,rr).getQueryCache().build(Y(this,rr),this.options);if(t===Y(this,Tt))return;const n=Y(this,Tt);_e(this,Tt,t),_e(this,_f,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},I0=new WeakSet,YA=function(t){mn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Y(this,qn))}),Y(this,rr).getQueryCache().notify({query:Y(this,Tt),type:"observerResultsUpdated"})})},e7);function rG(e,t){return t.enabled!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function FE(e,t){return rG(e,t)||e.state.data!==void 0&&Sx(e,t,t.refetchOnMount)}function Sx(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&DS(e,t)}return!1}function zE(e,t,n,r){return(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&DS(e,n)}function DS(e,t){return t.enabled!==!1&&e.isStaleByTime(t.staleTime)}function iG(e,t){return!Hg(e.getCurrentResult(),t)}var mo,go,ir,ys,zc,Im,$f,Cx,t7,sG=(t7=class extends Eu{constructor(n,r){super();Ee(this,zc);Ee(this,$f);Ee(this,mo,void 0);Ee(this,go,void 0);Ee(this,ir,void 0);Ee(this,ys,void 0);_e(this,mo,n),this.setOptions(r),this.bindMethods(),Ue(this,zc,Im).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=Y(this,mo).defaultMutationOptions(n),Hg(this.options,r)||Y(this,mo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,ir),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Va(r.mutationKey)!==Va(this.options.mutationKey)?this.reset():((i=Y(this,ir))==null?void 0:i.state.status)==="pending"&&Y(this,ir).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Y(this,ir))==null||n.removeObserver(this)}onMutationUpdate(n){Ue(this,zc,Im).call(this),Ue(this,$f,Cx).call(this,n)}getCurrentResult(){return Y(this,go)}reset(){var n;(n=Y(this,ir))==null||n.removeObserver(this),_e(this,ir,void 0),Ue(this,zc,Im).call(this),Ue(this,$f,Cx).call(this)}mutate(n,r){var i;return _e(this,ys,r),(i=Y(this,ir))==null||i.removeObserver(this),_e(this,ir,Y(this,mo).getMutationCache().build(Y(this,mo),this.options)),Y(this,ir).addObserver(this),Y(this,ir).execute(n)}},mo=new WeakMap,go=new WeakMap,ir=new WeakMap,ys=new WeakMap,zc=new WeakSet,Im=function(){var r;const n=((r=Y(this,ir))==null?void 0:r.state)??GA();_e(this,go,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$f=new WeakSet,Cx=function(n){mn.batch(()=>{var r,i,s,a,o,l,c,d;if(Y(this,ys)&&this.hasListeners()){const u=Y(this,go).variables,h=Y(this,go).context;(n==null?void 0:n.type)==="success"?((i=(r=Y(this,ys)).onSuccess)==null||i.call(r,n.data,u,h),(a=(s=Y(this,ys)).onSettled)==null||a.call(s,n.data,null,u,h)):(n==null?void 0:n.type)==="error"&&((l=(o=Y(this,ys)).onError)==null||l.call(o,n.error,u,h),(d=(c=Y(this,ys)).onSettled)==null||d.call(c,void 0,n.error,u,h))}this.listeners.forEach(u=>{u(Y(this,go))})})},t7),XA=x.createContext(void 0),QA=e=>{const t=x.useContext(XA);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oG=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(XA.Provider,{value:e,children:t})),JA=x.createContext(!1),aG=()=>x.useContext(JA);JA.Provider;function lG(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cG=x.createContext(lG()),uG=()=>x.useContext(cG);function ZA(e,t){return typeof e=="function"?e(...t):!!e}function dG(){}var hG=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},fG=e=>{x.useEffect(()=>{e.clearReset()},[e])},pG=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ZA(n,[e.error,r]),mG=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},gG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,vG=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yG(e,t,n){const r=QA(n),i=aG(),s=uG(),a=r.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",mG(a),hG(a,s),fG(s);const[o]=x.useState(()=>new t(r,a)),l=o.getOptimisticResult(a);if(x.useSyncExternalStore(x.useCallback(c=>{const d=i?()=>{}:o.subscribe(mn.batchCalls(c));return o.updateResult(),d},[o,i]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),x.useEffect(()=>{o.setOptions(a,{listeners:!1})},[a,o]),gG(a,l))throw vG(a,o,s);if(pG({result:l,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:o.trackResult(l)}function _G(e,t){return yG(e,nG,t)}function qa(e,t){const n=QA(t),[r]=x.useState(()=>new sG(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(a=>r.subscribe(mn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((a,o)=>{r.mutate(a,o).catch(dG)},[r]);if(i.error&&ZA(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var PS={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const eL=Symbol((PS?"production":void 0)!=="production"?"RESET":"");function Tu(e){const t=Ge(e,(n,r,i)=>{const s=typeof i=="function"?i(n(t)):i;r(t,s===eL?e:s)});return t}const bG=e=>typeof(e==null?void 0:e.then)=="function";function xG(e=()=>{try{return window.localStorage}catch(n){(PS?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){let n,r;const i={getItem:(s,a)=>{var o,l;const c=u=>{if(u=u||"",n!==u){try{r=JSON.parse(u,t==null?void 0:t.reviver)}catch{return a}n=u}return r},d=(l=(o=e())==null?void 0:o.getItem(s))!=null?l:null;return bG(d)?d.then(c):c(d)},setItem:(s,a)=>{var o;return(o=e())==null?void 0:o.setItem(s,JSON.stringify(a,t==null?void 0:t.replacer))},removeItem:s=>{var a;return(a=e())==null?void 0:a.removeItem(s)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(i.subscribe=(s,a,o)=>{if(!(e()instanceof window.Storage))return()=>{};const l=c=>{if(c.storageArea===e()&&c.key===s){let d;try{d=JSON.parse(c.newValue||"")}catch{d=o}a(d)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}}),i}const wG=xG();function tL(e,t,n=wG,r){const i=r==null?void 0:r.getOnInit,s=Ge(i?n.getItem(e,t):t);return(PS?"production":void 0)!=="production"&&(s.debugPrivate=!0),s.onMount=o=>{o(n.getItem(e,t));let l;return n.subscribe&&(l=n.subscribe(e,o,t)),l},Ge(o=>o(s),(o,l,c)=>{const d=typeof c=="function"?c(o(s)):c;return d===eL?(l(s,t),n.removeItem(e)):d instanceof Promise?d.then(u=>(l(s,u),n.setItem(e,u))):(l(s,d),n.setItem(e,d))})}const hv=Ge(!1),nL=Ge(void 0),OS=()=>{const[e,t]=fr(hv),[n,r]=fr(nL);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},SG=()=>{const e=et(hv),t=et(nL);return n=>{e(!0),n&&t(n)}},rL=()=>{const e=et(hv);return()=>{e(!1)}},fv=Ge(!1),iL=Tu({title:"",onConfirm:()=>{}}),sL=()=>{const e=et(fv),t=et(iL);return n=>{t(n),e(!0)}},CG=()=>{const e=et(fv);return()=>{e(!1)}},kG=()=>{const e=lt(fv),t=lt(iL);return{isOpen:e,...t}},pv=Ge(!1),oL=Tu({title:"",onSubmit:()=>{}}),mv=()=>{const e=et(pv),t=et(oL);return n=>{t(n),e(!0)}},EG=()=>{const e=et(pv);return()=>{e(!1)}},TG=()=>{const e=lt(pv),t=lt(oL);return{isOpen:e,...t}},NS=Ge(!1),IS=Ge(!1),jS=Ge(!1),aL=()=>{const[e,t]=fr(NS);return{isSheetOpen:e,setIsSheetOpen:t}},lL=()=>{const[e,t]=fr(IS);return{isSheetOpen:e,setIsSheetOpen:t}},cL=()=>{const[e,t]=fr(jS);return{isSheetOpen:e,setIsSheetOpen:t}},gv=()=>{const e=et(NS),t=et(IS),n=et(jS);return()=>{e(!1),t(!1),n(!1)}},vv=Tu(!1),uL=Tu(void 0),yv=()=>{const e=et(uL),t=et(vv);return n=>{e(n),t(!0)}},BS=()=>{const e=et(vv);return()=>{e(!1)}},$G=()=>{const e=lt(uL),[t,n]=fr(vv);return{isModalOpen:t,playerRef:e,closeModal:()=>n(!1)}};function MG(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const RG=/[ \t\n\f\r]/g;function AG(e){return typeof e=="object"?e.type==="text"?HE(e.value):!1:HE(e)}function HE(e){return e.replace(RG,"")===""}class jf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}jf.prototype.property={};jf.prototype.normal={};jf.prototype.space=null;function dL(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new jf(n,r,t)}function kx(e){return e.toLowerCase()}class ri{constructor(t,n){this.property=t,this.attribute=n}}ri.prototype.space=null;ri.prototype.boolean=!1;ri.prototype.booleanish=!1;ri.prototype.overloadedBoolean=!1;ri.prototype.number=!1;ri.prototype.commaSeparated=!1;ri.prototype.spaceSeparated=!1;ri.prototype.commaOrSpaceSeparated=!1;ri.prototype.mustUseProperty=!1;ri.prototype.defined=!1;let LG=0;const ze=al(),an=al(),hL=al(),de=al(),Rt=al(),pc=al(),xr=al();function al(){return 2**++LG}const Ex=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:an,commaOrSpaceSeparated:xr,commaSeparated:pc,number:de,overloadedBoolean:hL,spaceSeparated:Rt},Symbol.toStringTag,{value:"Module"})),Qy=Object.keys(Ex);class FS extends ri{constructor(t,n,r,i){let s=-1;if(super(t,n),WE(this,"space",i),typeof r=="number")for(;++s<Qy.length;){const a=Qy[s];WE(this,Qy[s],(r&Ex[a])===Ex[a])}}}FS.prototype.defined=!0;function WE(e,t,n){n&&(e[t]=n)}const DG={}.hasOwnProperty;function $u(e){const t={},n={};let r;for(r in e.properties)if(DG.call(e.properties,r)){const i=e.properties[r],s=new FS(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[kx(r)]=r,n[kx(s.attribute)]=r}return new jf(t,n,e.space)}const fL=$u({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pL=$u({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function mL(e,t){return t in e?e[t]:t}function gL(e,t){return mL(e,t.toLowerCase())}const vL=$u({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:gL,properties:{xmlns:null,xmlnsXLink:null}}),yL=$u({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:an,ariaAutoComplete:null,ariaBusy:an,ariaChecked:an,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:Rt,ariaCurrent:null,ariaDescribedBy:Rt,ariaDetails:null,ariaDisabled:an,ariaDropEffect:Rt,ariaErrorMessage:null,ariaExpanded:an,ariaFlowTo:Rt,ariaGrabbed:an,ariaHasPopup:null,ariaHidden:an,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rt,ariaLevel:de,ariaLive:null,ariaModal:an,ariaMultiLine:an,ariaMultiSelectable:an,ariaOrientation:null,ariaOwns:Rt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:an,ariaReadOnly:an,ariaRelevant:null,ariaRequired:an,ariaRoleDescription:Rt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:an,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null}}),PG=$u({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:gL,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pc,acceptCharset:Rt,accessKey:Rt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:Rt,autoFocus:ze,autoPlay:ze,blocking:Rt,capture:ze,charSet:null,checked:ze,cite:null,className:Rt,cols:de,colSpan:null,content:null,contentEditable:an,controls:ze,controlsList:Rt,coords:de|pc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:hL,draggable:an,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:Rt,height:de,hidden:ze,high:de,href:null,hrefLang:null,htmlFor:Rt,httpEquiv:Rt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:Rt,itemRef:Rt,itemScope:ze,itemType:Rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint: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:ze,optimum:de,pattern:null,ping:Rt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:Rt,required:ze,reversed:ze,rows:de,rowSpan:de,sandbox:Rt,scope:null,scoped:ze,seamless:ze,selected:ze,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:an,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:an,width:de,wrap:null,align:null,aLink:null,archive:Rt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:an,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:de,security:null,unselectable:null}}),OG=$u({space:"svg",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"},transform:mL,properties:{about:xr,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:Rt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:pc,g2:pc,glyphName:pc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),NG=/^data[-\w.:]+$/i,UE=/-[a-z]/g,IG=/[A-Z]/g;function jG(e,t){const n=kx(t);let r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&NG.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(UE,FG);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!UE.test(s)){let a=s.replace(IG,BG);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=FS}return new i(r,t)}function BG(e){return"-"+e.toLowerCase()}function FG(e){return e.charAt(1).toUpperCase()}const zG={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},HG=dL([pL,fL,vL,yL,PG],"html"),_L=dL([pL,fL,vL,yL,OG],"svg");function WG(e){return e.join(" ").trim()}var zS={exports:{}},VE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,UG=/\n/g,VG=/^\s*/,qG=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,KG=/^:\s*/,GG=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YG=/^[;\s]*/,XG=/^\s+|\s+$/g,QG=`
`,qE="/",KE="*",ha="",JG="comment",ZG="declaration",eY=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(b){var y=b.match(UG);y&&(n+=y.length);var m=b.lastIndexOf(QG);r=~m?b.length-m:r+b.length}function s(){var b={line:n,column:r};return function(y){return y.position=new a(b),c(),y}}function a(b){this.start=b,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(b){var y=new Error(t.source+":"+n+":"+r+": "+b);if(y.reason=b,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(b){var y=b.exec(e);if(y){var m=y[0];return i(m),e=e.slice(m.length),y}}function c(){l(VG)}function d(b){var y;for(b=b||[];y=u();)y!==!1&&b.push(y);return b}function u(){var b=s();if(!(qE!=e.charAt(0)||KE!=e.charAt(1))){for(var y=2;ha!=e.charAt(y)&&(KE!=e.charAt(y)||qE!=e.charAt(y+1));)++y;if(y+=2,ha===e.charAt(y-1))return o("End of comment missing");var m=e.slice(2,y-2);return r+=2,i(m),e=e.slice(y),r+=2,b({type:JG,comment:m})}}function h(){var b=s(),y=l(qG);if(y){if(u(),!l(KG))return o("property missing ':'");var m=l(GG),p=b({type:ZG,property:GE(y[0].replace(VE,ha)),value:m?GE(m[0].replace(VE,ha)):ha});return l(YG),p}}function f(){var b=[];d(b);for(var y;y=h();)y!==!1&&(b.push(y),d(b));return b}return c(),f()};function GE(e){return e?e.replace(XG,ha):ha}var tY=eY;function bL(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=tY(e),s=typeof t=="function",a,o,l=0,c=i.length;l<c;l++)r=i[l],a=r.property,o=r.value,s?t(a,o,r):o&&(n||(n={}),n[a]=o);return n}zS.exports=bL;zS.exports.default=bL;var nY=zS.exports;const rY=vn(nY),xL=wL("end"),HS=wL("start");function wL(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function iY(e){const t=HS(e),n=xL(e);if(t&&n)return{start:t,end:n}}function ah(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?YE(e.position):"start"in e||"end"in e?YE(e):"line"in e||"column"in e?Tx(e):""}function Tx(e){return XE(e&&e.line)+":"+XE(e&&e.column)}function YE(e){return Tx(e&&e.start)+"-"+Tx(e&&e.end)}function XE(e){return e&&typeof e=="number"?e:1}class tr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=ah(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}tr.prototype.file="";tr.prototype.name="";tr.prototype.reason="";tr.prototype.message="";tr.prototype.stack="";tr.prototype.column=void 0;tr.prototype.line=void 0;tr.prototype.ancestors=void 0;tr.prototype.cause=void 0;tr.prototype.fatal=void 0;tr.prototype.place=void 0;tr.prototype.ruleId=void 0;tr.prototype.source=void 0;const WS={}.hasOwnProperty,sY=new Map,oY=/[A-Z]/g,aY=/-([a-z])/g,lY=new Set(["table","tbody","thead","tfoot","tr"]),cY=new Set(["td","th"]);function uY(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hY(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=dY(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_L:HG,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=SL(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function SL(e,t,n){if(t.type==="element"||t.type==="root"){const r=e.schema;let i=r;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_L,e.schema=i),e.ancestors.push(t);let s=fY(e,t);const a=pY(e,e.ancestors);let o=e.Fragment;if(e.ancestors.pop(),t.type==="element")if(s&&lY.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!AG(l):!0})),WS.call(e.components,t.tagName)){const l=t.tagName;o=e.components[l],typeof o!="string"&&o!==e.Fragment&&e.passNode&&(a.node=t)}else o=t.tagName;if(s.length>0){const l=s.length>1?s:s[0];l&&(a.children=l)}return e.schema=r,e.create(t,o,a,n)}if(t.type==="text")return t.value}function dY(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function hY(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=HS(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function fY(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:sY;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys&&s.type==="element"){const l=i.get(s.tagName)||0;a=s.tagName+"-"+l,i.set(s.tagName,l+1)}const o=SL(e,s,a);o!==void 0&&n.push(o)}return n}function pY(e,t){const n=t[t.length-1],r={};let i;if("properties"in n&&n.properties){let s;for(i in n.properties)if(i!=="children"&&WS.call(n.properties,i)){const a=mY(e,t,i,n.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&cY.has(n.tagName)?s=l:r[o]=l}}if(s){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}}return r}function mY(e,t,n,r){const i=jG(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?MG(r):WG(r)),i.property==="style"){let s=typeof r=="object"?r:gY(e,t,String(r));return e.stylePropertyNameCase==="css"&&(s=vY(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&i.space?zG[i.property]||i.property:i.attribute,r]}}function gY(e,t,n){const r={};try{rY(n,i)}catch(s){if(!e.ignoreInvalidStyle){const a=s,o=new tr("Cannot parse `style` attribute",{ancestors:t,cause:a,source:"hast-util-to-jsx-runtime",ruleId:"style"});throw o.file=e.filePath||void 0,o.url="https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute",o}}return r;function i(s,a){let o=s;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(aY,_Y)),r[o]=a}}function vY(e){const t={};let n;for(n in e)WS.call(e,n)&&(t[yY(n)]=e[n]);return t}function yY(e){let t=e.replace(oY,bY);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _Y(e,t){return t.toUpperCase()}function bY(e){return"-"+e.toLowerCase()}const Jy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},xY={};function wY(e,t){const n=t||xY,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return CL(e,r,i)}function CL(e,t,n){if(SY(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return QE(e.children,t,n)}return Array.isArray(e)?QE(e,t,n):""}function QE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=CL(e[i],t,n);return r.join("")}function SY(e){return!!(e&&typeof e=="object")}const JE=document.createElement("i");function US(e){const t="&"+e+";";JE.innerHTML=t;const n=JE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qi(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Hr(e,t){return e.length>0?(Qi(e,e.length,0,t),e):t}const ZE={}.hasOwnProperty;function CY(e){const t={};let n=-1;for(;++n<e.length;)kY(t,e[n]);return t}function kY(e,t){let n;for(n in t){const i=(ZE.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){ZE.call(i,a)||(i[a]=[]);const o=s[a];EY(i[a],Array.isArray(o)?o:o?[o]:[])}}}function EY(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Qi(e,0,0,r)}function kL(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const TY=Zo(new RegExp("\\p{P}","u")),zi=Zo(/[A-Za-z]/),Er=Zo(/[\dA-Za-z]/),$Y=Zo(/[#-'*+\--9=?A-Z^-~]/);function $x(e){return e!==null&&(e<32||e===127)}const Mx=Zo(/\d/),MY=Zo(/[\dA-Fa-f]/),EL=Zo(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function pr(e){return e!==null&&(e<0||e===32)}function yt(e){return e===-2||e===-1||e===32}function RY(e){return EL(e)||TY(e)}const AY=Zo(/\s/);function Zo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Er(e.charCodeAt(n+1))&&Er(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Dt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return yt(l)?(e.enter(n),o(l)):t(l)}function o(l){return yt(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const LY={tokenize:DY};function DY(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Dt(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const PY={tokenize:OY},e4={tokenize:NY};function OY(e){const t=this,n=[];let r=0,i,s,a;return o;function o(_){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&g();const S=t.events.length;let k=S,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}p(r);let T=S;for(;T<t.events.length;)t.events[T][1].end=Object.assign({},C),T++;return Qi(t.events,k+1,0,t.events.slice(S)),t.events.length=T,c(_)}return o(_)}function c(_){if(r===n.length){if(!i)return h(_);if(i.currentConstruct&&i.currentConstruct.concrete)return b(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(e4,d,u)(_)}function d(_){return i&&g(),p(r),h(_)}function u(_){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(_)}function h(_){return t.containerState={},e.attempt(e4,f,b)(_)}function f(_){return r++,n.push([t.currentConstruct,t.containerState]),h(_)}function b(_){if(_===null){i&&g(),p(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),y(_)}function y(_){if(_===null){m(e.exit("chunkFlow"),!0),p(0),e.consume(_);return}return Oe(_)?(e.consume(_),m(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(_),y)}function m(_,S){const k=t.sliceStream(_);if(S&&k.push(null),_.previous=s,s&&(s.next=_),s=_,i.defineSkip(_.start),i.write(k),t.parser.lazy[_.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const T=t.events.length;let w=T,E,$;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){if(E){$=t.events[w][1].end;break}E=!0}for(p(r),C=T;C<t.events.length;)t.events[C][1].end=Object.assign({},$),C++;Qi(t.events,w+1,0,t.events.slice(T)),t.events.length=C}}function p(_){let S=n.length;for(;S-- >_;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=_}function g(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function NY(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function t4(e){if(e===null||pr(e)||AY(e))return 1;if(RY(e))return 2}function VS(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Rx={name:"attention",tokenize:jY,resolveAll:IY};function IY(e,t){let n=-1,r,i,s,a,o,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);n4(u,-l),n4(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},o={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},o.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},o.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Hr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Hr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Hr(c,VS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Hr(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Hr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Qi(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function jY(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=t4(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const c=e.exit("attentionSequence"),d=t4(l),u=!d||d===2&&i||n.includes(l),h=!i||i===2&&d||n.includes(r);return c._open=!!(s===42?u:u&&(i||!h)),c._close=!!(s===42?h:h&&(d||!u)),t(l)}}function n4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const BY={name:"autolink",tokenize:FY};function FY(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return zi(f)?(e.consume(f),a):c(f)}function a(f){return f===43||f===45||f===46||Er(f)?(r=1,o(f)):c(f)}function o(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||Er(f))&&r++<32?(e.consume(f),o):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||$x(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),d):$Y(f)?(e.consume(f),c):n(f)}function d(f){return Er(f)?u(f):n(f)}function u(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Er(f))&&r++<63){const b=f===45?h:u;return e.consume(f),b}return n(f)}}const _v={tokenize:zY,partial:!0};function zY(e,t,n){return r;function r(s){return yt(s)?Dt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Oe(s)?t(s):n(s)}}const TL={name:"blockQuote",tokenize:HY,continuation:{tokenize:WY},exit:UY};function HY(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return yt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function WY(e,t,n){const r=this;return i;function i(a){return yt(a)?Dt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(TL,t,n)(a)}}function UY(e){e.exit("blockQuote")}const $L={name:"characterEscape",tokenize:VY};function VY(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return EL(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ML={name:"characterReference",tokenize:qY};function qY(e,t,n){const r=this;let i=0,s,a;return o;function o(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Er,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=MY,d):(e.enter("characterReferenceValue"),s=7,a=Mx,d(u))}function d(u){if(u===59&&i){const h=e.exit("characterReferenceValue");return a===Er&&!US(r.sliceSerialize(h))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<s?(e.consume(u),d):n(u)}}const r4={tokenize:GY,partial:!0},i4={name:"codeFenced",tokenize:KY,concrete:!0};function KY(e,t,n){const r=this,i={tokenize:k,partial:!0};let s=0,a=0,o;return l;function l(C){return c(C)}function c(C){const T=r.events[r.events.length-1];return s=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===o?(a++,e.consume(C),d):a<3?n(C):(e.exit("codeFencedFenceSequence"),yt(C)?Dt(e,u,"whitespace")(C):u(C))}function u(C){return C===null||Oe(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(r4,y,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||Oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):yt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(e,f,"whitespace")(C)):C===96&&C===o?n(C):(e.consume(C),h)}function f(C){return C===null||Oe(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(C))}function b(C){return C===null||Oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===o?n(C):(e.consume(C),b)}function y(C){return e.attempt(i,S,m)(C)}function m(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p}function p(C){return s>0&&yt(C)?Dt(e,g,"linePrefix",s+1)(C):g(C)}function g(C){return C===null||Oe(C)?e.check(r4,y,S)(C):(e.enter("codeFlowValue"),_(C))}function _(C){return C===null||Oe(C)?(e.exit("codeFlowValue"),g(C)):(e.consume(C),_)}function S(C){return e.exit("codeFenced"),t(C)}function k(C,T,w){let E=0;return $;function $(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),M}function M(O){return C.enter("codeFencedFence"),yt(O)?Dt(C,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):P(O)}function P(O){return O===o?(C.enter("codeFencedFenceSequence"),D(O)):w(O)}function D(O){return O===o?(E++,C.consume(O),D):E>=a?(C.exit("codeFencedFenceSequence"),yt(O)?Dt(C,R,"whitespace")(O):R(O)):w(O)}function R(O){return O===null||Oe(O)?(C.exit("codeFencedFence"),T(O)):w(O)}}}function GY(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Zy={name:"codeIndented",tokenize:XY},YY={tokenize:QY,partial:!0};function XY(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Dt(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):Oe(c)?e.attempt(YY,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||Oe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function QY(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Dt(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Oe(a)?i(a):n(a)}}const JY={name:"codeText",tokenize:tX,resolve:ZY,previous:eX};function ZY(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function eX(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tX(e,t,n){let r=0,i,s;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),o(u)}function o(u){return u===96?(e.consume(u),r++,o):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(s=e.enter("codeTextSequence"),i=0,d(u)):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||Oe(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(s.type="codeTextData",c(u))}}function RL(e){const t={};let n=-1,r,i,s,a,o,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,nX(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(a=e[s],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),o=e.slice(i,n),o.unshift(r),Qi(e,i,n-i+1,o))}}return!c}function nX(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],a=n._tokenizer||r.parser[n.contentType](n.start),o=a.events,l=[],c={};let d,u,h=-1,f=n,b=0,y=0;const m=[y];for(;f;){for(;e[++i][1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),u&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,m.push(y),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):m.pop(),h=m.length;h--;){const p=o.slice(m[h],m[h+1]),g=s.pop();l.unshift([g,g+p.length-1]),Qi(e,g,2,p)}for(h=-1;++h<l.length;)c[b+l[h][0]]=b+l[h][1],b+=l[h][1]-l[h][0]-1;return c}const rX={tokenize:oX,resolve:sX},iX={tokenize:aX,partial:!0};function sX(e){return RL(e),e}function oX(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):Oe(o)?e.check(iX,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function aX(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Dt(e,s,"linePrefix")}function s(a){if(a===null||Oe(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function AL(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(p){return p===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(p),e.exit(s),h):p===null||p===32||p===41||$x(p)?n(p):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(p))}function h(p){return p===62?(e.enter(s),e.consume(p),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===62?(e.exit("chunkString"),e.exit(o),h(p)):p===null||p===60||Oe(p)?n(p):(e.consume(p),p===92?b:f)}function b(p){return p===60||p===62||p===92?(e.consume(p),f):f(p)}function y(p){return!d&&(p===null||p===41||pr(p))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(p)):d<c&&p===40?(e.consume(p),d++,y):p===41?(e.consume(p),d--,y):p===null||p===32||p===40||$x(p)?n(p):(e.consume(p),p===92?m:y)}function m(p){return p===40||p===41||p===92?(e.consume(p),y):y(p)}}function LL(e,t,n,r,i,s){const a=this;let o=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):Oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||Oe(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!yt(f)),f===92?h:u)}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,u):u(f)}}function DL(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===a?(e.exit(s),l(a)):h===null?n(h):Oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Dt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Oe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?u:d)}function u(h){return h===a||h===92?(e.consume(h),d):d(h)}}function lh(e,t){let n;return r;function r(i){return Oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):yt(i)?Dt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const lX={name:"definition",tokenize:uX},cX={tokenize:dX,partial:!0};function uX(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return LL.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=mc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return pr(f)?lh(e,c)(f):c(f)}function c(f){return AL(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(cX,u,u)(f)}function u(f){return yt(f)?Dt(e,h,"whitespace")(f):h(f)}function h(f){return f===null||Oe(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function dX(e,t,n){return r;function r(o){return pr(o)?lh(e,i)(o):n(o)}function i(o){return DL(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return yt(o)?Dt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Oe(o)?t(o):n(o)}}const hX={name:"hardBreakEscape",tokenize:fX};function fX(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Oe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const pX={name:"headingAtx",tokenize:gX,resolve:mX};function mX(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Qi(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function gX(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||pr(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Oe(d)?(e.exit("atxHeading"),t(d)):yt(d)?Dt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||pr(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const vX=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],s4=["pre","script","style","textarea"],yX={name:"htmlFlow",tokenize:wX,resolveTo:xX,concrete:!0},_X={tokenize:CX,partial:!0},bX={tokenize:SX,partial:!0};function xX(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wX(e,t,n){const r=this;let i,s,a,o,l;return c;function c(B){return d(B)}function d(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),u}function u(B){return B===33?(e.consume(B),h):B===47?(e.consume(B),s=!0,y):B===63?(e.consume(B),i=3,r.interrupt?t:A):zi(B)?(e.consume(B),a=String.fromCharCode(B),m):n(B)}function h(B){return B===45?(e.consume(B),i=2,f):B===91?(e.consume(B),i=5,o=0,b):zi(B)?(e.consume(B),i=4,r.interrupt?t:A):n(B)}function f(B){return B===45?(e.consume(B),r.interrupt?t:A):n(B)}function b(B){const G="CDATA[";return B===G.charCodeAt(o++)?(e.consume(B),o===G.length?r.interrupt?t:P:b):n(B)}function y(B){return zi(B)?(e.consume(B),a=String.fromCharCode(B),m):n(B)}function m(B){if(B===null||B===47||B===62||pr(B)){const G=B===47,J=a.toLowerCase();return!G&&!s&&s4.includes(J)?(i=1,r.interrupt?t(B):P(B)):vX.includes(a.toLowerCase())?(i=6,G?(e.consume(B),p):r.interrupt?t(B):P(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):s?g(B):_(B))}return B===45||Er(B)?(e.consume(B),a+=String.fromCharCode(B),m):n(B)}function p(B){return B===62?(e.consume(B),r.interrupt?t:P):n(B)}function g(B){return yt(B)?(e.consume(B),g):$(B)}function _(B){return B===47?(e.consume(B),$):B===58||B===95||zi(B)?(e.consume(B),S):yt(B)?(e.consume(B),_):$(B)}function S(B){return B===45||B===46||B===58||B===95||Er(B)?(e.consume(B),S):k(B)}function k(B){return B===61?(e.consume(B),C):yt(B)?(e.consume(B),k):_(B)}function C(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,T):yt(B)?(e.consume(B),C):w(B)}function T(B){return B===l?(e.consume(B),l=null,E):B===null||Oe(B)?n(B):(e.consume(B),T)}function w(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||pr(B)?k(B):(e.consume(B),w)}function E(B){return B===47||B===62||yt(B)?_(B):n(B)}function $(B){return B===62?(e.consume(B),M):n(B)}function M(B){return B===null||Oe(B)?P(B):yt(B)?(e.consume(B),M):n(B)}function P(B){return B===45&&i===2?(e.consume(B),N):B===60&&i===1?(e.consume(B),I):B===62&&i===4?(e.consume(B),F):B===63&&i===3?(e.consume(B),A):B===93&&i===5?(e.consume(B),L):Oe(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_X,H,D)(B)):B===null||Oe(B)?(e.exit("htmlFlowData"),D(B)):(e.consume(B),P)}function D(B){return e.check(bX,R,H)(B)}function R(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),O}function O(B){return B===null||Oe(B)?D(B):(e.enter("htmlFlowData"),P(B))}function N(B){return B===45?(e.consume(B),A):P(B)}function I(B){return B===47?(e.consume(B),a="",j):P(B)}function j(B){if(B===62){const G=a.toLowerCase();return s4.includes(G)?(e.consume(B),F):P(B)}return zi(B)&&a.length<8?(e.consume(B),a+=String.fromCharCode(B),j):P(B)}function L(B){return B===93?(e.consume(B),A):P(B)}function A(B){return B===62?(e.consume(B),F):B===45&&i===2?(e.consume(B),A):P(B)}function F(B){return B===null||Oe(B)?(e.exit("htmlFlowData"),H(B)):(e.consume(B),F)}function H(B){return e.exit("htmlFlow"),t(B)}}function SX(e,t,n){const r=this;return i;function i(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function CX(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_v,t,n)}}const kX={name:"htmlText",tokenize:EX};function EX(e,t,n){const r=this;let i,s,a;return o;function o(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),k):A===63?(e.consume(A),_):zi(A)?(e.consume(A),w):n(A)}function c(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),s=0,b):zi(A)?(e.consume(A),g):n(A)}function d(A){return A===45?(e.consume(A),f):n(A)}function u(A){return A===null?n(A):A===45?(e.consume(A),h):Oe(A)?(a=u,I(A)):(e.consume(A),u)}function h(A){return A===45?(e.consume(A),f):u(A)}function f(A){return A===62?N(A):A===45?h(A):u(A)}function b(A){const F="CDATA[";return A===F.charCodeAt(s++)?(e.consume(A),s===F.length?y:b):n(A)}function y(A){return A===null?n(A):A===93?(e.consume(A),m):Oe(A)?(a=y,I(A)):(e.consume(A),y)}function m(A){return A===93?(e.consume(A),p):y(A)}function p(A){return A===62?N(A):A===93?(e.consume(A),p):y(A)}function g(A){return A===null||A===62?N(A):Oe(A)?(a=g,I(A)):(e.consume(A),g)}function _(A){return A===null?n(A):A===63?(e.consume(A),S):Oe(A)?(a=_,I(A)):(e.consume(A),_)}function S(A){return A===62?N(A):_(A)}function k(A){return zi(A)?(e.consume(A),C):n(A)}function C(A){return A===45||Er(A)?(e.consume(A),C):T(A)}function T(A){return Oe(A)?(a=T,I(A)):yt(A)?(e.consume(A),T):N(A)}function w(A){return A===45||Er(A)?(e.consume(A),w):A===47||A===62||pr(A)?E(A):n(A)}function E(A){return A===47?(e.consume(A),N):A===58||A===95||zi(A)?(e.consume(A),$):Oe(A)?(a=E,I(A)):yt(A)?(e.consume(A),E):N(A)}function $(A){return A===45||A===46||A===58||A===95||Er(A)?(e.consume(A),$):M(A)}function M(A){return A===61?(e.consume(A),P):Oe(A)?(a=M,I(A)):yt(A)?(e.consume(A),M):E(A)}function P(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,D):Oe(A)?(a=P,I(A)):yt(A)?(e.consume(A),P):(e.consume(A),R)}function D(A){return A===i?(e.consume(A),i=void 0,O):A===null?n(A):Oe(A)?(a=D,I(A)):(e.consume(A),D)}function R(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||pr(A)?E(A):(e.consume(A),R)}function O(A){return A===47||A===62||pr(A)?E(A):n(A)}function N(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function I(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return yt(A)?Dt(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):L(A)}function L(A){return e.enter("htmlTextData"),a(A)}}const qS={name:"labelEnd",tokenize:LX,resolveTo:AX,resolveAll:RX},TX={tokenize:DX},$X={tokenize:PX},MX={tokenize:OX};function RX(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function AX(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[a][1].end)},d={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return o=[["enter",l,t],["enter",c,t]],o=Hr(o,e.slice(s+1,s+r+3)),o=Hr(o,[["enter",d,t]]),o=Hr(o,VS(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Hr(o,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),o=Hr(o,e.slice(a+1)),o=Hr(o,[["exit",l,t]]),Qi(e,s,e.length,o),e}function LX(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?u(h):(a=r.parser.defined.includes(mc(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(TX,d,a?d:u)(h):h===91?e.attempt($X,d,a?c:u)(h):a?d(h):u(h)}function c(h){return e.attempt(MX,d,u)(h)}function d(h){return t(h)}function u(h){return s._balanced=!0,n(h)}}function DX(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return pr(u)?lh(e,s)(u):s(u)}function s(u){return u===41?d(u):AL(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return pr(u)?lh(e,l)(u):d(u)}function o(u){return n(u)}function l(u){return u===34||u===39||u===40?DL(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return pr(u)?lh(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function PX(e,t,n){const r=this;return i;function i(o){return LL.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(mc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function OX(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const NX={name:"labelStartImage",tokenize:IX,resolveAll:qS.resolveAll};function IX(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const jX={name:"labelStartLink",tokenize:BX,resolveAll:qS.resolveAll};function BX(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const e_={name:"lineEnding",tokenize:FX};function FX(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const jm={name:"thematicBreak",tokenize:zX};function zX(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),yt(c)?Dt(e,o,"whitespace")(c):o(c))}}const nr={name:"list",tokenize:UX,continuation:{tokenize:VX},exit:KX},HX={tokenize:GX,partial:!0},WX={tokenize:qX,partial:!0};function UX(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const b=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Mx(f)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(jm,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Mx(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(_v,r.interrupt?n:d,e.attempt(HX,h,u))}function d(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function u(f){return yt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function VX(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_v,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Dt(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!yt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(WX,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Dt(e,e.attempt(nr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function qX(e,t,n){const r=this;return Dt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function KX(e){e.exit(this.containerState.type)}function GX(e,t,n){const r=this;return Dt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!yt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const o4={name:"setextUnderline",tokenize:XX,resolveTo:YX};function YX(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function XX(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,u;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){u=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),yt(c)?Dt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const QX={tokenize:JX};function JX(e){const t=this,n=e.attempt(_v,r,e.attempt(this.parser.constructs.flowInitial,i,Dt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rX,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ZX={resolveAll:OL()},eQ=PL("string"),tQ=PL("text");function PL(e){return{tokenize:t,resolveAll:OL(e==="text"?nQ:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=i[d];let h=-1;if(u)for(;++h<u.length;){const f=u[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function OL(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function nQ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-o,offset:r.end.offset-o,_index:r.start._index+s,_bufferIndex:s?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function rQ(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let a=[],o=[];const l={consume:g,enter:_,exit:S,attempt:T(k),check:T(C),interrupt:T(C,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:b,defineSkip:y,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function u(M){return a=Hr(a,M),m(),a[a.length-1]!==null?[]:(w(t,0),c.events=VS(s,c.events,c),c.events)}function h(M,P){return sQ(f(M),P)}function f(M){return iQ(a,M)}function b(){const{line:M,column:P,offset:D,_index:R,_bufferIndex:O}=r;return{line:M,column:P,offset:D,_index:R,_bufferIndex:O}}function y(M){i[M.line]=M.column,$()}function m(){let M;for(;r._index<a.length;){const P=a[r._index];if(typeof P=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<P.length;)p(P.charCodeAt(r._bufferIndex));else p(P)}}function p(M){d=d(M)}function g(M){Oe(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,$()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function _(M,P){const D=P||{};return D.type=M,D.start=b(),c.events.push(["enter",D,c]),o.push(D),D}function S(M){const P=o.pop();return P.end=b(),c.events.push(["exit",P,c]),P}function k(M,P){w(M,P.from)}function C(M,P){P.restore()}function T(M,P){return D;function D(R,O,N){let I,j,L,A;return Array.isArray(R)?H(R):"tokenize"in R?H([R]):F(R);function F(W){return U;function U(z){const V=z!==null&&W[z],K=z!==null&&W.null,q=[...Array.isArray(V)?V:V?[V]:[],...Array.isArray(K)?K:K?[K]:[]];return H(q)(z)}}function H(W){return I=W,j=0,W.length===0?N:B(W[j])}function B(W){return U;function U(z){return A=E(),L=W,W.partial||(c.currentConstruct=W),W.name&&c.parser.constructs.disable.null.includes(W.name)?J():W.tokenize.call(P?Object.assign(Object.create(c),P):c,l,G,J)(z)}}function G(W){return M(L,A),O}function J(W){return A.restore(),++j<I.length?B(I[j]):N}}}function w(M,P){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&Qi(c.events,P,c.events.length-P,M.resolve(c.events.slice(P),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function E(){const M=b(),P=c.previous,D=c.currentConstruct,R=c.events.length,O=Array.from(o);return{restore:N,from:R};function N(){r=M,c.previous=P,c.currentConstruct=D,c.events.length=R,o=O,$()}}function $(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function iQ(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function sQ(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}const oQ={42:nr,43:nr,45:nr,48:nr,49:nr,50:nr,51:nr,52:nr,53:nr,54:nr,55:nr,56:nr,57:nr,62:TL},aQ={91:lX},lQ={[-2]:Zy,[-1]:Zy,32:Zy},cQ={35:pX,42:jm,45:[o4,jm],60:yX,61:o4,95:jm,96:i4,126:i4},uQ={38:ML,92:$L},dQ={[-5]:e_,[-4]:e_,[-3]:e_,33:NX,38:ML,42:Rx,60:[BY,kX],91:jX,92:[hX,$L],93:qS,95:Rx,96:JY},hQ={null:[Rx,ZX]},fQ={null:[42,95]},pQ={null:[]},mQ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fQ,contentInitial:aQ,disable:pQ,document:oQ,flow:cQ,flowInitial:lQ,insideSpan:hQ,string:uQ,text:dQ},Symbol.toStringTag,{value:"Module"}));function gQ(e){const n=CY([mQ,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(LY),document:i(PY),flow:i(QX),string:i(eQ),text:i(tQ)};return r;function i(s){return a;function a(o){return rQ(r,s,o)}}}function vQ(e){for(;!RL(e););return e}const a4=/[\0\t\n\r]/g;function yQ(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let c,d,u,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),u=0,t="",n&&(s.charCodeAt(0)===65279&&u++,n=void 0);u<s.length;){if(a4.lastIndex=u,c=a4.exec(s),h=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(h),!c){t=s.slice(u);break}if(f===10&&u===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<h&&(l.push(s.slice(u,h)),e+=h-u),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const _Q=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bQ(e){return e.replace(_Q,xQ)}function xQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return kL(n.slice(s?2:1),s?16:10)}return US(n)||e}const NL={}.hasOwnProperty;function wQ(e,t,n){return typeof t!="string"&&(n=t,t=void 0),SQ(n)(vQ(gQ(n).document().write(yQ()(e,t,!0))))}function SQ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Me),autolinkProtocol:E,autolinkEmail:E,atxHeading:s(re),blockQuote:s(V),characterEscape:E,characterReference:E,codeFenced:s(K),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(K,a),codeText:s(q,a),codeTextData:E,data:E,codeFlowValue:E,definition:s(X),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(ie),hardBreakEscape:s(ce),hardBreakTrailing:s(ce),htmlFlow:s(ye,a),htmlFlowData:E,htmlText:s(ye,a),htmlTextData:E,image:s(ae),label:a,link:s(Me),listItem:s(ge),listItemValue:h,listOrdered:s(Pe,u),listUnordered:s(Pe),paragraph:s(xe),reference:B,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(re),strong:s(oe),thematicBreak:s(fe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:z,autolinkProtocol:U,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:W,codeFenced:l(m),codeFencedFence:y,codeFencedFenceInfo:f,codeFencedFenceMeta:b,codeFlowValue:$,codeIndented:l(p),codeText:l(O),codeTextData:$,data:$,definition:l(),definitionDestinationString:S,definitionLabelString:g,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(P),hardBreakTrailing:l(P),htmlFlow:l(D),htmlFlowData:$,htmlText:l(R),htmlTextData:$,image:l(I),label:L,labelText:j,lineEnding:M,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:G,resourceDestinationString:A,resourceTitleString:F,resource:H,setextHeading:l(w),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};IL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let ne={type:"root",children:[]};const he={stack:[ne],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:d,data:n},ve=[];let Ce=-1;for(;++Ce<Q.length;)if(Q[Ce][1].type==="listOrdered"||Q[Ce][1].type==="listUnordered")if(Q[Ce][0]==="enter")ve.push(Ce);else{const Te=ve.pop();Ce=i(Q,Te,Ce)}for(Ce=-1;++Ce<Q.length;){const Te=t[Q[Ce][0]];NL.call(Te,Q[Ce][1].type)&&Te[Q[Ce][1].type].call(Object.assign({sliceSerialize:Q[Ce][2].sliceSerialize},he),Q[Ce][1])}if(he.tokenStack.length>0){const Te=he.tokenStack[he.tokenStack.length-1];(Te[1]||l4).call(he,void 0,Te[0])}for(ne.position={start:Xs(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Xs(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)ne=t.transforms[Ce](ne)||ne;return ne}function i(Q,ne,he){let ve=ne-1,Ce=-1,Te=!1,we,be,mt,Je;for(;++ve<=he;){const qe=Q[ve];switch(qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{qe[0]==="enter"?Ce++:Ce--,Je=void 0;break}case"lineEndingBlank":{qe[0]==="enter"&&(we&&!Je&&!Ce&&!mt&&(mt=ve),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!Ce&&qe[0]==="enter"&&qe[1].type==="listItemPrefix"||Ce===-1&&qe[0]==="exit"&&(qe[1].type==="listUnordered"||qe[1].type==="listOrdered")){if(we){let ct=ve;for(be=void 0;ct--;){const nt=Q[ct];if(nt[1].type==="lineEnding"||nt[1].type==="lineEndingBlank"){if(nt[0]==="exit")continue;be&&(Q[be][1].type="lineEndingBlank",Te=!0),nt[1].type="lineEnding",be=ct}else if(!(nt[1].type==="linePrefix"||nt[1].type==="blockQuotePrefix"||nt[1].type==="blockQuotePrefixWhitespace"||nt[1].type==="blockQuoteMarker"||nt[1].type==="listItemIndent"))break}mt&&(!be||mt<be)&&(we._spread=!0),we.end=Object.assign({},be?Q[be][1].start:qe[1].end),Q.splice(be||ve,0,["exit",we,qe[2]]),ve++,he++}if(qe[1].type==="listItemPrefix"){const ct={type:"listItem",_spread:!1,start:Object.assign({},qe[1].start),end:void 0};we=ct,Q.splice(ve,0,["enter",ct,qe[2]]),ve++,he++,mt=void 0,Je=!0}}}return Q[ne][1]._spread=Te,he}function s(Q,ne){return he;function he(ve){o.call(this,Q(ve),ve),ne&&ne.call(this,ve)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(Q,ne,he){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([ne,he]),Q.position={start:Xs(ne.start),end:void 0}}function l(Q){return ne;function ne(he){Q&&Q.call(this,he),c.call(this,he)}}function c(Q,ne){const he=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==Q.type&&(ne?ne.call(this,Q,ve[0]):(ve[1]||l4).call(this,Q,ve[0]));else throw new Error("Cannot close `"+Q.type+"` ("+ah({start:Q.start,end:Q.end})+"): it’s not open");he.position.end=Xs(Q.end)}function d(){return wY(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function h(Q){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=Q}function b(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=Q}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Q.replace(/(\r?\n|\r)$/g,"")}function g(Q){const ne=this.resume(),he=this.stack[this.stack.length-1];he.label=ne,he.identifier=mc(this.sliceSerialize(Q)).toLowerCase()}function _(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.title=Q}function S(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.url=Q}function k(Q){const ne=this.stack[this.stack.length-1];if(!ne.depth){const he=this.sliceSerialize(Q).length;ne.depth=he}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(Q){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function E(Q){const he=this.stack[this.stack.length-1].children;let ve=he[he.length-1];(!ve||ve.type!=="text")&&(ve=se(),ve.position={start:Xs(Q.start),end:void 0},he.push(ve)),this.stack.push(ve)}function $(Q){const ne=this.stack.pop();ne.value+=this.sliceSerialize(Q),ne.position.end=Xs(Q.end)}function M(Q){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const he=ne.children[ne.children.length-1];he.position.end=Xs(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(E.call(this,Q),$.call(this,Q))}function P(){this.data.atHardBreak=!0}function D(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Q}function R(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Q}function O(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.value=Q}function N(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=ne,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function I(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=ne,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function j(Q){const ne=this.sliceSerialize(Q),he=this.stack[this.stack.length-2];he.label=bQ(ne),he.identifier=mc(ne).toLowerCase()}function L(){const Q=this.stack[this.stack.length-1],ne=this.resume(),he=this.stack[this.stack.length-1];if(this.data.inReference=!0,he.type==="link"){const ve=Q.children;he.children=ve}else he.alt=ne}function A(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.url=Q}function F(){const Q=this.resume(),ne=this.stack[this.stack.length-1];ne.title=Q}function H(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function G(Q){const ne=this.resume(),he=this.stack[this.stack.length-1];he.label=ne,he.identifier=mc(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function J(Q){this.data.characterReferenceType=Q.type}function W(Q){const ne=this.sliceSerialize(Q),he=this.data.characterReferenceType;let ve;he?(ve=kL(ne,he==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=US(ne);const Ce=this.stack.pop();Ce.value+=ve,Ce.position.end=Xs(Q.end)}function U(Q){$.call(this,Q);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(Q)}function z(Q){$.call(this,Q);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(Q)}function V(){return{type:"blockquote",children:[]}}function K(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ie(){return{type:"emphasis",children:[]}}function re(){return{type:"heading",depth:0,children:[]}}function ce(){return{type:"break"}}function ye(){return{type:"html",value:""}}function ae(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function Pe(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function ge(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function xe(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function IL(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?IL(e,r):CQ(e,r)}}function CQ(e,t){let n;for(n in t)if(NL.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function l4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ah({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ah({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ah({start:t.start,end:t.end})+") is still open")}function kQ(e){const t=this;t.parser=n;function n(r){return wQ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function EQ(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function TQ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function $Q(e,t){const n=t.value?t.value+`
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function MQ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RQ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AQ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Mu(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function LQ(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DQ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jL(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function PQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jL(e,t);const i={src:Mu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function OQ(e,t){const n={src:Mu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function NQ(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function IQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jL(e,t);const i={href:Mu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function jQ(e,t){const n={href:Mu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BQ(e,t,n){const r=e.all(t),i=n?FQ(n):BL(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let u;d&&d.type==="element"&&d.tagName==="p"?u=d:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function FQ(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=BL(n[r])}return t}function BL(e){const t=e.spread;return t??e.children.length>1}function zQ(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function HQ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WQ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function UQ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VQ(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=HS(t.children[1]),l=xL(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function qQ(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const u=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let b={type:"element",tagName:s,properties:h,children:[]};u&&(b.children=e.all(u),e.patch(u,b),b=e.applyData(u,b)),c.push(b)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function KQ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const c4=9,u4=32;function GQ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(d4(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(d4(t.slice(i),i>0,!1)),s.join("")}function d4(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===c4||s===u4;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===c4||s===u4;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function YQ(e,t){const n={type:"text",value:GQ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XQ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const QQ={blockquote:EQ,break:TQ,code:$Q,delete:MQ,emphasis:RQ,footnoteReference:AQ,heading:LQ,html:DQ,imageReference:PQ,image:OQ,inlineCode:NQ,linkReference:IQ,link:jQ,listItem:BQ,list:zQ,paragraph:HQ,root:WQ,strong:UQ,table:VQ,tableCell:KQ,tableRow:qQ,text:YQ,thematicBreak:XQ,toml:Fp,yaml:Fp,definition:Fp,footnoteDefinition:Fp};function Fp(){}const FL=-1,bv=0,Ug=1,Vg=2,KS=3,GS=4,YS=5,XS=6,zL=7,HL=8,h4=typeof self=="object"?self:globalThis,JQ=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case bv:case FL:return n(a,i);case Ug:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Vg:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case KS:return n(new Date(a),i);case GS:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case YS:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case XS:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case zL:{const{name:o,message:l}=a;return n(new h4[o](l),i)}case HL:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new h4[s](a),i)};return r},f4=e=>JQ(new Map,e)(0),Al="",{toString:ZQ}={},{keys:eJ}=Object,gd=e=>{const t=typeof e;if(t!=="object"||!e)return[bv,t];const n=ZQ.call(e).slice(8,-1);switch(n){case"Array":return[Ug,Al];case"Object":return[Vg,Al];case"Date":return[KS,Al];case"RegExp":return[GS,Al];case"Map":return[YS,Al];case"Set":return[XS,Al]}return n.includes("Array")?[Ug,n]:n.includes("Error")?[zL,n]:[Vg,n]},zp=([e,t])=>e===bv&&(t==="function"||t==="symbol"),tJ=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=gd(a);switch(o){case bv:{let d=a;switch(l){case"bigint":o=HL,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([FL],a)}return i([o,d],a)}case Ug:{if(l)return i([l,[...a]],a);const d=[],u=i([o,d],a);for(const h of a)d.push(s(h));return u}case Vg:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],u=i([o,d],a);for(const h of eJ(a))(e||!zp(gd(a[h])))&&d.push([s(h),s(a[h])]);return u}case KS:return i([o,a.toISOString()],a);case GS:{const{source:d,flags:u}=a;return i([o,{source:d,flags:u}],a)}case YS:{const d=[],u=i([o,d],a);for(const[h,f]of a)(e||!(zp(gd(h))||zp(gd(f))))&&d.push([s(h),s(f)]);return u}case XS:{const d=[],u=i([o,d],a);for(const h of a)(e||!zp(gd(h)))&&d.push(s(h));return u}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},p4=(e,{json:t,lossy:n}={})=>{const r=[];return tJ(!(t||n),!!t,new Map,r)(e),r},qg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?f4(p4(e,t)):structuredClone(e):(e,t)=>f4(p4(e,t));function nJ(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function rJ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iJ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nJ,r=e.options.footnoteBackLabel||rJ,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const d=e.all(c),u=String(c.identifier).toUpperCase(),h=Mu(u.toLowerCase());let f=0;const b=[],y=e.footnoteCounts.get(u);for(;y!==void 0&&++f<=y;){b.length>0&&b.push({type:"text",value:" "});let g=typeof n=="string"?n:n(l,f);typeof g=="string"&&(g={type:"text",value:g}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const m=d[d.length-1];if(m&&m.type==="element"&&m.tagName==="p"){const g=m.children[m.children.length-1];g&&g.type==="text"?g.value+=" ":m.children.push({type:"text",value:" "}),m.children.push(...b)}else d.push(...b);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,p),o.push(p)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...qg(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const WL=function(e){if(e==null)return lJ;if(typeof e=="function")return xv(e);if(typeof e=="object")return Array.isArray(e)?sJ(e):oJ(e);if(typeof e=="string")return aJ(e);throw new Error("Expected function, string, or object as test")};function sJ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=WL(e[n]);return xv(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function oJ(e){const t=e;return xv(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function aJ(e){return xv(t);function t(n){return n&&n.type===e}}function xv(e){return t;function t(n,r,i){return!!(cJ(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function lJ(){return!0}function cJ(e){return e!==null&&typeof e=="object"&&"type"in e}const UL=[],uJ=!0,m4=!1,dJ="skip";function hJ(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=WL(i),a=r?-1:1;o(e,void 0,[])();function o(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const f=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=UL,b,y,m;if((!t||s(l,c,d[d.length-1]||void 0))&&(f=fJ(n(l,d)),f[0]===m4))return f;if("children"in l&&l.children){const p=l;if(p.children&&f[0]!==dJ)for(y=(r?p.children.length:-1)+a,m=d.concat(p);y>-1&&y<p.children.length;){const g=p.children[y];if(b=o(g,y,m)(),b[0]===m4)return b;y=typeof b[1]=="number"?b[1]:y+a}}return f}}}function fJ(e){return Array.isArray(e)?e:typeof e=="number"?[uJ,e]:e==null?UL:[e]}function VL(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),hJ(e,s,o,i);function o(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return a(l,u,d)}}const Ax={}.hasOwnProperty,pJ={};function mJ(e,t){const n=t||pJ,r=new Map,i=new Map,s=new Map,a={...QQ,...n.handlers},o={all:c,applyData:vJ,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:gJ,wrap:_J};return VL(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const u=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();u.has(h)||u.set(h,d)}}),o;function l(d,u){const h=d.type,f=o.handlers[h];if(Ax.call(o.handlers,h)&&f)return f(o,d,u);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:y,...m}=d,p=qg(m);return p.children=o.all(d),p}return qg(d)}return(o.options.unknownHandler||yJ)(o,d,u)}function c(d){const u=[];if("children"in d){const h=d.children;let f=-1;for(;++f<h.length;){const b=o.one(h[f],d);if(b){if(f&&h[f-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=g4(b.value)),!Array.isArray(b)&&b.type==="element")){const y=b.children[0];y&&y.type==="text"&&(y.value=g4(y.value))}Array.isArray(b)?u.push(...b):u.push(b)}}}return u}}function gJ(e,t){e.position&&(t.position=iY(e))}function vJ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,qg(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function yJ(e,t){const n=t.data||{},r="value"in t&&!(Ax.call(n,"hProperties")||Ax.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _J(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function g4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function v4(e,t){const n=mJ(e,t),r=n.one(e,void 0),i=iJ(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function bJ(e,t){return e&&"run"in e?async function(n,r){const i=v4(n,t);await e.run(i,r)}:function(n){return v4(n,t||e)}}function y4(e){if(e)throw e}var Bm=Object.prototype.hasOwnProperty,qL=Object.prototype.toString,_4=Object.defineProperty,b4=Object.getOwnPropertyDescriptor,x4=function(t){return typeof Array.isArray=="function"?Array.isArray(t):qL.call(t)==="[object Array]"},w4=function(t){if(!t||qL.call(t)!=="[object Object]")return!1;var n=Bm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Bm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Bm.call(t,i)},S4=function(t,n){_4&&n.name==="__proto__"?_4(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},C4=function(t,n){if(n==="__proto__")if(Bm.call(t,n)){if(b4)return b4(t,n).value}else return;return t[n]},xJ=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=C4(o,n),i=C4(t,n),o!==i&&(d&&i&&(w4(i)||(s=x4(i)))?(s?(s=!1,a=r&&x4(r)?r:[]):a=r&&w4(r)?r:{},S4(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&S4(o,{name:n,newValue:i}));return o};const t_=vn(xJ);function Lx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wJ(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...c){const d=e[++s];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,d?SJ(d,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function SJ(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(l instanceof Promise?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Di={basename:CJ,dirname:kJ,extname:EJ,join:TJ,sep:"/"};function CJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bf(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function kJ(e){if(Bf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function EJ(e){Bf(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function TJ(...e){let t=-1,n;for(;++t<e.length;)Bf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$J(n)}function $J(e){Bf(e);const t=e.codePointAt(0)===47;let n=MJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function MJ(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Bf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RJ={cwd:AJ};function AJ(){return"/"}function Dx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LJ(e){if(typeof e=="string")e=new URL(e);else if(!Dx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return DJ(e)}function DJ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const n_=["history","path","basename","stem","extname","dirname"];class KL{constructor(t){let n;t?Dx(t)?n={path:t}:typeof t=="string"||PJ(t)?n={value:t}:n=t:n={},this.cwd=RJ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<n_.length;){const s=n_[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)n_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Di.basename(this.path):void 0}set basename(t){i_(t,"basename"),r_(t,"basename"),this.path=Di.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Di.dirname(this.path):void 0}set dirname(t){k4(this.basename,"dirname"),this.path=Di.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Di.extname(this.path):void 0}set extname(t){if(r_(t,"extname"),k4(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Di.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dx(t)&&(t=LJ(t)),i_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Di.basename(this.path,this.extname):void 0}set stem(t){i_(t,"stem"),r_(t,"stem"),this.path=Di.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new tr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function r_(e,t){if(e&&e.includes(Di.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Di.sep+"`")}function i_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function k4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OJ=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const a=Object.getOwnPropertyNames(i);for(const o of a){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(s,o,l)}return s},NJ={}.hasOwnProperty;class QS extends OJ{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wJ()}copy(){const t=new QS;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(t_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(a_("data",this.frozen),this.namespace[t]=n,this):NJ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(a_("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Hp(t),r=this.parser||this.Parser;return s_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),s_("process",this.parser||this.Parser),o_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Hp(t),l=r.parse(o);r.run(l,o,function(d,u,h){if(d||!u||!h)return c(d);const f=u,b=r.stringify(f,h);BJ(b)?h.value=b:h.result=b,c(d,h)});function c(d,u){d||!u?a(d):s?s(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),s_("processSync",this.parser||this.Parser),o_("processSync",this.compiler||this.Compiler),this.process(t,i),T4("processSync","process",n),r;function i(s,a){n=!0,y4(s),r=a}}run(t,n,r){E4(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=Hp(n);i.run(t,l,c);function c(d,u,h){const f=u||t;d?o(d):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),T4("runSync","run",r),i;function s(a,o){y4(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=Hp(n),i=this.compiler||this.Compiler;return o_("stringify",i),E4(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(a_("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=t_(!0,i.settings,c.settings))}function o(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];s(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,h=-1;for(;++u<r.length;)if(r[u][0]===c){h=u;break}if(h===-1)r.push([c,...d]);else if(d.length>0){let[f,...b]=d;const y=r[h][1];Lx(y)&&Lx(f)&&(f=t_(!0,y,f)),r[h]=[c,f,...b]}}}}const IJ=new QS().freeze();function s_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function o_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function a_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function E4(e){if(!Lx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function T4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hp(e){return jJ(e)?e:new KL(e)}function jJ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function BJ(e){return typeof e=="string"||FJ(e)}function FJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zJ="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$4=[],M4={allowDangerousHtml:!0},HJ=/^(https?|ircs?|mailto|xmpp)$/i,WJ=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function UJ(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,a=e.disallowedElements,o=e.rehypePlugins||$4,l=e.remarkPlugins||$4,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...M4}:M4,d=e.skipHtml,u=e.unwrapDisallowed,h=e.urlTransform||VJ,f=IJ().use(kQ).use(l).use(bJ,c).use(o),b=new KL;typeof r=="string"&&(b.value=r);for(const g of WJ)Object.hasOwn(e,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+zJ+g.id,void 0);const y=f.parse(b);let m=f.runSync(y,b);return i&&(m={type:"element",tagName:"div",properties:{className:i},children:m.type==="root"?m.children:[m]}),VL(m,p),uY(m,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function p(g,_,S){if(g.type==="raw"&&S&&typeof _=="number")return d?S.children.splice(_,1):S.children[_]={type:"text",value:g.value},_;if(g.type==="element"){let k;for(k in Jy)if(Object.hasOwn(Jy,k)&&Object.hasOwn(g.properties,k)){const C=g.properties[k],T=Jy[k];(T===null||T.includes(g.tagName))&&(g.properties[k]=h(String(C||""),k,g))}}if(g.type==="element"){let k=t?!t.includes(g.tagName):a?a.includes(g.tagName):!1;if(!k&&n&&typeof _=="number"&&(k=!n(g,_,S)),k&&S&&typeof _=="number")return u&&g.children?S.children.splice(_,1,...g.children):S.children.splice(_,1),_}}}function VJ(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||HJ.test(e.slice(0,t))?e:""}function qJ({href:e,children:t}){const n=bu()[1],r=e==null?void 0:e.startsWith("http"),i=()=>{e&&(r?sl(e):n(e??"/"))};return v.jsxs("button",{onClick:i,className:"text-accent no-underline hover:underline m-0",children:[t,r&&v.jsx(jo,{className:"inline ml-1 mb-1 h-5 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0"})]})}const KJ={code:({children:e})=>v.jsx(zn,{className:"not-prose",children:e}),pre:({children:e})=>v.jsx("pre",{className:"not-prose bg-muted p-2 rounded",children:e}),a:({children:e,href:t})=>v.jsx(qJ,{href:t,children:e})};function R4({md:e,isSmall:t,isTitle:n}){return v.jsx(UJ,{components:KJ,className:ee("prose prose-zinc dark:prose-invert",t&&"prose-sm",n&&"tracking-wide"),children:yV(e.replace(/\n/g,`  
`))})}let GJ={data:""},YJ=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||GJ,XJ=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,QJ=/\/\*[^]*?\*\/|  +/g,A4=/\n+/g,ao=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?ao(a,s):s+"{"+ao(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=ao(a,t?t.replace(/([^,])+/g,o=>s.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=ao.p?ao.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},us={},GL=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+GL(e[n]);return t}return e},JJ=(e,t,n,r,i)=>{let s=GL(e),a=us[s]||(us[s]=(l=>{let c=0,d=11;for(;c<l.length;)d=101*d+l.charCodeAt(c++)>>>0;return"go"+d})(s));if(!us[a]){let l=s!==e?e:(c=>{let d,u,h=[{}];for(;d=XJ.exec(c.replace(QJ,""));)d[4]?h.shift():d[3]?(u=d[3].replace(A4," ").trim(),h.unshift(h[0][u]=h[0][u]||{})):h[0][d[1]]=d[2].replace(A4," ").trim();return h[0]})(e);us[a]=ao(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let o=n&&us.g?us.g:null;return n&&(us.g=us[a]),((l,c,d,u)=>{u?c.data=c.data.replace(u,l):c.data.indexOf(l)===-1&&(c.data=d?l+c.data:c.data+l)})(us[a],t,r,o),a},ZJ=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];if(a&&a.call){let o=a(n),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":ao(o,""):o===!1?"":o}return r+i+(a??"")},"");function wv(e){let t=this||{},n=e.call?e(t.p):e;return JJ(n.unshift?n.raw?ZJ(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,YJ(t.target),t.g,t.o,t.k)}let YL,Px,Ox;wv.bind({g:1});let As=wv.bind({k:1});function eZ(e,t,n,r){ao.p=t,YL=e,Px=n,Ox=r}function ea(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let o=Object.assign({},s),l=o.className||i.className;n.p=Object.assign({theme:Px&&Px()},o),n.o=/ *go\d+/.test(l),o.className=wv.apply(n,r)+(l?" "+l:""),t&&(o.ref=a);let c=e;return e[0]&&(c=o.as||e,delete o.as),Ox&&c[0]&&Ox(o),YL(c,o)}return t?t(i):i}}var tZ=e=>typeof e=="function",Kg=(e,t)=>tZ(e)?e(t):e,nZ=(()=>{let e=0;return()=>(++e).toString()})(),XL=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),rZ=20,Fm=new Map,iZ=1e3,L4=e=>{if(Fm.has(e))return;let t=setTimeout(()=>{Fm.delete(e),ll({type:4,toastId:e})},iZ);Fm.set(e,t)},sZ=e=>{let t=Fm.get(e);t&&clearTimeout(t)},Nx=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,rZ)};case 1:return t.toast.id&&sZ(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?Nx(e,{type:1,toast:n}):Nx(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?L4(r):e.toasts.forEach(s=>{L4(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},zm=[],Hm={toasts:[],pausedAt:void 0},ll=e=>{Hm=Nx(Hm,e),zm.forEach(t=>{t(Hm)})},oZ={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},aZ=(e={})=>{let[t,n]=x.useState(Hm);x.useEffect(()=>(zm.push(n),()=>{let i=zm.indexOf(n);i>-1&&zm.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,a;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||oZ[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},lZ=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||nZ()}),Ff=e=>(t,n)=>{let r=lZ(t,e,n);return ll({type:2,toast:r}),r.id},Tr=(e,t)=>Ff("blank")(e,t);Tr.error=Ff("error");Tr.success=Ff("success");Tr.loading=Ff("loading");Tr.custom=Ff("custom");Tr.dismiss=e=>{ll({type:3,toastId:e})};Tr.remove=e=>ll({type:4,toastId:e});Tr.promise=(e,t,n)=>{let r=Tr.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Tr.success(Kg(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Tr.error(Kg(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var cZ=(e,t)=>{ll({type:1,toast:{id:e,height:t}})},uZ=()=>{ll({type:5,time:Date.now()})},dZ=e=>{let{toasts:t,pausedAt:n}=aZ(e);x.useEffect(()=>{if(n)return;let s=Date.now(),a=t.map(o=>{if(o.duration===1/0)return;let l=(o.duration||0)+o.pauseDuration-(s-o.createdAt);if(l<0){o.visible&&Tr.dismiss(o.id);return}return setTimeout(()=>Tr.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[t,n]);let r=x.useCallback(()=>{n&&ll({type:6,time:Date.now()})},[n]),i=x.useCallback((s,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:c}=a||{},d=t.filter(f=>(f.position||c)===(s.position||c)&&f.height),u=d.findIndex(f=>f.id===s.id),h=d.filter((f,b)=>b<u&&f.visible).length;return d.filter(f=>f.visible).slice(...o?[h+1]:[0,h]).reduce((f,b)=>f+(b.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:cZ,startPause:uZ,endPause:r,calculateOffset:i}}},hZ=As`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,fZ=As`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,pZ=As`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,mZ=ea("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${hZ} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${fZ} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${pZ} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,gZ=As`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,vZ=ea("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${gZ} 1s linear infinite;
`,yZ=As`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,_Z=As`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,bZ=ea("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${yZ} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${_Z} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,xZ=ea("div")`
  position: absolute;
`,wZ=ea("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,SZ=As`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,CZ=ea("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${SZ} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,kZ=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?x.createElement(CZ,null,t):t:n==="blank"?null:x.createElement(wZ,null,x.createElement(vZ,{...r}),n!=="loading"&&x.createElement(xZ,null,n==="error"?x.createElement(mZ,{...r}):x.createElement(bZ,{...r})))},EZ=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,TZ=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,$Z="0%{opacity:0;} 100%{opacity:1;}",MZ="0%{opacity:1;} 100%{opacity:0;}",RZ=ea("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,AZ=ea("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,LZ=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=XL()?[$Z,MZ]:[EZ(n),TZ(n)];return{animation:t?`${As(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${As(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},DZ=x.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?LZ(e.position||t||"top-center",e.visible):{opacity:0},s=x.createElement(kZ,{toast:e}),a=x.createElement(AZ,{...e.ariaProps},Kg(e.message,e));return x.createElement(RZ,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):x.createElement(x.Fragment,null,s,a))});eZ(x.createElement);var PZ=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=x.useCallback(a=>{if(a){let o=()=>{let l=a.getBoundingClientRect().height;r(e,l)};o(),new MutationObserver(o).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return x.createElement("div",{ref:s,className:t,style:n},i)},OZ=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:XL()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},NZ=wv`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,Wp=16,IZ=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:o,handlers:l}=dZ(n);return x.createElement("div",{style:{position:"fixed",zIndex:9999,top:Wp,left:Wp,right:Wp,bottom:Wp,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(c=>{let d=c.position||t,u=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),h=OZ(d,u);return x.createElement(PZ,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?NZ:"",style:h},c.type==="custom"?Kg(c.message,c):i?i(c):x.createElement(DZ,{toast:c,position:d}))}))},Gg=Tr;const jZ=["default","loading","info","success","warning","error"],BZ=Jo(`max-w-xl w-full sm:w-auto sm:min-w-[28rem] relative overflow-hidden z-40
    p-3 pr-10 flex items-center justify-between space-x-4
    rounded-xl border shadow-lg transition-all pointer-events-none
    text-black/75 dark:text-white/90`,{variants:{type:{default:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",loading:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",info:"border-info/70 bg-info-hint",success:"border-success/70 bg-success-hint",warning:"border-warning/70 bg-warning-hint",error:"border-destructive/70 bg-destructive-hint"}},defaultVariants:{type:"default"}}),FZ={default:v.jsx(Vq,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:v.jsx(dn,{className:"animate-spin"}),info:v.jsx(TS,{className:"stroke-info animate-toastbar-icon"}),success:v.jsx(Uq,{className:"stroke-success animate-toastbar-icon"}),warning:v.jsx(Wq,{className:"stroke-warning animate-toastbar-icon"}),error:v.jsx(yK,{className:"stroke-destructive animate-toastbar-icon"})},zZ=({t:e,type:t,data:n})=>{const[r,i]=x.useState(0);return x.useEffect(()=>{let s=null;const a=()=>{s&&clearInterval(s)};return t==="loading"&&e.visible?s=setInterval(()=>{i(o=>o+1)},1e3):s&&a(),a},[t,e.visible]),v.jsxs("div",{className:ee(BZ({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[v.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?v.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:v.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):FZ[t]}),v.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?v.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?v.jsxs(v.Fragment,{children:[n.title?v.jsx(R4,{md:`**${n.title}**`,isSmall:!0,isTitle:!0}):null,v.jsx(R4,{md:n.msg,isSmall:!0})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"font-semibold mb-1",children:n.title}),v.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&v.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",v.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:Oh,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),v.jsxs("button",{onClick:()=>Gg.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[v.jsx(ns,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})};function HZ(){return v.jsx(IZ,{reverseOrder:!0,containerStyle:{top:"calc(4.5rem + 1px)",zIndex:60}})}const aa=(e,t,n={})=>(n.duration??(n.duration=e==="loading"?1/0:5e3),Gg.custom(r=>v.jsx(zZ,{t:r,type:e,data:t}),n)),WZ=(e,t)=>aa(e.type,e,t),tn=Object.assign(WZ,{default:(e,t)=>aa("default",e,t),loading:(e,t)=>aa("loading",e,t),info:(e,t)=>aa("info",e,t),success:(e,t)=>aa("success",e,t),warning:(e,t)=>aa("warning",e,t),error:(e,t)=>aa("error",e,t),dismiss:Gg.dismiss,remove:Gg.remove}),JS=Tu(!1),QL=Tu(void 0),JL=()=>{const e=et(QL),t=et(JS);return n=>{e(n),t(!0)}},UZ=()=>{const e=lt(QL),[t,n]=fr(JS);return{isModalOpen:t,actionRef:e,closeModal:()=>n(!1)}},Ru=Ge(window.txConsts.preAuth),ZL=Ge(e=>!!e(Ru)),VZ=Ge(e=>{const t=e(Ru);return t?t.csrfToken:void 0}),qZ=Ge(e=>{const t=e(Ru);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),KZ=()=>lt(ZL),GZ=()=>lt(VZ),YZ=()=>et(Ru),ii=()=>{const e=lt(qZ);return{hasPerm:n=>{if(!e)return!1;try{return n==="master"?e.isMaster:e.isMaster||e.permissions.includes("all_permissions")||e.permissions.includes(n)}catch{return console.error(`Error validating permission '${n}' denied.`),!1}},isMaster:e?e.isMaster:!1}},ZS=()=>{const e=et(Ru);return(t="unknown",n="unknown")=>{console.log(`Logout notice received from '${t}' for reason '${n}'. Wiping auth data.`),e(!1),window.history.replaceState(null,"","/login#expired")}},cl=()=>{const[e,t]=fr(Ru),n=qa({mutationKey:["auth"],mutationFn:()=>fetch("/auth/logout",{method:"POST"}).then(r=>r.json()),onSuccess:r=>{r.logout&&(t(!1),window.history.replaceState(null,"","/login#logout"))}});return{authData:e,setAuthData:t,logout:{mutate:n.mutate,isLoading:n.isPending}}},XZ=hA((e,t)=>{e(ZL)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(hv,!1),t(fv,!1),t(pv,!1),t(NS,!1),t(IS,!1),t(jS,!1),t(vv,!1),t(JS,!1),t(ol,null),t(av,void 0),t(xS,void 0),t(lv,void 0),t(cv,void 0),t(wS,0),tn.dismiss())}),QZ=tL("liveConsoleCommandHistory",[]),JZ=tL("liveConsoleCommandBookmarks",[]),ZZ=50,eD=()=>{const[e,t]=fr(QZ);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>ZZ&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},eee=()=>{const[e,t]=fr(JZ);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function Up({icon:e,title:t,disabled:n,onClick:r}){return v.jsxs("div",{tabIndex:0,className:ee(`group bg-secondary xs:bg-transparent 2xl:hover:bg-secondary w-full rounded-lg px-1.5 py-2 cursor-pointer flex items-center justify-center
                transition-all ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,n&&"opacity-50 pointer-events-none"),onClick:()=>!n&&r(),onKeyDown:i=>(i.code==="Enter"||i.code==="Space")&&!n&&r(),children:[v.jsx(e,{className:"w-6 h-6 2xl:w-5 2xl:h-5 text-muted-foreground group-hover:scale-110 group-hover:text-secondary-foreground inline"}),v.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}function tee(e){const{history:t,appendHistory:n}=eD(),[r,i]=x.useState(-1),s=x.useRef(""),a=e.termInputRef,{hasPerm:o}=ii(),l=o("console.write");x.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const c=()=>{if(!a.current)return;r===-1&&(s.current=a.current.value??"");const f=r+1;t[f]&&(a.current.value=t[f],i(f))},d=()=>{if(!a.current)return;const f=r-1;f===-1?(a.current.value=s.current,i(f)):t[f]&&(a.current.value=t[f],i(f))},u=()=>{if(!a.current)return;const f=a.current.value.trim();i(-1),a.current.value="",s.current="",f&&(n(f),e.consoleWrite(f))},h=f=>{e.isConnected&&(f.key==="ArrowUp"?(c(),f.preventDefault()):f.key==="ArrowDown"?(d(),f.preventDefault()):f.key==="Enter"&&(u(),f.preventDefault()))};return v.jsxs("div",{className:"flex flex-col xs:flex-row xs:items-center gap-2 px-1 sm:px-4 py-2 border-t justify-center",children:[v.jsxs("div",{className:"flex items-center grow",children:[v.jsx("svg",{className:"hidden sm:block w-4 h-4 mr-2 text-warning-inline shrink-0",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"m9 18 6-6-6-6"})}),v.jsx(sn,{ref:a,className:"w-full",placeholder:"Type a command...",type:"text",disabled:!e.isConnected||!l,onKeyDown:h,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),v.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[v.jsx(Up,{icon:jq,title:"Saved",onClick:e.toggleSaveSheet}),v.jsx(Up,{icon:EK,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),v.jsx(Up,{icon:NK,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),v.jsx(Up,{icon:tK,title:"Download",disabled:!e.isConnected,onClick:()=>{sl("/fxserver/downloadLog")}})]})]})}function nee(){return v.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("polyline",{points:"4 17 10 11 4 5"}),v.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),v.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function Ll({title:e,onClick:t,isActive:n,children:r}){return v.jsx("button",{title:e,className:ee("rounded p-0.5","hover:bg-secondary-foreground hover:text-secondary","focus:outline-none focus:ring-1 focus:ring-secondary-foreground focus:ring-offset-1x focus:ring-offset-secondary-foreground",n&&"bg-muted-foreground text-secondary"),onClick:t,children:r})}const l_="No results",ree={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function tD({show:e,setShow:t,searchAddon:n}){const[r,i]=x.useState(!1),[s,a]=x.useState(!1),[o,l]=x.useState(!1),c=x.useRef(null),[d,u]=x.useState(l_),h=k=>{n.clearDecorations(),k&&u(k)},f=k=>({decorations:ree,caseSensitive:r,wholeWord:s,regex:o,...k});x.useEffect(()=>{var k;e?(k=c.current)==null||k.focus():h(l_)},[e]),x.useEffect(()=>{if(!n)return;const k=n.onDidChangeResults(({resultIndex:C,resultCount:T})=>{u(C===-1?l_:`${C+1}/${T}`)});return()=>{k.dispose()}},[]);const b=()=>{!c.current||!c.current.value||(console.log("backward search for",c.current.value),n.findPrevious(c.current.value,f()))},y=()=>{!c.current||!c.current.value||(console.log("forward search for",c.current.value),n.findNext(c.current.value,f()))},m=k=>{c.current&&(console.log("search input keydown",k.code),k.code==="Enter"&&(k.shiftKey?b():y(),k.preventDefault()))},p=k=>{c.current&&y()},g=()=>{c.current&&(i(!r),h(),n.findNext(c.current.value,f({caseSensitive:!r})))},_=()=>{c.current&&(a(!s),h(),n.findNext(c.current.value,f({wholeWord:!s})))},S=()=>{c.current&&(l(!o),h(),n.findNext(c.current.value,f({regex:!o})))};return wi("message",k=>{var C;k.data.type==="liveConsoleSearchHotkey"&&(k.data.action==="previous"?b():k.data.action==="next"?y():k.data.action==="focus"&&((C=c.current)==null||C.focus()))}),e?v.jsxs("div",{className:"absolute top-0 xs:right-4 bg-secondary border z-10 flex items-center justify-center gap-1 xs:gap-4 shadow-xl p-1 rounded-b-lg border-t-0 w-full xs:w-auto flex-wrap",children:[v.jsxs("div",{className:"relative",children:[v.jsx(sn,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:m,onChange:p,onBlur:()=>{n.clearActiveDecoration()}}),v.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[v.jsx(Ll,{title:"Case Sensitive",isActive:r,onClick:g,children:v.jsx(zq,{className:"h-5 w-5"})}),v.jsx(Ll,{title:"Whole Word",isActive:s,onClick:_,children:v.jsx(jK,{className:"h-5 w-5"})}),v.jsx(Ll,{title:"Regex",isActive:o,onClick:S,children:v.jsx(SK,{className:"h-4 w-5"})})]})]}),v.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:d}),v.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[v.jsx(Ll,{title:"Previous",onClick:b,children:v.jsx(Oq,{className:"h-5 w-5"})}),v.jsx(Ll,{title:"Next",onClick:y,children:v.jsx(Pq,{className:"h-5 w-5"})}),v.jsx(Ll,{title:"Close",onClick:()=>{t(!1)},children:v.jsx(ns,{className:"h-5 w-5"})})]})]}):null}function iee({isOpen:e,closeSheet:t}){return v.jsx("div",{className:ee("absolute inset-0 z-20","bg-black/60 duration-300","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","data-[state=open]:opacity-100","data-[state=closed]:opacity-0"),"data-state":e?"open":"closed",onClick:t})}function see({closeSheet:e}){return v.jsx("button",{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-0 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer",onClick:e,title:"Close",children:v.jsx(ns,{className:"h-8 w-8"})})}function D4({cmd:e,type:t,onClick:n,onFavAction:r}){const i=s=>{s.stopPropagation(),r()};return v.jsxs("div",{onClick:n,className:"px-2 py-1 flex justify-between items-center rounded-lg bg-card hover:bg-muted cursor-pointer group",children:[v.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),v.jsx("div",{className:"min-w-max",children:v.jsx("button",{className:"size-7 rounded-lg flex items-center justify-center hover:bg-primary hover:text-primary-foreground invisible group-hover:visible",onClick:i,children:t==="history"?v.jsxs(v.Fragment,{children:[v.jsx(DK,{className:"size-5"}),v.jsx("span",{className:"sr-only",children:"Save"})]}):v.jsxs(v.Fragment,{children:[v.jsx(LK,{className:"size-5"}),v.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function oee({toTermInput:e}){const{history:t,wipeHistory:n}=eD(),{bookmarks:r,addBookmark:i,removeBookmark:s}=eee(),a=mv(),o=()=>{tn.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:c=>{c&&i(c)}})};return v.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[v.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[v.jsx("h2",{className:"text-xl font-bold",children:"History"}),v.jsxs(Si,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[v.jsx("button",{onClick:o,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:v.jsxs("div",{className:"flex items-center justify-center gap-2",children:[v.jsx(ns,{className:"w-4 h-4 inline"}),"Clear History"]})}),v.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:t.map((c,d)=>v.jsx(D4,{cmd:c,type:"history",onClick:()=>e(c),onFavAction:()=>i(c)},d))}),t.length===0&&v.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),v.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[v.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),v.jsxs(Si,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[v.jsx("button",{onClick:l,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:v.jsxs("div",{className:"flex items-center justify-center gap-2",children:[v.jsx(jA,{className:"w-4 h-4 inline"}),"Add New"]})}),v.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:r.map((c,d)=>v.jsx(D4,{cmd:c,type:"saved",onClick:()=>e(c),onFavAction:()=>s(c)},d))}),r.length===0&&v.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",v.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function aee({isOpen:e,closeSheet:t,toTermInput:n}){return v.jsxs(v.Fragment,{children:[v.jsx(iee,{isOpen:e,closeSheet:t}),v.jsxs("div",{"data-state":e?"open":"closed",className:ee("absolute z-20 inset-y-0 w-full md:max-w-2xl","bg-background px-4 pt-6 shadow-lg border-l","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","transition-all duration-300 ease-in-out",e?"right-0 opacity-100":"-right-full opacity-0"),children:[v.jsx(see,{closeSheet:t}),v.jsx(oee,{toTermInput:n})]})]})}class nD{constructor(t,n){$l(this,"btnRef");$l(this,"containerElement");$l(this,"_disposables",[]);this.btnRef=t,this.containerElement=n}activate(t){if(!this.containerElement)throw new Error("containerElement is null");this.containerElement.addEventListener("wheel",i=>{this.checkViewportY(t)});const n=t.onScroll(()=>{this.checkViewportY(t)});this._disposables.push(n);const r=t.onLineFeed(()=>{this.checkViewportY(t)});this._disposables.push(r)}checkViewportY(t){t.buffer.active.viewportY===t.buffer.active.baseY?this.btnRef.classList.add("hidden"):this.btnRef.classList.remove("hidden")}dispose(){this._disposables.forEach(t=>t.dispose()),this._disposables.length=0}}const lee={background:"#222326",foreground:"#F8F8F8",black:"#000000",brightBlack:"#555555",red:"#D62341",brightRed:"#FF5370",green:"#9ECE58",brightGreen:"#C3E88D",yellow:"#FAED70",brightYellow:"#FFCB6B",blue:"#396FE2",brightBlue:"#82AAFF",magenta:"#BB80B3",brightMagenta:"#C792EA",cyan:"#2DDAFD",brightCyan:"#89DDFF",white:"#D0D0D0",brightWhite:"#FFFFFF"},rD={theme:lee,convertEol:!0,cursorBlink:!0,cursorStyle:"bar",disableStdin:!0,drawBoldTextInBrightColors:!1,fontFamily:"JetBrains Mono Variable, monospace",fontSize:14,lineHeight:1.1,fontWeight:"300",fontWeightBold:"600",letterSpacing:.8,scrollback:5e3,allowProposedApi:!0,allowTransparency:!0,overviewRulerWidth:15},vd=150,cee=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,uee=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F\x80-\x9F]/g,dee=/(\u001b\[|\u009B)[\d;]+[@-K]/g,hee=/\u001b[^m]*?m/g,fee=e=>e.replace(uee,"").replace(dee,"").replace(hee,"");function pee(){const[e,t]=x.useState(!1),[n,r]=x.useState(!1),[i,s]=x.useState(!1),a=x.useRef(null),o=dv(),l=x.useRef(null),c=x.useRef(null),d=x.useMemo(()=>new kA.Terminal(rD),[]),u=x.useMemo(()=>new RA.FitAddon,[]),h=x.useMemo(()=>new LA.SearchAddon,[]),f=($,M)=>{sl(M)},b=x.useMemo(()=>new PA.WebLinksAddon(f),[]),y=Fn(vd,$=>{window.postMessage({type:"liveConsoleSearchHotkey",action:$})},{noTrailing:!0}),m=()=>{if(!c.current||!d.element||!u){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const $=u.proposeDimensions();$?d.resize($.cols,$.rows):console.log("refitTerminal: no proposed dimensions")};wi("resize",bS(100,m)),x.useEffect(()=>{if(c.current&&l.current&&!d.element){console.log("live console xterm init"),c.current.innerHTML="",d.loadAddon(u),d.loadAddon(h),d.loadAddon(b),d.loadAddon(new $A.CanvasAddon),d.loadAddon(new nD(l.current,c.current)),d.open(c.current),d.write("\x1B[?25l"),m();const $=Fn(vd,()=>{d.scrollLines(Math.min(1,2-d.rows))},{noTrailing:!0}),M=Fn(vd,()=>{d.scrollLines(Math.max(1,d.rows-2))},{noTrailing:!0}),P=Fn(vd,()=>{d.scrollToTop()},{noTrailing:!0}),D=Fn(vd,()=>{d.scrollToBottom()},{noTrailing:!0});d.attachCustomKeyEventHandler(R=>R.code==="F5"||R.code==="Escape"||R.code==="KeyF"&&(R.ctrlKey||R.metaKey)||R.code==="F3"?!1:R.code==="KeyC"&&(R.ctrlKey||R.metaKey)?(document.execCommand("copy"),d.clearSelection(),!1):R.code==="PageUp"?($(),!1):R.code==="PageDown"?(M(),!1):R.code==="Home"?(P(),!1):R.code==="End"?(D(),!1):!kS(R))}},[d]),wi("keydown",$=>{$.code==="F5"?n&&(o(),$.preventDefault()):$.code==="Escape"?(h.clearDecorations(),s(!1)):$.code==="KeyF"&&($.ctrlKey||$.metaKey)?(i?y("focus"):s(!0),$.preventDefault()):$.code==="F3"&&(y($.shiftKey?"previous":"next"),$.preventDefault())});const p=$=>{const M=d.registerMarker(0),P=d.registerDecoration({marker:M});P&&P.onRender(D=>{D.classList.add("cursor-pointer"),D.innerText="🔠",D.onclick=()=>{tn.info({title:"Bidirectional Text Detected:",msg:$})}})},g=$=>{const M=$.split(/\r?\n/);M.length&&!M[M.length-1]&&M.pop();for(const P of M)cee.test(P)&&p(fee(P)),d.writeln(P)},_=x.useRef(0),S=x.useRef(null);x.useEffect(()=>(S.current=mS(["liveconsole"]),S.current.on("connect",()=>{console.log("LiveConsole Socket.IO Connected."),r(!0)}),S.current.on("disconnect",$=>{console.log("LiveConsole Socket.IO Disonnected:",$);const M=_.current+1;_.current=M,setTimeout(()=>{_.current===M&&r(!1)},500)}),S.current.on("error",$=>{console.log("LiveConsole Socket.IO",$)}),S.current.on("consoleData",function($){g($)}),()=>{var $,M;($=S.current)==null||$.removeAllListeners(),(M=S.current)==null||M.disconnect()}),[]);const k=$=>{!n||!S.current||S.current.emit("consoleCommand",$)},C=()=>{d.clear()},T=()=>{s(!i)},w=()=>{t(!e)},E=$=>{a.current&&(a.current.value=$,a.current.focus()),t(!1)};return v.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[v.jsx(nee,{}),v.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:v.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:v.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[v.jsx(dn,{className:"w-16 h-16 animate-spin"}),v.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),v.jsx(aee,{isOpen:e,closeSheet:()=>t(!1),toTermInput:$=>E($)}),v.jsx("div",{ref:c,className:"absolute top-1 left-2 right-0 bottom-0"}),v.jsx(tD,{show:i,setShow:s,searchAddon:h}),v.jsx("button",{ref:l,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{d.scrollToBottom()},children:v.jsx(NA,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),v.jsx(tee,{termInputRef:a,isConnected:n,consoleWrite:k,consoleClear:C,toggleSaveSheet:w,toggleSearchBar:T})]})}const mee=e=>1- --e*e*e*e,P4=1e3/60,Vp=({countTo:e,duration:t=1250})=>{const[n,r]=x.useState(0);return x.useEffect(()=>{let i=0;const s=Math.round(t/P4),a=setInterval(()=>{i++;const o=mee(i/s);r(e*o),i===s&&clearInterval(a)},P4)},[]),Math.floor(n).toLocaleString("en-US")};function qp(){return v.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function iD({callouts:e}){return e.length!==4?null:v.jsxs("div",{className:"grid px-2 md:px-0 gap-2 xs:gap-4 grid-cols-2 lg:grid-cols-4 mb-4 md:mb-6",children:[v.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),v.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?v.jsx(qp,{}):v.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,v.jsx(Vp,{countTo:e[0].value})]})]}),v.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),v.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?v.jsx(qp,{}):v.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,v.jsx(Vp,{countTo:e[1].value})]})]}),v.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),v.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?v.jsx(qp,{}):v.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,v.jsx(Vp,{countTo:e[2].value})]})]}),v.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),v.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?v.jsx(qp,{}):v.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,v.jsx(Vp,{countTo:e[3].value})]})]})]})}function Ls({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=gee({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,o=Ct(n),l=x.useCallback(c=>{if(s){const u=typeof c=="function"?c(e):c;u!==e&&o(u)}else i(c)},[s,e,i,o]);return[a,l]}function gee({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,i=x.useRef(r),s=Ct(t);return x.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function zf(e){const t=e+"CollectionProvider",[n,r]=gr(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=f=>{const{scope:b,children:y}=f,m=Ye.useRef(null),p=Ye.useRef(new Map).current;return Ye.createElement(i,{scope:b,itemMap:p,collectionRef:m},y)},o=e+"CollectionSlot",l=Ye.forwardRef((f,b)=>{const{scope:y,children:m}=f,p=s(o,y),g=He(b,p.collectionRef);return Ye.createElement(Io,{ref:g},m)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",u=Ye.forwardRef((f,b)=>{const{scope:y,children:m,...p}=f,g=Ye.useRef(null),_=He(b,g),S=s(c,y);return Ye.useEffect(()=>(S.itemMap.set(g,{ref:g,...p}),()=>void S.itemMap.delete(g))),Ye.createElement(Io,{[d]:"",ref:_},m)});function h(f){const b=s(e+"CollectionConsumer",f);return Ye.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const p=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((S,k)=>p.indexOf(S.ref.current)-p.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},h,r]}function vee(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Ix="dismissableLayer.update",yee="dismissableLayer.pointerDownOutside",_ee="dismissableLayer.focusOutside";let O4;const bee=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hf=x.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=x.useContext(bee),[u,h]=x.useState(null),f=(n=u==null?void 0:u.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=x.useState({}),y=He(t,w=>h(w)),m=Array.from(d.layers),[p]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(p),_=u?m.indexOf(u):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,k=_>=g,C=xee(w=>{const E=w.target,$=[...d.branches].some(M=>M.contains(E));!k||$||(s==null||s(w),o==null||o(w),w.defaultPrevented||l==null||l())},f),T=wee(w=>{const E=w.target;[...d.branches].some(M=>M.contains(E))||(a==null||a(w),o==null||o(w),w.defaultPrevented||l==null||l())},f);return vee(w=>{_===d.layers.size-1&&(i==null||i(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},f),x.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(O4=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),N4(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=O4)}},[u,f,r,d]),x.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),N4())},[u,d]),x.useEffect(()=>{const w=()=>b({});return document.addEventListener(Ix,w),()=>document.removeEventListener(Ix,w)},[]),x.createElement($e.div,te({},c,{ref:y,style:{pointerEvents:S?k?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,C.onPointerDownCapture)}))});function xee(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let c=function(){sD(yee,n,l,{discrete:!0})};const l={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function wee(e,t=globalThis==null?void 0:globalThis.document){const n=Ct(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&sD(_ee,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function N4(){const e=new CustomEvent(Ix);document.dispatchEvent(e)}function sD(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Og(i,s):i.dispatchEvent(s)}let c_=0;function eC(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:I4()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:I4()),c_++,()=>{c_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),c_--}},[])}function I4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const u_="focusScope.autoFocusOnMount",d_="focusScope.autoFocusOnUnmount",j4={bubbles:!1,cancelable:!0},tC=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=x.useState(null),c=Ct(i),d=Ct(s),u=x.useRef(null),h=He(t,y=>l(y)),f=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let y=function(_){if(f.paused||!o)return;const S=_.target;o.contains(S)?u.current=S:Zs(u.current,{select:!0})},m=function(_){if(f.paused||!o)return;const S=_.relatedTarget;S!==null&&(o.contains(S)||Zs(u.current,{select:!0}))},p=function(_){if(document.activeElement===document.body)for(const k of _)k.removedNodes.length>0&&Zs(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",m);const g=new MutationObserver(p);return o&&g.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",m),g.disconnect()}}},[r,o,f.paused]),x.useEffect(()=>{if(o){F4.add(f);const y=document.activeElement;if(!o.contains(y)){const p=new CustomEvent(u_,j4);o.addEventListener(u_,c),o.dispatchEvent(p),p.defaultPrevented||(See($ee(oD(o)),{select:!0}),document.activeElement===y&&Zs(o))}return()=>{o.removeEventListener(u_,c),setTimeout(()=>{const p=new CustomEvent(d_,j4);o.addEventListener(d_,d),o.dispatchEvent(p),p.defaultPrevented||Zs(y??document.body,{select:!0}),o.removeEventListener(d_,d),F4.remove(f)},0)}}},[o,c,d,f]);const b=x.useCallback(y=>{if(!n&&!r||f.paused)return;const m=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(m&&p){const g=y.currentTarget,[_,S]=Cee(g);_&&S?!y.shiftKey&&p===S?(y.preventDefault(),n&&Zs(_,{select:!0})):y.shiftKey&&p===_&&(y.preventDefault(),n&&Zs(S,{select:!0})):p===g&&y.preventDefault()}},[n,r,f.paused]);return x.createElement($e.div,te({tabIndex:-1},a,{ref:h,onKeyDown:b}))});function See(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}function Cee(e){const t=oD(e),n=B4(t,e),r=B4(t.reverse(),e);return[n,r]}function oD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B4(e,t){for(const n of e)if(!kee(n,{upTo:t}))return n}function kee(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Eee(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Eee(e)&&t&&e.select()}}const F4=Tee();function Tee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=z4(e,t),e.unshift(t)},remove(t){var n;e=z4(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function z4(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $ee(e){return e.filter(t=>t.tagName!=="A")}const Mee=d7.useId||(()=>{});let Ree=0;function Xr(e){const[t,n]=x.useState(Mee());return un(()=>{e||n(r=>r??String(Ree++))},[e]),e||(t?`radix-${t}`:"")}const Aee=["top","right","bottom","left"],Bo=Math.min,Cr=Math.max,Yg=Math.round,Kp=Math.floor,Fo=e=>({x:e,y:e}),Lee={left:"right",right:"left",bottom:"top",top:"bottom"},Dee={start:"end",end:"start"};function jx(e,t,n){return Cr(e,Bo(t,n))}function Ds(e,t){return typeof e=="function"?e(t):e}function Ps(e){return e.split("-")[0]}function Au(e){return e.split("-")[1]}function nC(e){return e==="x"?"y":"x"}function rC(e){return e==="y"?"height":"width"}function Lu(e){return["top","bottom"].includes(Ps(e))?"y":"x"}function iC(e){return nC(Lu(e))}function Pee(e,t,n){n===void 0&&(n=!1);const r=Au(e),i=iC(e),s=rC(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Xg(a)),[a,Xg(a)]}function Oee(e){const t=Xg(e);return[Bx(e),t,Bx(t)]}function Bx(e){return e.replace(/start|end/g,t=>Dee[t])}function Nee(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:a;default:return[]}}function Iee(e,t,n,r){const i=Au(e);let s=Nee(Ps(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(Bx)))),s}function Xg(e){return e.replace(/left|right|bottom|top/g,t=>Lee[t])}function jee(e){return{top:0,right:0,bottom:0,left:0,...e}}function aD(e){return typeof e!="number"?jee(e):{top:e,right:e,bottom:e,left:e}}function Qg(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function H4(e,t,n){let{reference:r,floating:i}=e;const s=Lu(t),a=iC(t),o=rC(a),l=Ps(t),c=s==="y",d=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,h=r[o]/2-i[o]/2;let f;switch(l){case"top":f={x:d,y:r.y-i.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:u};break;case"left":f={x:r.x-i.width,y:u};break;default:f={x:r.x,y:r.y}}switch(Au(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}const Bee=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:u}=H4(c,r,l),h=r,f={},b=0;for(let y=0;y<o.length;y++){const{name:m,fn:p}=o[y],{x:g,y:_,data:S,reset:k}=await p({x:d,y:u,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});d=g??d,u=_??u,f={...f,[m]:{...f[m],...S}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(c=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:d,y:u}=H4(c,h,l)),y=-1)}return{x:d,y:u,placement:h,strategy:i,middlewareData:f}};async function Ih(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:f=0}=Ds(t,e),b=aD(f),m=o[h?u==="floating"?"reference":"floating":u],p=Qg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),g=u==="floating"?{...a.floating,x:r,y:i}:a.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),S=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},k=Qg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:l}):g);return{top:(p.top-k.top+b.top)/S.y,bottom:(k.bottom-p.bottom+b.bottom)/S.y,left:(p.left-k.left+b.left)/S.x,right:(k.right-p.right+b.right)/S.x}}const Fee=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=t,{element:c,padding:d=0}=Ds(e,t)||{};if(c==null)return{};const u=aD(d),h={x:n,y:r},f=iC(i),b=rC(f),y=await a.getDimensions(c),m=f==="y",p=m?"top":"left",g=m?"bottom":"right",_=m?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[f]-h[f]-s.floating[b],k=h[f]-s.reference[f],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=C?C[_]:0;(!T||!await(a.isElement==null?void 0:a.isElement(C)))&&(T=o.floating[_]||s.floating[b]);const w=S/2-k/2,E=T/2-y[b]/2-1,$=Bo(u[p],E),M=Bo(u[g],E),P=$,D=T-y[b]-M,R=T/2-y[b]/2+w,O=jx(P,R,D),N=!l.arrow&&Au(i)!=null&&R!==O&&s.reference[b]/2-(R<P?$:M)-y[b]/2<0,I=N?R<P?R-P:R-D:0;return{[f]:h[f]+I,data:{[f]:O,centerOffset:R-O-I,...N&&{alignmentOffset:I}},reset:N}}}),zee=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...m}=Ds(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=Ps(i),g=Ps(o)===o,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=h||(g||!y?[Xg(o)]:Oee(o));!h&&b!=="none"&&S.push(...Iee(o,y,b,_));const k=[o,...S],C=await Ih(t,m),T=[];let w=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&T.push(C[p]),u){const P=Pee(i,a,_);T.push(C[P[0]],C[P[1]])}if(w=[...w,{placement:i,overflows:T}],!T.every(P=>P<=0)){var E,$;const P=(((E=s.flip)==null?void 0:E.index)||0)+1,D=k[P];if(D)return{data:{index:P,overflows:w},reset:{placement:D}};let R=($=w.filter(O=>O.overflows[0]<=0).sort((O,N)=>O.overflows[1]-N.overflows[1])[0])==null?void 0:$.placement;if(!R)switch(f){case"bestFit":{var M;const O=(M=w.map(N=>[N.placement,N.overflows.filter(I=>I>0).reduce((I,j)=>I+j,0)]).sort((N,I)=>N[1]-I[1])[0])==null?void 0:M[0];O&&(R=O);break}case"initialPlacement":R=o;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function W4(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function U4(e){return Aee.some(t=>e[t]>=0)}const Hee=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ds(e,t);switch(r){case"referenceHidden":{const s=await Ih(t,{...i,elementContext:"reference"}),a=W4(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:U4(a)}}}case"escaped":{const s=await Ih(t,{...i,altBoundary:!0}),a=W4(s,n.floating);return{data:{escapedOffsets:a,escaped:U4(a)}}}default:return{}}}}};async function Wee(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Ps(n),o=Au(n),l=Lu(n)==="y",c=["left","top"].includes(a)?-1:1,d=s&&l?-1:1,u=Ds(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return o&&typeof b=="number"&&(f=o==="end"?b*-1:b),l?{x:f*d,y:h*c}:{x:h*c,y:f*d}}const Uee=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,l=await Wee(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},Vee=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:m=>{let{x:p,y:g}=m;return{x:p,y:g}}},...l}=Ds(e,t),c={x:n,y:r},d=await Ih(t,l),u=Lu(Ps(i)),h=nC(u);let f=c[h],b=c[u];if(s){const m=h==="y"?"top":"left",p=h==="y"?"bottom":"right",g=f+d[m],_=f-d[p];f=jx(g,f,_)}if(a){const m=u==="y"?"top":"left",p=u==="y"?"bottom":"right",g=b+d[m],_=b-d[p];b=jx(g,b,_)}const y=o.fn({...t,[h]:f,[u]:b});return{...y,data:{x:y.x-n,y:y.y-r}}}}},qee=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=Ds(e,t),d={x:n,y:r},u=Lu(i),h=nC(u);let f=d[h],b=d[u];const y=Ds(o,t),m=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const _=h==="y"?"height":"width",S=s.reference[h]-s.floating[_]+m.mainAxis,k=s.reference[h]+s.reference[_]-m.mainAxis;f<S?f=S:f>k&&(f=k)}if(c){var p,g;const _=h==="y"?"width":"height",S=["top","left"].includes(Ps(i)),k=s.reference[u]-s.floating[_]+(S&&((p=a.offset)==null?void 0:p[u])||0)+(S?0:m.crossAxis),C=s.reference[u]+s.reference[_]+(S?0:((g=a.offset)==null?void 0:g[u])||0)-(S?m.crossAxis:0);b<k?b=k:b>C&&(b=C)}return{[h]:f,[u]:b}}}},Kee=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:a=()=>{},...o}=Ds(e,t),l=await Ih(t,o),c=Ps(n),d=Au(n),u=Lu(n)==="y",{width:h,height:f}=r.floating;let b,y;c==="top"||c==="bottom"?(b=c,y=d===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,b=d==="end"?"top":"bottom");const m=f-l[b],p=h-l[y],g=!t.middlewareData.shift;let _=m,S=p;if(u){const C=h-l.left-l.right;S=d||g?Bo(p,C):C}else{const C=f-l.top-l.bottom;_=d||g?Bo(m,C):C}if(g&&!d){const C=Cr(l.left,0),T=Cr(l.right,0),w=Cr(l.top,0),E=Cr(l.bottom,0);u?S=h-2*(C!==0||T!==0?C+T:Cr(l.left,l.right)):_=f-2*(w!==0||E!==0?w+E:Cr(l.top,l.bottom))}await a({...t,availableWidth:S,availableHeight:_});const k=await i.getDimensions(s.floating);return h!==k.width||f!==k.height?{reset:{rects:!0}}:{}}}};function zo(e){return lD(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ws(e){var t;return(t=(lD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function lD(e){return e instanceof Node||e instanceof Mr(e).Node}function Os(e){return e instanceof Element||e instanceof Mr(e).Element}function Ji(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function V4(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function Wf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Gee(e){return["table","td","th"].includes(zo(e))}function sC(e){const t=oC(),n=ti(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Yee(e){let t=Jc(e);for(;Ji(t)&&!Sv(t);){if(sC(t))return t;t=Jc(t)}return null}function oC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sv(e){return["html","body","#document"].includes(zo(e))}function ti(e){return Mr(e).getComputedStyle(e)}function Cv(e){return Os(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Jc(e){if(zo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||V4(e)&&e.host||Ws(e);return V4(t)?t.host:t}function cD(e){const t=Jc(e);return Sv(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ji(t)&&Wf(t)?t:cD(t)}function jh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=cD(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Mr(i);return s?t.concat(a,a.visualViewport||[],Wf(i)?i:[],a.frameElement&&n?jh(a.frameElement):[]):t.concat(i,jh(i,[],n))}function uD(e){const t=ti(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ji(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=Yg(n)!==s||Yg(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function aC(e){return Os(e)?e:e.contextElement}function gc(e){const t=aC(e);if(!Ji(t))return Fo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=uD(t);let a=(s?Yg(n.width):n.width)/r,o=(s?Yg(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Xee=Fo(0);function dD(e){const t=Mr(e);return!oC()||!t.visualViewport?Xee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mr(e)?!1:t}function Ka(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=aC(e);let a=Fo(1);t&&(r?Os(r)&&(a=gc(r)):a=gc(e));const o=Qee(s,n,r)?dD(s):Fo(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,d=i.width/a.x,u=i.height/a.y;if(s){const h=Mr(s),f=r&&Os(r)?Mr(r):r;let b=h,y=b.frameElement;for(;y&&r&&f!==b;){const m=gc(y),p=y.getBoundingClientRect(),g=ti(y),_=p.left+(y.clientLeft+parseFloat(g.paddingLeft))*m.x,S=p.top+(y.clientTop+parseFloat(g.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,u*=m.y,l+=_,c+=S,b=Mr(y),y=b.frameElement}}return Qg({width:d,height:u,x:l,y:c})}const Jee=[":popover-open",":modal"];function hD(e){return Jee.some(t=>{try{return e.matches(t)}catch{return!1}})}function Zee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=Ws(r),o=t?hD(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Fo(1);const d=Fo(0),u=Ji(r);if((u||!u&&!s)&&((zo(r)!=="body"||Wf(a))&&(l=Cv(r)),Ji(r))){const h=Ka(r);c=gc(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}}function ete(e){return Array.from(e.getClientRects())}function fD(e){return Ka(Ws(e)).left+Cv(e).scrollLeft}function tte(e){const t=Ws(e),n=Cv(e),r=e.ownerDocument.body,i=Cr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Cr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+fD(e);const o=-n.scrollTop;return ti(r).direction==="rtl"&&(a+=Cr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function nte(e,t){const n=Mr(e),r=Ws(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const c=oC();(!c||c&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function rte(e,t){const n=Ka(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Ji(e)?gc(e):Fo(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:a,height:o,x:l,y:c}}function q4(e,t,n){let r;if(t==="viewport")r=nte(e,n);else if(t==="document")r=tte(Ws(e));else if(Os(t))r=rte(t,n);else{const i=dD(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Qg(r)}function pD(e,t){const n=Jc(e);return n===t||!Os(n)||Sv(n)?!1:ti(n).position==="fixed"||pD(n,t)}function ite(e,t){const n=t.get(e);if(n)return n;let r=jh(e,[],!1).filter(o=>Os(o)&&zo(o)!=="body"),i=null;const s=ti(e).position==="fixed";let a=s?Jc(e):e;for(;Os(a)&&!Sv(a);){const o=ti(a),l=sC(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Wf(a)&&!l&&pD(e,a))?r=r.filter(d=>d!==a):i=o,a=Jc(a)}return t.set(e,r),r}function ste(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ite(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,d)=>{const u=q4(t,d,i);return c.top=Cr(u.top,c.top),c.right=Bo(u.right,c.right),c.bottom=Bo(u.bottom,c.bottom),c.left=Cr(u.left,c.left),c},q4(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ote(e){const{width:t,height:n}=uD(e);return{width:t,height:n}}function ate(e,t,n){const r=Ji(t),i=Ws(t),s=n==="fixed",a=Ka(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=Fo(0);if(r||!r&&!s)if((zo(t)!=="body"||Wf(i))&&(o=Cv(t)),r){const u=Ka(t,!0,s,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=fD(i));const c=a.left+o.scrollLeft-l.x,d=a.top+o.scrollTop-l.y;return{x:c,y:d,width:a.width,height:a.height}}function K4(e,t){return!Ji(e)||ti(e).position==="fixed"?null:t?t(e):e.offsetParent}function mD(e,t){const n=Mr(e);if(!Ji(e)||hD(e))return n;let r=K4(e,t);for(;r&&Gee(r)&&ti(r).position==="static";)r=K4(r,t);return r&&(zo(r)==="html"||zo(r)==="body"&&ti(r).position==="static"&&!sC(r))?n:r||Yee(e)||n}const lte=async function(e){const t=this.getOffsetParent||mD,n=this.getDimensions;return{reference:ate(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function cte(e){return ti(e).direction==="rtl"}const ute={convertOffsetParentRelativeRectToViewportRelativeRect:Zee,getDocumentElement:Ws,getClippingRect:ste,getOffsetParent:mD,getElementRects:lte,getClientRects:ete,getDimensions:ote,getScale:gc,isElement:Os,isRTL:cte};function dte(e,t){let n=null,r;const i=Ws(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const{left:c,top:d,width:u,height:h}=e.getBoundingClientRect();if(o||t(),!u||!h)return;const f=Kp(d),b=Kp(i.clientWidth-(c+u)),y=Kp(i.clientHeight-(d+h)),m=Kp(c),g={rootMargin:-f+"px "+-b+"px "+-y+"px "+-m+"px",threshold:Cr(0,Bo(1,l))||1};let _=!0;function S(k){const C=k[0].intersectionRatio;if(C!==l){if(!_)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}_=!1}try{n=new IntersectionObserver(S,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,g)}n.observe(e)}return a(!0),s}function hte(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=aC(e),d=i||s?[...c?jh(c):[],...jh(t)]:[];d.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const u=c&&o?dte(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(p=>{let[g]=p;g&&g.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let b,y=l?Ka(e):null;l&&m();function m(){const p=Ka(e);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,b=requestAnimationFrame(m)}return n(),()=>{var p;d.forEach(g=>{i&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),u==null||u(),(p=f)==null||p.disconnect(),f=null,l&&cancelAnimationFrame(b)}}const fte=Vee,pte=zee,mte=Kee,gte=Hee,G4=Fee,vte=qee,yte=(e,t,n)=>{const r=new Map,i={platform:ute,...n},s={...i.platform,_c:r};return Bee(e,t,{...i,platform:s})},_te=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?G4({element:r.current,padding:i}).fn(n):{}:r?G4({element:r,padding:i}).fn(n):{}}}};var Wm=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Jg(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,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Jg(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function gD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Y4(e,t){const n=gD(e);return Math.round(t*n)/n}function X4(e){const t=x.useRef(e);return Wm(()=>{t.current=e}),t}function bte(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=e,[d,u]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=x.useState(r);Jg(h,r)||f(r);const[b,y]=x.useState(null),[m,p]=x.useState(null),g=x.useCallback(I=>{I!==C.current&&(C.current=I,y(I))},[]),_=x.useCallback(I=>{I!==T.current&&(T.current=I,p(I))},[]),S=s||b,k=a||m,C=x.useRef(null),T=x.useRef(null),w=x.useRef(d),E=l!=null,$=X4(l),M=X4(i),P=x.useCallback(()=>{if(!C.current||!T.current)return;const I={placement:t,strategy:n,middleware:h};M.current&&(I.platform=M.current),yte(C.current,T.current,I).then(j=>{const L={...j,isPositioned:!0};D.current&&!Jg(w.current,L)&&(w.current=L,Yn.flushSync(()=>{u(L)}))})},[h,t,n,M]);Wm(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(I=>({...I,isPositioned:!1})))},[c]);const D=x.useRef(!1);Wm(()=>(D.current=!0,()=>{D.current=!1}),[]),Wm(()=>{if(S&&(C.current=S),k&&(T.current=k),S&&k){if($.current)return $.current(S,k,P);P()}},[S,k,P,$,E]);const R=x.useMemo(()=>({reference:C,floating:T,setReference:g,setFloating:_}),[g,_]),O=x.useMemo(()=>({reference:S,floating:k}),[S,k]),N=x.useMemo(()=>{const I={position:n,left:0,top:0};if(!O.floating)return I;const j=Y4(O.floating,d.x),L=Y4(O.floating,d.y);return o?{...I,transform:"translate("+j+"px, "+L+"px)",...gD(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:L}},[n,o,O.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:P,refs:R,elements:O,floatingStyles:N}),[d,P,R,O,N])}function vD(e){const[t,n]=x.useState(void 0);return un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const yD="Popper",[_D,Du]=gr(yD),[xte,bD]=_D(yD),wte=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return x.createElement(xte,{scope:t,anchor:r,onAnchorChange:i},n)},Ste="PopperAnchor",Cte=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=bD(Ste,n),a=x.useRef(null),o=He(t,a);return x.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:x.createElement($e.div,te({},i,{ref:o}))}),xD="PopperContent",[kte,vPe]=_D(xD),Ete=x.forwardRef((e,t)=>{var n,r,i,s,a,o,l,c;const{__scopePopper:d,side:u="bottom",sideOffset:h=0,align:f="center",alignOffset:b=0,arrowPadding:y=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:g=0,sticky:_="partial",hideWhenDetached:S=!1,updatePositionStrategy:k="optimized",onPlaced:C,...T}=e,w=bD(xD,d),[E,$]=x.useState(null),M=He(t,ce=>$(ce)),[P,D]=x.useState(null),R=vD(P),O=(n=R==null?void 0:R.width)!==null&&n!==void 0?n:0,N=(r=R==null?void 0:R.height)!==null&&r!==void 0?r:0,I=u+(f!=="center"?"-"+f:""),j=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},L=Array.isArray(p)?p:[p],A=L.length>0,F={padding:j,boundary:L.filter(Tte),altBoundary:A},{refs:H,floatingStyles:B,placement:G,isPositioned:J,middlewareData:W}=bte({strategy:"fixed",placement:I,whileElementsMounted:(...ce)=>hte(...ce,{animationFrame:k==="always"}),elements:{reference:w.anchor},middleware:[Uee({mainAxis:h+N,alignmentAxis:b}),m&&fte({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?vte():void 0,...F}),m&&pte({...F}),mte({...F,apply:({elements:ce,rects:ye,availableWidth:ae,availableHeight:Me})=>{const{width:Pe,height:ge}=ye.reference,xe=ce.floating.style;xe.setProperty("--radix-popper-available-width",`${ae}px`),xe.setProperty("--radix-popper-available-height",`${Me}px`),xe.setProperty("--radix-popper-anchor-width",`${Pe}px`),xe.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),P&&_te({element:P,padding:y}),$te({arrowWidth:O,arrowHeight:N}),S&&gte({strategy:"referenceHidden",...F})]}),[U,z]=wD(G),V=Ct(C);un(()=>{J&&(V==null||V())},[J,V]);const K=(i=W.arrow)===null||i===void 0?void 0:i.x,q=(s=W.arrow)===null||s===void 0?void 0:s.y,X=((a=W.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[ie,re]=x.useState();return un(()=>{E&&re(window.getComputedStyle(E).zIndex)},[E]),x.createElement("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:J?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(o=W.transformOrigin)===null||o===void 0?void 0:o.x,(l=W.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(kte,{scope:d,placedSide:U,onArrowChange:D,arrowX:K,arrowY:q,shouldHideArrow:X},x.createElement($e.div,te({"data-side":U,"data-align":z},T,{ref:M,style:{...T.style,animation:J?void 0:"none",opacity:(c=W.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function Tte(e){return e!==null}const $te=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,s,a;const{placement:o,rects:l,middlewareData:c}=t,u=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[b,y]=wD(o),m={start:"0%",center:"50%",end:"100%"}[y],p=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+h/2,g=((s=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&s!==void 0?s:0)+f/2;let _="",S="";return b==="bottom"?(_=u?m:`${p}px`,S=`${-f}px`):b==="top"?(_=u?m:`${p}px`,S=`${l.floating.height+f}px`):b==="right"?(_=`${-f}px`,S=u?m:`${g}px`):b==="left"&&(_=`${l.floating.width+f}px`,S=u?m:`${g}px`),{data:{x:_,y:S}}}});function wD(e){const[t,n="center"]=e.split("-");return[t,n]}const lC=wte,cC=Cte,uC=Ete,dC=x.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?vR.createPortal(x.createElement($e.div,te({},i,{ref:t})),r):null}),h_="rovingFocusGroup.onEntryFocus",Mte={bubbles:!1,cancelable:!0},hC="RovingFocusGroup",[Fx,SD,Rte]=zf(hC),[Ate,kv]=gr(hC,[Rte]),[Lte,Dte]=Ate(hC),Pte=x.forwardRef((e,t)=>x.createElement(Fx.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(Fx.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(Ote,te({},e,{ref:t}))))),Ote=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,u=x.useRef(null),h=He(t,u),f=Cu(s),[b=null,y]=Ls({prop:a,defaultProp:o,onChange:l}),[m,p]=x.useState(!1),g=Ct(c),_=SD(n),S=x.useRef(!1),[k,C]=x.useState(0);return x.useEffect(()=>{const T=u.current;if(T)return T.addEventListener(h_,g),()=>T.removeEventListener(h_,g)},[g]),x.createElement(Lte,{scope:n,orientation:r,dir:f,loop:i,currentTabStopId:b,onItemFocus:x.useCallback(T=>y(T),[y]),onItemShiftTab:x.useCallback(()=>p(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(T=>T+1),[]),onFocusableItemRemove:x.useCallback(()=>C(T=>T-1),[])},x.createElement($e.div,te({tabIndex:m||k===0?-1:0,"data-orientation":r},d,{ref:h,style:{outline:"none",...e.style},onMouseDown:pe(e.onMouseDown,()=>{S.current=!0}),onFocus:pe(e.onFocus,T=>{const w=!S.current;if(T.target===T.currentTarget&&w&&!m){const E=new CustomEvent(h_,Mte);if(T.currentTarget.dispatchEvent(E),!E.defaultPrevented){const $=_().filter(O=>O.focusable),M=$.find(O=>O.active),P=$.find(O=>O.id===b),R=[M,P,...$].filter(Boolean).map(O=>O.ref.current);CD(R)}}S.current=!1}),onBlur:pe(e.onBlur,()=>p(!1))})))}),Nte="RovingFocusGroupItem",Ite=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=e,o=Xr(),l=s||o,c=Dte(Nte,n),d=c.currentTabStopId===l,u=SD(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=c;return x.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),x.createElement(Fx.ItemSlot,{scope:n,id:l,focusable:r,active:i},x.createElement($e.span,te({tabIndex:d?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:pe(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:pe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:pe(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=Fte(b,c.orientation,c.dir);if(y!==void 0){b.preventDefault();let p=u().filter(g=>g.focusable).map(g=>g.ref.current);if(y==="last")p.reverse();else if(y==="prev"||y==="next"){y==="prev"&&p.reverse();const g=p.indexOf(b.currentTarget);p=c.loop?zte(p,g+1):p.slice(g+1)}setTimeout(()=>CD(p))}})})))}),jte={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bte(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fte(e,t,n){const r=Bte(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jte[r]}function CD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const kD=Pte,ED=Ite;var Hte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dl=new WeakMap,Gp=new WeakMap,Yp={},f_=0,TD=function(e){return e&&(e.host||TD(e.parentNode))},Wte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=TD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ute=function(e,t,n,r){var i=Wte(t,Array.isArray(e)?e:[e]);Yp[n]||(Yp[n]=new WeakMap);var s=Yp[n],a=[],o=new Set,l=new Set(i),c=function(u){!u||o.has(u)||(o.add(u),c(u.parentNode))};i.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(h){if(o.has(h))d(h);else{var f=h.getAttribute(r),b=f!==null&&f!=="false",y=(Dl.get(h)||0)+1,m=(s.get(h)||0)+1;Dl.set(h,y),s.set(h,m),a.push(h),y===1&&b&&Gp.set(h,!0),m===1&&h.setAttribute(n,"true"),b||h.setAttribute(r,"true")}})};return d(t),o.clear(),f_++,function(){a.forEach(function(u){var h=Dl.get(u)-1,f=s.get(u)-1;Dl.set(u,h),s.set(u,f),h||(Gp.has(u)||u.removeAttribute(r),Gp.delete(u)),f||u.removeAttribute(n)}),f_--,f_||(Dl=new WeakMap,Dl=new WeakMap,Gp=new WeakMap,Yp={})}},fC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Hte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Ute(r,i,n,"aria-hidden")):function(){return null}},Hi=function(){return Hi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Hi.apply(this,arguments)};function $D(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Vte(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Um="right-scroll-bar-position",Vm="width-before-scroll-bar",qte="with-scroll-bars-hidden",Kte="--removed-body-scroll-bar-size";function Gte(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yte(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function Xte(e,t){return Yte(t||null,function(n){return e.forEach(function(r){return Gte(r,n)})})}function Qte(e){return e}function Jte(e,t){t===void 0&&(t=Qte);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){a.push(d),c()},filter:function(d){return a=a.filter(d),n}}}};return i}function Zte(e){e===void 0&&(e={});var t=Jte(null);return t.options=Hi({async:!0,ssr:!1},e),t}var MD=function(e){var t=e.sideCar,n=$D(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Hi({},n))};MD.isSideCarExport=!0;function ene(e,t){return e.useMedium(t),MD}var RD=Zte(),p_=function(){},Ev=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:p_,onWheelCapture:p_,onTouchMoveCapture:p_}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,h=e.sideCar,f=e.noIsolation,b=e.inert,y=e.allowPinchZoom,m=e.as,p=m===void 0?"div":m,g=$D(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=h,S=Xte([n,t]),k=Hi(Hi({},g),i);return x.createElement(x.Fragment,null,d&&x.createElement(_,{sideCar:RD,removeScrollBar:c,shards:u,noIsolation:f,inert:b,setCallbacks:s,allowPinchZoom:!!y,lockRef:n}),a?x.cloneElement(x.Children.only(o),Hi(Hi({},k),{ref:S})):x.createElement(p,Hi({},k,{className:l,ref:S}),o))});Ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ev.classNames={fullWidth:Vm,zeroRight:Um};var tne=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nne(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tne();return t&&e.setAttribute("nonce",t),e}function rne(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ine(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sne=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nne())&&(rne(t,n),ine(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},one=function(){var e=sne();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},AD=function(){var e=one(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ane={left:0,top:0,right:0,gap:0},m_=function(e){return parseInt(e||"",10)||0},lne=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[m_(n),m_(r),m_(i)]},cne=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ane;var t=lne(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},une=AD(),dne=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(qte,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(Um,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Vm,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(Um," .").concat(Um,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(Vm," .").concat(Vm,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body {
    `).concat(Kte,": ").concat(o,`px;
  }
`)},hne=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=x.useMemo(function(){return cne(i)},[i]);return x.createElement(une,{styles:dne(s,!t,i,n?"":"!important")})},zx=!1;if(typeof window<"u")try{var Xp=Object.defineProperty({},"passive",{get:function(){return zx=!0,!0}});window.addEventListener("test",Xp,Xp),window.removeEventListener("test",Xp,Xp)}catch{zx=!1}var Pl=zx?{passive:!1}:!1,fne=function(e){return e.tagName==="TEXTAREA"},LD=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fne(e)&&n[t]==="visible")},pne=function(e){return LD(e,"overflowY")},mne=function(e){return LD(e,"overflowX")},Q4=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=DD(e,n);if(r){var i=PD(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},gne=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DD=function(e,t){return e==="v"?pne(t):mne(t)},PD=function(e,t){return e==="v"?gne(t):vne(t)},yne=function(e,t){return e==="h"&&t==="rtl"?-1:1},_ne=function(e,t,n,r,i){var s=yne(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),c=!1,d=a>0,u=0,h=0;do{var f=PD(e,o),b=f[0],y=f[1],m=f[2],p=y-m-s*b;(b||p)&&DD(e,o)&&(u+=p,h+=b),o=o.parentNode}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(d&&(i&&u===0||!i&&a>u)||!d&&(i&&h===0||!i&&-a>h))&&(c=!0),c},Qp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J4=function(e){return[e.deltaX,e.deltaY]},Z4=function(e){return e&&"current"in e?e.current:e},bne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xne=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},wne=0,Ol=[];function Sne(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(wne++)[0],s=x.useState(function(){return AD()})[0],a=x.useRef(e);x.useEffect(function(){a.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=Vte([e.lockRef.current],(e.shards||[]).map(Z4),!0).filter(Boolean);return y.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=x.useCallback(function(y,m){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var p=Qp(y),g=n.current,_="deltaX"in y?y.deltaX:g[0]-p[0],S="deltaY"in y?y.deltaY:g[1]-p[1],k,C=y.target,T=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in y&&T==="h"&&C.type==="range")return!1;var w=Q4(T,C);if(!w)return!0;if(w?k=T:(k=T==="v"?"h":"v",w=Q4(T,C)),!w)return!1;if(!r.current&&"changedTouches"in y&&(_||S)&&(r.current=k),!k)return!0;var E=r.current||k;return _ne(E,m,y,E==="h"?_:S,!0)},[]),l=x.useCallback(function(y){var m=y;if(!(!Ol.length||Ol[Ol.length-1]!==s)){var p="deltaY"in m?J4(m):Qp(m),g=t.current.filter(function(k){return k.name===m.type&&k.target===m.target&&bne(k.delta,p)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var _=(a.current.shards||[]).map(Z4).filter(Boolean).filter(function(k){return k.contains(m.target)}),S=_.length>0?o(m,_[0]):!a.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),c=x.useCallback(function(y,m,p,g){var _={name:y,delta:m,target:p,should:g};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(S){return S!==_})},1)},[]),d=x.useCallback(function(y){n.current=Qp(y),r.current=void 0},[]),u=x.useCallback(function(y){c(y.type,J4(y),y.target,o(y,e.lockRef.current))},[]),h=x.useCallback(function(y){c(y.type,Qp(y),y.target,o(y,e.lockRef.current))},[]);x.useEffect(function(){return Ol.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Pl),document.addEventListener("touchmove",l,Pl),document.addEventListener("touchstart",d,Pl),function(){Ol=Ol.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,Pl),document.removeEventListener("touchmove",l,Pl),document.removeEventListener("touchstart",d,Pl)}},[]);var f=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(s,{styles:xne(i)}):null,f?x.createElement(hne,{gapMode:"margin"}):null)}const Cne=ene(RD,Sne);var OD=x.forwardRef(function(e,t){return x.createElement(Ev,Hi({},e,{ref:t,sideCar:Cne}))});OD.classNames=Ev.classNames;const pC=OD,Hx=["Enter"," "],kne=["ArrowDown","PageUp","Home"],ND=["ArrowUp","PageDown","End"],Ene=[...kne,...ND],Tne={ltr:[...Hx,"ArrowRight"],rtl:[...Hx,"ArrowLeft"]},$ne={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tv="Menu",[Bh,Mne,Rne]=zf(Tv),[ul,ID]=gr(Tv,[Rne,Du,kv]),mC=Du(),jD=kv(),[Ane,dl]=ul(Tv),[Lne,Uf]=ul(Tv),Dne=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=e,o=mC(t),[l,c]=x.useState(null),d=x.useRef(!1),u=Ct(s),h=Cu(i);return x.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),x.createElement(lC,o,x.createElement(Ane,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c},x.createElement(Lne,{scope:t,onClose:x.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:h,modal:a},r)))},BD=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=mC(n);return x.createElement(cC,te({},i,r,{ref:t}))}),FD="MenuPortal",[Pne,zD]=ul(FD,{forceMount:void 0}),One=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=dl(FD,t);return x.createElement(Pne,{scope:t,forceMount:n},x.createElement(yn,{present:n||s.open},x.createElement(dC,{asChild:!0,container:i},r)))},_i="MenuContent",[Nne,gC]=ul(_i),Ine=x.forwardRef((e,t)=>{const n=zD(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=dl(_i,e.__scopeMenu),a=Uf(_i,e.__scopeMenu);return x.createElement(Bh.Provider,{scope:e.__scopeMenu},x.createElement(yn,{present:r||s.open},x.createElement(Bh.Slot,{scope:e.__scopeMenu},a.modal?x.createElement(jne,te({},i,{ref:t})):x.createElement(Bne,te({},i,{ref:t})))))}),jne=x.forwardRef((e,t)=>{const n=dl(_i,e.__scopeMenu),r=x.useRef(null),i=He(t,r);return x.useEffect(()=>{const s=r.current;if(s)return fC(s)},[]),x.createElement(vC,te({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Bne=x.forwardRef((e,t)=>{const n=dl(_i,e.__scopeMenu);return x.createElement(vC,te({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),vC=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:f,disableOutsideScroll:b,...y}=e,m=dl(_i,n),p=Uf(_i,n),g=mC(n),_=jD(n),S=Mne(n),[k,C]=x.useState(null),T=x.useRef(null),w=He(t,T,m.onContentChange),E=x.useRef(0),$=x.useRef(""),M=x.useRef(0),P=x.useRef(null),D=x.useRef("right"),R=x.useRef(0),O=b?pC:x.Fragment,N=b?{as:Io,allowPinchZoom:!0}:void 0,I=L=>{var A,F;const H=$.current+L,B=S().filter(V=>!V.disabled),G=document.activeElement,J=(A=B.find(V=>V.ref.current===G))===null||A===void 0?void 0:A.textValue,W=B.map(V=>V.textValue),U=ire(W,H,J),z=(F=B.find(V=>V.textValue===U))===null||F===void 0?void 0:F.ref.current;(function V(K){$.current=K,window.clearTimeout(E.current),K!==""&&(E.current=window.setTimeout(()=>V(""),1e3))})(H),z&&setTimeout(()=>z.focus())};x.useEffect(()=>()=>window.clearTimeout(E.current),[]),eC();const j=x.useCallback(L=>{var A,F;return D.current===((A=P.current)===null||A===void 0?void 0:A.side)&&ore(L,(F=P.current)===null||F===void 0?void 0:F.area)},[]);return x.createElement(Nne,{scope:n,searchRef:$,onItemEnter:x.useCallback(L=>{j(L)&&L.preventDefault()},[j]),onItemLeave:x.useCallback(L=>{var A;j(L)||((A=T.current)===null||A===void 0||A.focus(),C(null))},[j]),onTriggerLeave:x.useCallback(L=>{j(L)&&L.preventDefault()},[j]),pointerGraceTimerRef:M,onPointerGraceIntentChange:x.useCallback(L=>{P.current=L},[])},x.createElement(O,N,x.createElement(tC,{asChild:!0,trapped:i,onMountAutoFocus:pe(s,L=>{var A;L.preventDefault(),(A=T.current)===null||A===void 0||A.focus()}),onUnmountAutoFocus:a},x.createElement(Hf,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:h,onDismiss:f},x.createElement(kD,te({asChild:!0},_,{dir:p.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:pe(l,L=>{p.isUsingKeyboardRef.current||L.preventDefault()})}),x.createElement(uC,te({role:"menu","aria-orientation":"vertical","data-state":qD(m.open),"data-radix-menu-content":"",dir:p.dir},g,y,{ref:w,style:{outline:"none",...y.style},onKeyDown:pe(y.onKeyDown,L=>{const F=L.target.closest("[data-radix-menu-content]")===L.currentTarget,H=L.ctrlKey||L.altKey||L.metaKey,B=L.key.length===1;F&&(L.key==="Tab"&&L.preventDefault(),!H&&B&&I(L.key));const G=T.current;if(L.target!==G||!Ene.includes(L.key))return;L.preventDefault();const W=S().filter(U=>!U.disabled).map(U=>U.ref.current);ND.includes(L.key)&&W.reverse(),nre(W)}),onBlur:pe(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(E.current),$.current="")}),onPointerMove:pe(e.onPointerMove,Fh(L=>{const A=L.target,F=R.current!==L.clientX;if(L.currentTarget.contains(A)&&F){const H=L.clientX>R.current?"right":"left";D.current=H,R.current=L.clientX}}))})))))))}),Fne=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement($e.div,te({role:"group"},r,{ref:t}))}),zne=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement($e.div,te({},r,{ref:t}))}),Wx="MenuItem",e6="menu.itemSelect",yC=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=x.useRef(null),a=Uf(Wx,e.__scopeMenu),o=gC(Wx,e.__scopeMenu),l=He(t,s),c=x.useRef(!1),d=()=>{const u=s.current;if(!n&&u){const h=new CustomEvent(e6,{bubbles:!0,cancelable:!0});u.addEventListener(e6,f=>r==null?void 0:r(f),{once:!0}),Og(u,h),h.defaultPrevented?c.current=!1:a.onClose()}};return x.createElement(HD,te({},i,{ref:l,disabled:n,onClick:pe(e.onClick,d),onPointerDown:u=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,u),c.current=!0},onPointerUp:pe(e.onPointerUp,u=>{var h;c.current||(h=u.currentTarget)===null||h===void 0||h.click()}),onKeyDown:pe(e.onKeyDown,u=>{const h=o.searchRef.current!=="";n||h&&u.key===" "||Hx.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})}))}),HD=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,a=gC(Wx,n),o=jD(n),l=x.useRef(null),c=He(t,l),[d,u]=x.useState(!1),[h,f]=x.useState("");return x.useEffect(()=>{const b=l.current;if(b){var y;f(((y=b.textContent)!==null&&y!==void 0?y:"").trim())}},[s.children]),x.createElement(Bh.ItemSlot,{scope:n,disabled:r,textValue:i??h},x.createElement(ED,te({asChild:!0},o,{focusable:!r}),x.createElement($e.div,te({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},s,{ref:c,onPointerMove:pe(e.onPointerMove,Fh(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:pe(e.onPointerLeave,Fh(b=>a.onItemLeave(b))),onFocus:pe(e.onFocus,()=>u(!0)),onBlur:pe(e.onBlur,()=>u(!1))}))))}),Hne=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return x.createElement(UD,{scope:e.__scopeMenu,checked:n},x.createElement(yC,te({role:"menuitemcheckbox","aria-checked":Zg(n)?"mixed":n},i,{ref:t,"data-state":_C(n),onSelect:pe(i.onSelect,()=>r==null?void 0:r(Zg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Wne="MenuRadioGroup",[Une,Vne]=ul(Wne,{value:void 0,onValueChange:()=>{}}),qne=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=Ct(r);return x.createElement(Une,{scope:e.__scopeMenu,value:n,onValueChange:s},x.createElement(Fne,te({},i,{ref:t})))}),Kne="MenuRadioItem",Gne=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=Vne(Kne,e.__scopeMenu),s=n===i.value;return x.createElement(UD,{scope:e.__scopeMenu,checked:s},x.createElement(yC,te({role:"menuitemradio","aria-checked":s},r,{ref:t,"data-state":_C(s),onSelect:pe(r.onSelect,()=>{var a;return(a=i.onValueChange)===null||a===void 0?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})))}),WD="MenuItemIndicator",[UD,Yne]=ul(WD,{checked:!1}),Xne=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=Yne(WD,n);return x.createElement(yn,{present:r||Zg(s.checked)||s.checked===!0},x.createElement($e.span,te({},i,{ref:t,"data-state":_C(s.checked)})))}),Qne=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement($e.div,te({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Jne="MenuSub",[yPe,VD]=ul(Jne),Jp="MenuSubTrigger",Zne=x.forwardRef((e,t)=>{const n=dl(Jp,e.__scopeMenu),r=Uf(Jp,e.__scopeMenu),i=VD(Jp,e.__scopeMenu),s=gC(Jp,e.__scopeMenu),a=x.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=x.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const u=o.current;return()=>{window.clearTimeout(u),l(null)}},[o,l]),x.createElement(BD,te({asChild:!0},c),x.createElement(HD,te({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":qD(n.open)},e,{ref:Nf(t,i.onTriggerChange),onClick:u=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:pe(e.onPointerMove,Fh(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:pe(e.onPointerLeave,Fh(u=>{var h;d();const f=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(f){var b;const y=(b=n.content)===null||b===void 0?void 0:b.dataset.side,m=y==="right",p=m?-5:5,g=f[m?"left":"right"],_=f[m?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+p,y:u.clientY},{x:g,y:f.top},{x:_,y:f.top},{x:_,y:f.bottom},{x:g,y:f.bottom}],side:y}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:pe(e.onKeyDown,u=>{const h=s.searchRef.current!=="";if(!(e.disabled||h&&u.key===" ")&&Tne[r.dir].includes(u.key)){var f;n.onOpenChange(!0),(f=n.content)===null||f===void 0||f.focus(),u.preventDefault()}})})))}),ere="MenuSubContent",tre=x.forwardRef((e,t)=>{const n=zD(_i,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=dl(_i,e.__scopeMenu),a=Uf(_i,e.__scopeMenu),o=VD(ere,e.__scopeMenu),l=x.useRef(null),c=He(t,l);return x.createElement(Bh.Provider,{scope:e.__scopeMenu},x.createElement(yn,{present:r||s.open},x.createElement(Bh.Slot,{scope:e.__scopeMenu},x.createElement(vC,te({id:o.contentId,"aria-labelledby":o.triggerId},i,{ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)===null||u===void 0||u.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:pe(e.onFocusOutside,d=>{d.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:pe(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:pe(e.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),h=$ne[a.dir].includes(d.key);if(u&&h){var f;s.onOpenChange(!1),(f=o.trigger)===null||f===void 0||f.focus(),d.preventDefault()}})})))))});function qD(e){return e?"open":"closed"}function Zg(e){return e==="indeterminate"}function _C(e){return Zg(e)?"indeterminate":e?"checked":"unchecked"}function nre(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function rre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ire(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=rre(e,Math.max(s,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function sre(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,c=t[a].x,d=t[a].y;l>r!=d>r&&n<(c-o)*(r-l)/(d-l)+o&&(i=!i)}return i}function ore(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return sre(n,t)}function Fh(e){return t=>t.pointerType==="mouse"?e(t):void 0}const are=Dne,lre=BD,cre=One,ure=Ine,dre=zne,hre=yC,fre=Hne,pre=qne,mre=Gne,gre=Xne,vre=Qne,yre=Zne,_re=tre,KD="DropdownMenu",[bre,_Pe]=gr(KD,[ID]),Pr=ID(),[xre,GD]=bre(KD),wre=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=Pr(t),c=x.useRef(null),[d=!1,u]=Ls({prop:i,defaultProp:s,onChange:a});return x.createElement(xre,{scope:t,triggerId:Xr(),triggerRef:c,contentId:Xr(),open:d,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(h=>!h),[u]),modal:o},x.createElement(are,te({},l,{open:d,onOpenChange:u,dir:r,modal:o}),n))},Sre="DropdownMenuTrigger",Cre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=GD(Sre,n),a=Pr(n);return x.createElement(lre,te({asChild:!0},a),x.createElement($e.button,te({type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:Nf(t,s.triggerRef),onPointerDown:pe(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:pe(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})))}),kre=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Pr(t);return x.createElement(cre,te({},r,n))},Ere="DropdownMenuContent",Tre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=GD(Ere,n),s=Pr(n),a=x.useRef(!1);return x.createElement(ure,te({id:i.contentId,"aria-labelledby":i.triggerId},s,r,{ref:t,onCloseAutoFocus:pe(e.onCloseAutoFocus,o=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:pe(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),$re=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(dre,te({},i,r,{ref:t}))}),Mre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(hre,te({},i,r,{ref:t}))}),Rre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(fre,te({},i,r,{ref:t}))}),Are=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(pre,te({},i,r,{ref:t}))}),Lre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(mre,te({},i,r,{ref:t}))}),Dre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(gre,te({},i,r,{ref:t}))}),Pre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(vre,te({},i,r,{ref:t}))}),Ore=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(yre,te({},i,r,{ref:t}))}),Nre=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return x.createElement(_re,te({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ire=wre,jre=Cre,Bre=kre,YD=Tre,XD=$re,QD=Mre,JD=Rre,Fre=Are,ZD=Lre,eP=Dre,tP=Pre,nP=Ore,rP=Nre,vc=Ire,yc=jre,iP=Fre,zre=x.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsxs(nP,{ref:i,className:ee("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,v.jsx(Hq,{className:"ml-auto h-4 w-4"})]}));zre.displayName=nP.displayName;const Hre=x.forwardRef(({className:e,...t},n)=>v.jsx(rP,{ref:n,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",e),...t}));Hre.displayName=rP.displayName;const Pa=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(Bre,{children:v.jsx(YD,{ref:r,sideOffset:t,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",e),...n})}));Pa.displayName=YD.displayName;const Ui=x.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(QD,{ref:r,className:ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Ui.displayName=QD.displayName;const sP=x.forwardRef(({className:e,children:t,checked:n,...r},i)=>v.jsxs(JD,{ref:i,className:ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(eP,{children:v.jsx(ES,{className:"h-4 w-4"})})}),t]}));sP.displayName=JD.displayName;const bC=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(ZD,{ref:r,className:ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(eP,{children:v.jsx(Yq,{className:"h-2 w-2 fill-current"})})}),t]}));bC.displayName=ZD.displayName;const e0=x.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(XD,{ref:r,className:ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));e0.displayName=XD.displayName;const _c=x.forwardRef(({className:e,...t},n)=>v.jsx(tP,{ref:n,className:ee("-mx-1 my-1 h-px bg-muted",e),...t}));_c.displayName=tP.displayName;function oP({featName:e,durationDays:t,children:n}){const r=`dynamicNewFeatTs-${e}`,i=parseInt(localStorage.getItem(r)??"");if(isNaN(i)||window.txConsts.showAdvanced)localStorage.setItem(r,Date.now().toString());else{const s=(t??3)*24*60*60*1e3;if(i+s<Date.now())return null}return n}const aP=Ye.memo(oP);function Wre({badgeText:e,featName:t,durationDays:n}){return v.jsx(oP,{featName:t,durationDays:n,children:v.jsx("span",{className:"rounded bg-accent text-accent-foreground text-2xs tracking-wider font-semibold px-1 ml-1.5",children:e??"NEW"})})}const t0=Ye.memo(Wre),t6=[{value:"playerName",label:"Name",placeholder:"Enter a player name",description:"Search players by their last display name."},{value:"playerNotes",label:"Notes",placeholder:"Enter part of the note to search for",description:"Search players by their profile notes contents."},{value:"playerIds",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search players by their IDs separated by a comma."}],Ure=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],Zp=Fn(1250,e=>{e()},{noLeading:!0});function Vre({doSearch:e,initialState:t}){var _,S;const n=x.useRef(null),[r,i]=x.useState(!1),[s,a]=x.useState(!1),[o,l]=x.useState(((_=t.search)==null?void 0:_.type)||"playerName"),[c,d]=x.useState(t.filters),[u,h]=x.useState(!!((S=t.search)!=null&&S.value)),f=()=>{if(!n.current)return;const k=n.current.value.trim();k.length?e({value:k,type:o},c):e(null,c)};x.useEffect(()=>{f()},[o,c]);const b=k=>{k.key==="Enter"?(Zp.cancel({upcomingOnly:!0}),f()):k.key==="Escape"?(n.current.value="",Zp(f),h(!1)):(Zp(f),h(!0))},y=()=>{n.current.value="",Zp.cancel({upcomingOnly:!0}),f(),h(!1)},m=(k,C)=>{d(C?T=>[...T,k]:T=>T.filter(w=>w!==k))};wi("keydown",k=>{var C;k.code==="KeyF"&&(k.ctrlKey||k.metaKey)&&((C=n.current)==null||C.focus(),k.preventDefault())});const p=t6.find(k=>k.value===o);if(!p)throw new Error(`Invalid search type: ${o}`);const g=c.length?`${c.length} Filter${c.length>1?"s":""}`:"No filters";return v.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[v.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[v.jsxs("div",{className:"relative min-w-44 grow",children:[v.jsx(sn,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:p.placeholder,onKeyDown:b}),u?v.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:y,children:v.jsx(ns,{})}):v.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:v.jsx(zn,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),v.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[v.jsxs(vc,{children:[v.jsx(yc,{asChild:!0,children:v.jsxs(Ve,{variant:"outline",role:"combobox","aria-expanded":r,onClick:()=>i(!r),className:"xs:w-48 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",p.label,v.jsx(hx,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),v.jsxs(Pa,{className:"w-48",children:[v.jsx(e0,{children:"Search Type"}),v.jsx(_c,{}),v.jsx(iP,{value:o,onValueChange:l,children:t6.map(k=>v.jsx(bC,{value:k.value,className:"cursor-pointer",children:k.label},k.value))})]})]}),v.jsxs(vc,{children:[v.jsx(yc,{asChild:!0,children:v.jsxs(Ve,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),className:"xs:w-44 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:[g,v.jsx(hx,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),v.jsxs(Pa,{className:"w-44",children:[v.jsx(e0,{children:"Search Filters"}),v.jsx(_c,{}),Ure.map(k=>v.jsx(sP,{checked:c.includes(k.value),className:"cursor-pointer",onCheckedChange:C=>{m(k.value,C)},children:k.label},k.value)),v.jsx(_c,{}),v.jsxs(Ui,{className:"cursor-pointer",onClick:()=>d([]),children:[v.jsx(iK,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),v.jsx("div",{className:"flex justify-end flex-grow",children:v.jsxs(vc,{children:[v.jsx(yc,{className:"",children:v.jsxs(Ve,{variant:"outline",className:"grow md:grow-0",children:["More",v.jsx(t0,{featName:"banIdentifiersPage",durationDays:3}),v.jsx(ku,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),v.jsxs(Pa,{children:[v.jsx(Ui,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:v.jsxs(No,{href:"/ban-identifiers",className:"cursor-pointer",children:[v.jsx(jo,{className:"inline mr-1 h-4"}),"Ban Identifiers",v.jsx(t0,{featName:"banIdentifiersPage",durationDays:3})]})}),v.jsx(Ui,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:v.jsxs(No,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[v.jsx(jo,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),v.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:p.description})]})}function Nl(e,t,n){let r=n.initialDeps??[],i;return()=>{var s,a,o,l;let c;n.key&&((s=n.debug)!=null&&s.call(n))&&(c=Date.now());const d=e();if(!(d.length!==r.length||d.some((f,b)=>r[b]!==f)))return i;r=d;let h;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(h=Date.now()),i=t(...d),n.key&&((o=n.debug)!=null&&o.call(n))){const f=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-h)*100)/100,y=b/16,m=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${m(b,5)} /${m(f,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,i),i}}function g_(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}const qre=(e,t)=>Math.abs(e-t)<1,Kre=e=>e,Gre=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},Yre=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=s=>{const{width:a,height:o}=s;t({width:Math.round(a),height:Math.round(o)})};if(r(n.getBoundingClientRect()),typeof ResizeObserver>"u")return()=>{};const i=new ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const o=a.borderBoxSize[0];if(o){r({width:o.inlineSize,height:o.blockSize});return}}r(n.getBoundingClientRect())});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Xre=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=()=>{t(n[e.options.horizontal?"scrollLeft":"scrollTop"])};return r(),n.addEventListener("scroll",r,{passive:!0}),()=>{n.removeEventListener("scroll",r)}},Qre=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Jre=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const a=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class Zre{constructor(t){this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(typeof ResizeObserver<"u"?n=new ResizeObserver(i=>{i.forEach(s=>{this._measureElement(s.target,s)})}):null);return{disconnect:()=>{var i;return(i=r())==null?void 0:i.disconnect()},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Kre,rangeExtractor:Gre,onChange:()=>{},measureElement:Qre,initialRect:{width:0,height:0},scrollMargin:0,gap:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Nl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{const n=this.options.getScrollElement();this.scrollElement!==n&&(this.cleanup(),this.scrollElement=n,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,r=>{this.scrollAdjustments=0,this.scrollOffset!==r&&(this.isScrollingTimeoutId!==null&&(clearTimeout(this.isScrollingTimeoutId),this.isScrollingTimeoutId=null),this.isScrolling=!0,this.scrollDirection=this.scrollOffset<r?"forward":"backward",this.scrollOffset=r,this.maybeNotify(),this.isScrollingTimeoutId=setTimeout(()=>{this.isScrollingTimeoutId=null,this.isScrolling=!1,this.scrollDirection=null,this.maybeNotify()},this.options.scrollingDelay))})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.memoOptions=Nl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(n,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s}),{key:!1}),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const o=n[a];if(i.has(o.lane))continue;const l=s.get(o.lane);if(l==null||o.end>l.end?s.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurements=Nl(()=>[this.memoOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s},a)=>{const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,o);for(let c=o;c<n;c++){const d=s(c),u=this.options.lanes===1?l[c-1]:this.getFurthestMeasurement(l,c),h=u?u.end+this.options.gap:r+i,f=a.get(d),b=typeof f=="number"?f:this.options.estimateSize(c),y=h+b,m=u?u.lane:c%this.options.lanes;l[c]={index:c,start:h,size:b,end:y,key:d,lane:m}}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Nl(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(n,r,i)=>this.range=n.length>0&&r>0?eie({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=Nl(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,s)=>r===null?[]:n({...r,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.measurementsCache[this.indexFromElement(n)];if(!i||!n.isConnected){this.measureElementCache.forEach((o,l)=>{o===n&&(this.observer.unobserve(n),this.measureElementCache.delete(l))});return}const s=this.measureElementCache.get(i.key);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.measureElementCache.set(i.key,n));const a=this.options.measureElement(n,r,this);this.resizeItem(i,a)},this.resizeItem=(n,r)=>{const i=this.itemSizeCache.get(n.key)??n.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,s,this):n.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,r)),this.notify(!1))},this.measureElement=n=>{n&&this._measureElement(n,void 0)},this.getVirtualItems=Nl(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();return g_(r[lP(0,r.length-1,i=>g_(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize();r==="auto"&&(n<=this.scrollOffset?r="start":n>=this.scrollOffset+i?r="end":r="start"),r==="start"?n=n:r==="end"?n=n-i:r==="center"&&(n=n-i/2);const s=this.options.horizontal?"scrollWidth":"scrollHeight",o=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-this.getSize();return Math.max(Math.min(o,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=g_(this.getMeasurements()[n]);if(r==="auto")if(i.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)r="end";else if(i.start<=this.scrollOffset+this.options.scrollPaddingStart)r="start";else return[this.scrollOffset,r];const s=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r),r]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&(clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const[s,a]=this.getOffsetForIndex(n,r);this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&(this.scrollToIndexTimeoutId=setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(n))){const[l]=this.getOffsetForIndex(n,a);qre(l,this.scrollOffset)||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.scrollOffset+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(s=>s.end)),i-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(n=>{this.itemSizeCache.set(n.key,n.size)}),this.maybeNotify()}}const lP=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function eie({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=lP(0,r,o=>e[o].start,n);let a=s;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:s,endIndex:a}}const tie=typeof document<"u"?x.useLayoutEffect:x.useEffect;function nie(e){const t=x.useReducer(()=>({}),{})[1],n={...e,onChange:(i,s)=>{var a;s?Yn.flushSync(t):t(),(a=e.onChange)==null||a.call(e,i,s)}},[r]=x.useState(()=>new Zre(n));return r.setOptions(n),x.useEffect(()=>r._didMount(),[]),tie(()=>r._willUpdate()),r}function xC(e){return nie({observeElementRect:Yre,observeElementOffset:Xre,scrollToFn:Jre,...e})}function Zc({children:e,href:t,className:n,rel:r,...i}){const s=bu()[1],a=t==null?void 0:t.startsWith("http"),o=l=>{t&&(l.preventDefault(),a?sl(t):s(t??"/"))};return v.jsxs("a",{...i,rel:r??"noopener noreferrer",href:t,className:ee("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:o,children:[e,a&&v.jsx(jo,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0"})]})}const rie=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{className:"relative w-full overflow-auto",children:v.jsx("table",{ref:n,className:ee("w-full caption-bottom text-sm",e),...t})}));rie.displayName="Table";const wC=x.forwardRef(({className:e,...t},n)=>v.jsx("thead",{ref:n,className:ee("[&_tr]:border-b",e),...t}));wC.displayName="TableHeader";const SC=x.forwardRef(({className:e,...t},n)=>v.jsx("tbody",{ref:n,className:ee("[&_tr:last-child]:border-0",e),...t}));SC.displayName="TableBody";const iie=x.forwardRef(({className:e,...t},n)=>v.jsx("tfoot",{ref:n,className:ee("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));iie.displayName="TableFooter";const Vf=x.forwardRef(({className:e,...t},n)=>v.jsx("tr",{ref:n,className:ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Vf.displayName="TableRow";const sie=x.forwardRef(({className:e,...t},n)=>v.jsx("th",{ref:n,className:ee("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sie.displayName="TableHead";const Ur=x.forwardRef(({className:e,...t},n)=>v.jsx("td",{ref:n,className:ee("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ur.displayName="TableCell";const oie=x.forwardRef(({className:e,...t},n)=>v.jsx("caption",{ref:n,className:ee("mt-4 text-sm text-muted-foreground",e),...t}));oie.displayName="TableCaption";const aie="https://monitor/WebPipe",lie=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,cP={"User-Agent":lie,"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};class Ux extends Error{constructor(n,r){super();$l(this,"title");$l(this,"message");this.title=n,this.message=r}}const uP=()=>{const e=GZ(),t=ZS();return async(n,r={},i)=>{if(!e)throw new Error("CSRF token not set");if(n[0]!=="/"||n[1]==="/")throw new Error(`[useAuthedFetcher] fetchUrl MUST start with a single '/', got '${n}'.`);window.txConsts.isWebInterface||(n=aie+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...cP,"X-TxAdmin-CsrfToken":e},body:r.body?JSON.stringify(r.body):void 0,signal:i==null?void 0:i.signal})).json();if(a!=null&&a.logout)throw t("api"),new Error("Session expired");return a}},cie=async(e,t={})=>{const n=new AbortController,r=setTimeout(()=>{n.abort("timeout")},t.timeout??7500);t.method??(t.method="GET");try{const i=await fetch(e,{...cP,signal:n.signal});return clearTimeout(r),await i.json()}catch(i){throw clearTimeout(r),i}},Wt=e=>{const t=x.useRef(void 0),n=x.useRef(void 0),r=uP();return e.abortOnUnmount??(e.abortOnUnmount=!1),x.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&tn.dismiss(n.current))},[]),async i=>{var c,d;n.current&&(tn.dismiss(n.current),n.current=void 0),t.current=new AbortController;let s=e.path;if(i.pathParams)for(const[u,h]of Object.entries(i.pathParams))s=s.replace(`/:${u}/`,`/${h.toString()}/`);if(i.queryParams){const u=new URLSearchParams;for(const[h,f]of Object.entries(i.queryParams))u.append(h,f.toString());s+=`?${u.toString()}`}const a=`${e.method} ${e.path}`,o=(u,h)=>{if(n.current&&tn.error({title:u,msg:h},{id:n.current}),i.error)try{i.error(h,n.current)}catch(f){console.log("[ERROR CB ERROR]",a,f)}else throw new Ux(u,h)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=tn.loading(i.toastLoadingMessage):i.toastId&&(n.current=i.toastId);const l=setTimeout(()=>{var u,h;(u=t.current)!=null&&u.signal.aborted||(console.log("[TIMEOUT]",a),(h=t.current)==null||h.abort("timeout"),o("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const u=await r(s,{method:e.method,body:i.data},t.current);if(clearTimeout(l),(c=t.current)!=null&&c.signal.aborted)return;if(e.throwGenericErrors&&"error"in u)throw new Ux("API Error",u.error);if(i.genericHandler&&n.current&&("error"in u?tn.error({title:i.genericHandler.errorTitle,msg:u.error},{id:n.current}):tn.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(u==null?void 0:u.type)=="string"&&typeof(u==null?void 0:u.msg)=="string"&&jZ.includes(u==null?void 0:u.type)&&typeof tn[u.type]=="function"&&tn[u.type](u,{id:n.current}),i.success)try{i.success(u,n.current)}catch(h){console.log("[SUCCESS CB ERROR]",a,h)}return u}catch(u){if((d=t.current)!=null&&d.signal.aborted)return;clearTimeout(l);let h="unknown error";const f=u;typeof f.message!="string"?h=JSON.stringify(f):f.message.startsWith("NetworkError")?h=`Network error.
If you closed txAdmin, please restart it and try again.`:f.message.startsWith("JSON.parse:")?h="Invalid JSON response from server.":h=f.message,h.includes("unmount")?console.warn("[UNMOUNTED]",a):(console.error("[ERROR]",a,h),o("Request Error",h))}}};function uie({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return v.jsxs(Vf,{onClick:n,className:"cursor-pointer",children:[v.jsxs(Ur,{className:"px-4 py-2 flex justify-between border-r",children:[v.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),v.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[v.jsx(MK,{className:ee("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),v.jsx(BA,{className:ee("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),v.jsx(rK,{className:ee("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),v.jsx(Ur,{className:"min-w-[8rem] px-4 py-2 border-r",children:UR(e.playTime*6e4)}),v.jsx(Ur,{className:"min-w-[10rem] px-4 py-2 border-r",children:lx(e.tsJoined)}),v.jsx(Ur,{className:"min-w-[10rem] px-4 py-2",children:lx(e.tsLastConnection)})]})}function die({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=v.jsx(dn,{className:"mx-auto animate-spin"}):r?s=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),v.jsx("br",{}),v.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=v.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):s=v.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",v.jsx("br",{}),v.jsxs("i",{children:["(this is a bug, please report it in ",v.jsx(Zc,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),v.jsx(Vf,{children:v.jsx(Ur,{colSpan:4,className:"px-4 py-2 text-center",children:s})})}function v_({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":v.jsx(v.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return v.jsxs("th",{onClick:l,className:ee("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,v.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function hie({search:e,filters:t}){const n=x.useRef(null),[r,i]=x.useState([]),[s,a]=x.useState(!1),[o,l]=x.useState(!0),[c,d]=x.useState(null),[u,h]=x.useState({key:"tsJoined",desc:!0}),[f,b]=x.useState(!1),y=yv(),m=Wt({method:"GET",path:"/player/search",abortOnUnmount:!0}),p=async T=>{l(!0),d(null),T&&b(!0);const w=E=>{d(E),T&&i([])};try{const E={sortingKey:u.key,sortingDesc:u.desc};e&&(E.searchValue=e.value,E.searchType=e.type),t.length&&(E.filters=t.join(",")),!T&&r.length&&(E.offsetParam=r[r.length-1][u.key],E.offsetLicense=r[r.length-1].license);const $=await m({queryParams:E});if($===void 0)return w("Request failed.");if("error"in $)return w(`Request failed: ${$.error}`);d(null),a($.hasReachedEnd),b(!1),$.players.length?i(M=>T?$.players:[...M,...$.players]):i([])}catch(E){w(`Failed to fetch more data: ${E.message}`)}finally{l(!1),b(!1)}},g=xC({scrollingDelay:0,count:r.length+1,getScrollElement:()=>{var T;return(T=n.current)==null?void 0:T.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),_=g.getVirtualItems(),S=g.getTotalSize();let k=null,C=null;if(_.length>0){const T=_[0].start-g.options.scrollMargin;T>0&&(k=v.jsx("tr",{children:v.jsx("td",{colSpan:3,style:{height:T}})}));const w=S-_[_.length-1].end;w>0&&(C=v.jsx("tr",{children:v.jsx("td",{colSpan:3,style:{height:w}})}))}return x.useEffect(()=>{if(!r.length||!_.length)return;const T=_[_.length-1].index;r.length<=T&&!s&&!o&&p()},[r,_,s,o]),x.useEffect(()=>{g.scrollToIndex(0),p(!0)},[e,t,u]),v.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:v.jsx(Si,{className:"h-full",ref:n,children:v.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[v.jsx(wC,{children:v.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[v.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),v.jsx(v_,{label:"Play Time",sortKey:"playTime",sortingState:u,setSorting:h}),v.jsx(v_,{label:"First Joined",sortKey:"tsJoined",sortingState:u,setSorting:h}),v.jsx(v_,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:u,setSorting:h})]})}),v.jsxs(SC,{className:ee(f&&"opacity-25"),children:[k,_.map(T=>T.index>r.length-1?v.jsx(die,{playersCount:r.length,hasReachedEnd:s,loadError:c,isFetching:o,retryFetch:p},T.key):v.jsx(uie,{rowData:r[T.index],modalOpener:y},T.key)),C]})]})})})}const fie=x.memo(Vre),pie=x.memo(hie),mie=x.memo(iD);function gie(){const[e,t]=x.useState(void 0),[n,r]=x.useState(void 0),i=Wt({method:"GET",path:"/player/stats",abortOnUnmount:!0});x.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=x.useCallback((l,c)=>{r({search:l,filters:c})},[]),a=x.useMemo(()=>({search:null,filters:[]}),[]),o=x.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:v.jsx($S,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:v.jsx(Fq,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:v.jsx(PE,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:v.jsx(PE,{}),prefix:"+"}]},[e]);return v.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[v.jsx(mie,{callouts:o}),v.jsx(fie,{doSearch:s,initialState:a}),n?v.jsx(pie,{search:n.search,filters:n.filters}):null]})}function CC(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const dP=x.forwardRef((e,t)=>x.createElement($e.span,te({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),hP=dP,vie=[" ","Enter","ArrowUp","ArrowDown"],yie=[" ","Enter"],$v="Select",[Mv,Rv,_ie]=zf($v),[Pu,bPe]=gr($v,[_ie,Du]),kC=Du(),[bie,hl]=Pu($v),[xie,wie]=Pu($v),Sie=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:h,required:f}=e,b=kC(t),[y,m]=x.useState(null),[p,g]=x.useState(null),[_,S]=x.useState(!1),k=Cu(c),[C=!1,T]=Ls({prop:r,defaultProp:i,onChange:s}),[w,E]=Ls({prop:a,defaultProp:o,onChange:l}),$=x.useRef(null),M=y?!!y.closest("form"):!0,[P,D]=x.useState(new Set),R=Array.from(P).map(O=>O.props.value).join(";");return x.createElement(lC,b,x.createElement(bie,{required:f,scope:t,trigger:y,onTriggerChange:m,valueNode:p,onValueNodeChange:g,valueNodeHasChildren:_,onValueNodeHasChildrenChange:S,contentId:Xr(),value:w,onValueChange:E,open:C,onOpenChange:T,dir:k,triggerPointerDownPosRef:$,disabled:h},x.createElement(Mv.Provider,{scope:t},x.createElement(xie,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(O=>{D(N=>new Set(N).add(O))},[]),onNativeOptionRemove:x.useCallback(O=>{D(N=>{const I=new Set(N);return I.delete(O),I})},[])},n)),M?x.createElement(vP,{key:R,"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:u,value:w,onChange:O=>E(O.target.value),disabled:h},w===void 0?x.createElement("option",{value:""}):null,Array.from(P)):null))},Cie="SelectTrigger",kie=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=kC(n),a=hl(Cie,n),o=a.disabled||r,l=He(t,a.onTriggerChange),c=Rv(n),[d,u,h]=yP(b=>{const y=c().filter(g=>!g.disabled),m=y.find(g=>g.value===a.value),p=_P(y,b,m);p!==void 0&&a.onValueChange(p.value)}),f=()=>{o||(a.onOpenChange(!0),h())};return x.createElement(cC,te({asChild:!0},s),x.createElement($e.button,te({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":gP(a.value)?"":void 0},i,{ref:l,onClick:pe(i.onClick,b=>{b.currentTarget.focus()}),onPointerDown:pe(i.onPointerDown,b=>{const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(f(),a.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:pe(i.onKeyDown,b=>{const y=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&u(b.key),!(y&&b.key===" ")&&vie.includes(b.key)&&(f(),b.preventDefault())})})))}),Eie="SelectValue",Tie=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=hl(Eie,n),{onValueNodeHasChildrenChange:c}=l,d=s!==void 0,u=He(t,l.onValueNodeChange);return un(()=>{c(d)},[c,d]),x.createElement($e.span,te({},o,{ref:u,style:{pointerEvents:"none"}}),gP(l.value)?x.createElement(x.Fragment,null,a):s)}),$ie=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return x.createElement($e.span,te({"aria-hidden":!0},i,{ref:t}),r||"▼")}),Mie=e=>x.createElement(dC,te({asChild:!0},e)),eu="SelectContent",Rie=x.forwardRef((e,t)=>{const n=hl(eu,e.__scopeSelect),[r,i]=x.useState();if(un(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Yn.createPortal(x.createElement(fP,{scope:e.__scopeSelect},x.createElement(Mv.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),s):null}return x.createElement(Aie,te({},e,{ref:t}))}),ms=10,[fP,fl]=Pu(eu),Aie=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:f,sticky:b,hideWhenDetached:y,avoidCollisions:m,...p}=e,g=hl(eu,n),[_,S]=x.useState(null),[k,C]=x.useState(null),T=He(t,U=>S(U)),[w,E]=x.useState(null),[$,M]=x.useState(null),P=Rv(n),[D,R]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(_)return fC(_)},[_]),eC();const N=x.useCallback(U=>{const[z,...V]=P().map(X=>X.ref.current),[K]=V.slice(-1),q=document.activeElement;for(const X of U)if(X===q||(X==null||X.scrollIntoView({block:"nearest"}),X===z&&k&&(k.scrollTop=0),X===K&&k&&(k.scrollTop=k.scrollHeight),X==null||X.focus(),document.activeElement!==q))return},[P,k]),I=x.useCallback(()=>N([w,_]),[N,w,_]);x.useEffect(()=>{D&&I()},[D,I]);const{onOpenChange:j,triggerPointerDownPosRef:L}=g;x.useEffect(()=>{if(_){let U={x:0,y:0};const z=K=>{var q,X,ie,re;U={x:Math.abs(Math.round(K.pageX)-((q=(X=L.current)===null||X===void 0?void 0:X.x)!==null&&q!==void 0?q:0)),y:Math.abs(Math.round(K.pageY)-((ie=(re=L.current)===null||re===void 0?void 0:re.y)!==null&&ie!==void 0?ie:0))}},V=K=>{U.x<=10&&U.y<=10?K.preventDefault():_.contains(K.target)||j(!1),document.removeEventListener("pointermove",z),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",V,{capture:!0})}}},[_,j,L]),x.useEffect(()=>{const U=()=>j(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[j]);const[A,F]=yP(U=>{const z=P().filter(q=>!q.disabled),V=z.find(q=>q.ref.current===document.activeElement),K=_P(z,U,V);K&&setTimeout(()=>K.ref.current.focus())}),H=x.useCallback((U,z,V)=>{const K=!O.current&&!V;(g.value!==void 0&&g.value===z||K)&&(E(U),K&&(O.current=!0))},[g.value]),B=x.useCallback(()=>_==null?void 0:_.focus(),[_]),G=x.useCallback((U,z,V)=>{const K=!O.current&&!V;(g.value!==void 0&&g.value===z||K)&&M(U)},[g.value]),J=r==="popper"?n6:Lie,W=J===n6?{side:o,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:h,collisionPadding:f,sticky:b,hideWhenDetached:y,avoidCollisions:m}:{};return x.createElement(fP,{scope:n,content:_,viewport:k,onViewportChange:C,itemRefCallback:H,selectedItem:w,onItemLeave:B,itemTextRefCallback:G,focusSelectedItem:I,selectedItemText:$,position:r,isPositioned:D,searchRef:A},x.createElement(pC,{as:Io,allowPinchZoom:!0},x.createElement(tC,{asChild:!0,trapped:g.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:pe(i,U=>{var z;(z=g.trigger)===null||z===void 0||z.focus({preventScroll:!0}),U.preventDefault()})},x.createElement(Hf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>g.onOpenChange(!1)},x.createElement(J,te({role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:U=>U.preventDefault()},p,W,{onPlaced:()=>R(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:pe(p.onKeyDown,U=>{const z=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!z&&U.key.length===1&&F(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let K=P().filter(q=>!q.disabled).map(q=>q.ref.current);if(["ArrowUp","End"].includes(U.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const q=U.target,X=K.indexOf(q);K=K.slice(X+1)}setTimeout(()=>N(K)),U.preventDefault()}})}))))))}),Lie=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=hl(eu,n),a=fl(eu,n),[o,l]=x.useState(null),[c,d]=x.useState(null),u=He(t,T=>d(T)),h=Rv(n),f=x.useRef(!1),b=x.useRef(!0),{viewport:y,selectedItem:m,selectedItemText:p,focusSelectedItem:g}=a,_=x.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&c&&y&&m&&p){const T=s.trigger.getBoundingClientRect(),w=c.getBoundingClientRect(),E=s.valueNode.getBoundingClientRect(),$=p.getBoundingClientRect();if(s.dir!=="rtl"){const q=$.left-w.left,X=E.left-q,ie=T.left-X,re=T.width+ie,ce=Math.max(re,w.width),ye=window.innerWidth-ms,ae=ux(X,[ms,ye-ce]);o.style.minWidth=re+"px",o.style.left=ae+"px"}else{const q=w.right-$.right,X=window.innerWidth-E.right-q,ie=window.innerWidth-T.right-X,re=T.width+ie,ce=Math.max(re,w.width),ye=window.innerWidth-ms,ae=ux(X,[ms,ye-ce]);o.style.minWidth=re+"px",o.style.right=ae+"px"}const M=h(),P=window.innerHeight-ms*2,D=y.scrollHeight,R=window.getComputedStyle(c),O=parseInt(R.borderTopWidth,10),N=parseInt(R.paddingTop,10),I=parseInt(R.borderBottomWidth,10),j=parseInt(R.paddingBottom,10),L=O+N+D+j+I,A=Math.min(m.offsetHeight*5,L),F=window.getComputedStyle(y),H=parseInt(F.paddingTop,10),B=parseInt(F.paddingBottom,10),G=T.top+T.height/2-ms,J=P-G,W=m.offsetHeight/2,U=m.offsetTop+W,z=O+N+U,V=L-z;if(z<=G){const q=m===M[M.length-1].ref.current;o.style.bottom="0px";const X=c.clientHeight-y.offsetTop-y.offsetHeight,ie=Math.max(J,W+(q?B:0)+X+I),re=z+ie;o.style.height=re+"px"}else{const q=m===M[0].ref.current;o.style.top="0px";const ie=Math.max(G,O+y.offsetTop+(q?H:0)+W)+V;o.style.height=ie+"px",y.scrollTop=z-G+y.offsetTop}o.style.margin=`${ms}px 0`,o.style.minHeight=A+"px",o.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[h,s.trigger,s.valueNode,o,c,y,m,p,s.dir,r]);un(()=>_(),[_]);const[S,k]=x.useState();un(()=>{c&&k(window.getComputedStyle(c).zIndex)},[c]);const C=x.useCallback(T=>{T&&b.current===!0&&(_(),g==null||g(),b.current=!1)},[_,g]);return x.createElement(Die,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:f,onScrollButtonChange:C},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},x.createElement($e.div,te({},i,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),n6=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ms,...s}=e,a=kC(n);return x.createElement(uC,te({},a,s,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Die,EC]=Pu(eu,{}),r6="SelectViewport",Pie=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=fl(r6,n),s=EC(r6,n),a=He(t,i.onViewportChange),o=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(Mv.Slot,{scope:n},x.createElement($e.div,te({"data-radix-select-viewport":"",role:"presentation"},r,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:pe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:u}=s;if(u!=null&&u.current&&d){const h=Math.abs(o.current-c.scrollTop);if(h>0){const f=window.innerHeight-ms*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),m=Math.max(b,y);if(m<f){const p=m+h,g=Math.min(f,p),_=p-g;d.style.height=g+"px",d.style.bottom==="0px"&&(c.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}o.current=c.scrollTop})}))))}),Oie="SelectGroup",[xPe,Nie]=Pu(Oie),Iie="SelectLabel",jie=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Nie(Iie,n);return x.createElement($e.div,te({id:i.id},r,{ref:t}))}),Vx="SelectItem",[Bie,pP]=Pu(Vx),Fie=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=hl(Vx,n),l=fl(Vx,n),c=o.value===r,[d,u]=x.useState(s??""),[h,f]=x.useState(!1),b=He(t,p=>{var g;return(g=l.itemRefCallback)===null||g===void 0?void 0:g.call(l,p,r,i)}),y=Xr(),m=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.createElement(Bie,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:x.useCallback(p=>{u(g=>{var _;return g||((_=p==null?void 0:p.textContent)!==null&&_!==void 0?_:"").trim()})},[])},x.createElement(Mv.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},x.createElement($e.div,te({role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:b,onFocus:pe(a.onFocus,()=>f(!0)),onBlur:pe(a.onBlur,()=>f(!1)),onPointerUp:pe(a.onPointerUp,m),onPointerMove:pe(a.onPointerMove,p=>{if(i){var g;(g=l.onItemLeave)===null||g===void 0||g.call(l)}else p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(a.onPointerLeave,p=>{if(p.currentTarget===document.activeElement){var g;(g=l.onItemLeave)===null||g===void 0||g.call(l)}}),onKeyDown:pe(a.onKeyDown,p=>{var g;((g=l.searchRef)===null||g===void 0?void 0:g.current)!==""&&p.key===" "||(yie.includes(p.key)&&m(),p.key===" "&&p.preventDefault())})}))))}),em="SelectItemText",zie=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=hl(em,n),o=fl(em,n),l=pP(em,n),c=wie(em,n),[d,u]=x.useState(null),h=He(t,p=>u(p),l.onItemTextChange,p=>{var g;return(g=o.itemTextRefCallback)===null||g===void 0?void 0:g.call(o,p,l.value,l.disabled)}),f=d==null?void 0:d.textContent,b=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},f),[l.disabled,l.value,f]),{onNativeOptionAdd:y,onNativeOptionRemove:m}=c;return un(()=>(y(b),()=>m(b)),[y,m,b]),x.createElement(x.Fragment,null,x.createElement($e.span,te({id:l.textId},s,{ref:h})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Yn.createPortal(s.children,a.valueNode):null)}),Hie="SelectItemIndicator",Wie=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pP(Hie,n).isSelected?x.createElement($e.span,te({"aria-hidden":!0},r,{ref:t})):null}),i6="SelectScrollUpButton",Uie=x.forwardRef((e,t)=>{const n=fl(i6,e.__scopeSelect),r=EC(i6,e.__scopeSelect),[i,s]=x.useState(!1),a=He(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=o.scrollTop>0;s(c)};const o=n.viewport;return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(mP,te({},e,{ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}})):null}),s6="SelectScrollDownButton",Vie=x.forwardRef((e,t)=>{const n=fl(s6,e.__scopeSelect),r=EC(s6,e.__scopeSelect),[i,s]=x.useState(!1),a=He(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=o.scrollHeight-o.clientHeight,d=Math.ceil(o.scrollTop)<c;s(d)};const o=n.viewport;return l(),o.addEventListener("scroll",l),()=>o.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(mP,te({},e,{ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}})):null}),mP=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=fl("SelectScrollButton",n),a=x.useRef(null),o=Rv(n),l=x.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),un(()=>{var c;const d=o().find(u=>u.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[o]),x.createElement($e.div,te({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:pe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:pe(i.onPointerMove,()=>{var c;(c=s.onItemLeave)===null||c===void 0||c.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:pe(i.onPointerLeave,()=>{l()})}))}),qie=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.createElement($e.div,te({"aria-hidden":!0},r,{ref:t}))});function gP(e){return e===""||e===void 0}const vP=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=x.useRef(null),s=He(t,i),a=CC(n);return x.useEffect(()=>{const o=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&d){const u=new Event("change",{bubbles:!0});d.call(o,n),o.dispatchEvent(u)}},[a,n]),x.createElement(dP,{asChild:!0},x.createElement("select",te({},r,{ref:s,defaultValue:n})))});vP.displayName="BubbleSelect";function yP(e){const t=Ct(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(a=>{const o=n.current+a;t(o),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function _P(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Kie(e,Math.max(s,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Kie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const bP=Sie,Av=kie,Gie=Tie,Yie=$ie,xP=Mie,Lv=Rie,wP=Pie,SP=jie,Dv=Fie,CP=zie,Xie=Wie,Pv=Uie,Ov=Vie,kP=qie,Ho=bP,Wo=Gie,Ns=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Av,{ref:r,className:ee("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-black/5 dark:bg-black/30",e),...n,children:[t,v.jsx(Yie,{asChild:!0,children:v.jsx(ku,{className:"h-4 w-4 opacity-50"})})]}));Ns.displayName=Av.displayName;const EP=x.forwardRef(({className:e,...t},n)=>v.jsx(Pv,{ref:n,className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(OA,{className:"h-4 w-4"})}));EP.displayName=Pv.displayName;const TP=x.forwardRef(({className:e,...t},n)=>v.jsx(Ov,{ref:n,className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(ku,{className:"h-4 w-4"})}));TP.displayName=Ov.displayName;const Is=x.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(xP,{children:v.jsxs(Lv,{ref:i,className:ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[v.jsx(EP,{}),v.jsx(wP,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(TP,{})]})}));Is.displayName=Lv.displayName;const Qie=x.forwardRef(({className:e,...t},n)=>v.jsx(SP,{ref:n,className:ee("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Qie.displayName=SP.displayName;const Qe=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Dv,{ref:r,className:ee("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(Xie,{children:v.jsx(ES,{className:"h-4 w-4"})})}),v.jsx(CP,{children:t})]}));Qe.displayName=Dv.displayName;const qx=x.forwardRef(({className:e,...t},n)=>v.jsx(kP,{ref:n,className:ee("-mx-1 my-1 h-px bg-muted",e),...t}));qx.displayName=kP.displayName;const o6=[{value:"actionId",label:"Action ID",placeholder:"XXXX-XXXX",description:"Search actions by their ID."},{value:"reason",label:"Reason",placeholder:"Enter part of the reason to search for",description:"Search actions by their reason contents."},{value:"identifiers",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search actions by their player IDs separated by a comma."}],Il="!any",tm=Fn(1250,e=>{e()},{noLeading:!0});function Jie({doSearch:e,initialState:t,adminStats:n}){var k,C;const{authData:r}=cl(),i=x.useRef(null),[s,a]=x.useState(!1),[o,l]=x.useState(((k=t.search)==null?void 0:k.type)||"actionId"),[c,d]=x.useState(!!((C=t.search)!=null&&C.value)),[u,h]=x.useState(t.filterbyType??Il),[f,b]=x.useState(t.filterbyAdmin??Il),y=()=>{if(!i.current)return;const T=i.current.value.trim(),w=u!==Il?u:void 0,E=f!==Il?f:void 0;T.length?e({value:T,type:o},w,E):e(null,w,E)};x.useEffect(()=>{y()},[o,u,f]);const m=T=>{T.key==="Enter"?(tm.cancel({upcomingOnly:!0}),y()):T.key==="Escape"?(i.current.value="",tm(y),d(!1)):(tm(y),d(!0))},p=()=>{i.current.value="",tm.cancel({upcomingOnly:!0}),y(),d(!1)};wi("keydown",T=>{var w;T.code==="KeyF"&&(T.ctrlKey||T.metaKey)&&((w=i.current)==null||w.focus(),T.preventDefault())});const g=o6.find(T=>T.value===o);if(!g)throw new Error(`Invalid search type: ${o}`);if(!r)throw new Error("authData is not available");const _=x.useMemo(()=>n.filter(T=>T.name!==r.name),[n,r.name]),S=x.useMemo(()=>{var T;return((T=n.find(w=>w.name===r.name))==null?void 0:T.actions)||0},[n,r.name]);return v.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[v.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[v.jsxs("div",{className:"relative min-w-44 grow",children:[v.jsx(sn,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:g.placeholder,onKeyDown:m}),c?v.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:p,children:v.jsx(ns,{})}):v.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:v.jsx(zn,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),v.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[v.jsxs(vc,{children:[v.jsx(yc,{asChild:!0,children:v.jsxs(Ve,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),className:"xs:w-48 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",g.label,v.jsx(hx,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),v.jsxs(Pa,{className:"w-48",children:[v.jsx(e0,{children:"Search Type"}),v.jsx(_c,{}),v.jsx(iP,{value:o,onValueChange:l,children:o6.map(T=>v.jsx(bC,{value:T.value,className:"cursor-pointer",children:T.label},T.value))})]})]}),v.jsxs(Ho,{defaultValue:u,onValueChange:h,children:[v.jsx(Ns,{className:"w-36 grow md:grow-0",children:v.jsx(Wo,{placeholder:"Filter by admin"})}),v.jsxs(Is,{className:"px-0",children:[v.jsx(Qe,{value:Il,className:"cursor-pointer",children:"Any type"}),v.jsx(qx,{}),v.jsx(Qe,{value:"ban",className:"cursor-pointer",children:"Bans"}),v.jsx(Qe,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),v.jsxs(Ho,{defaultValue:f,onValueChange:b,children:[v.jsx(Ns,{className:"w-36 grow md:grow-0",children:v.jsx(Wo,{placeholder:"Filter by admin"})}),v.jsxs(Is,{className:"px-0",children:[v.jsx(Qe,{value:Il,className:"cursor-pointer",children:"By any admin"}),v.jsxs(Qe,{value:r.name,className:"cursor-pointer",children:[r.name," ",v.jsxs("span",{className:"opacity-50",children:["(",S,")"]})]}),v.jsx(qx,{}),_.map(T=>v.jsxs(Qe,{className:"cursor-pointer",value:T.name,children:[T.name," ",v.jsxs("span",{className:"opacity-50",children:["(",T.actions,")"]})]},T.name))]})]}),v.jsx("div",{className:"flex justify-end flex-grow",children:v.jsxs(vc,{children:[v.jsx(yc,{asChild:!0,children:v.jsxs(Ve,{variant:"outline",className:"grow md:grow-0",children:["More",v.jsx(t0,{featName:"banTemplates",durationDays:7}),v.jsx(ku,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),v.jsxs(Pa,{children:[v.jsx(Ui,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:v.jsxs(No,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[v.jsx(jo,{className:"inline mr-1 h-4"}),"Bulk Remove"]})}),v.jsx(Ui,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:v.jsxs(No,{href:"/settings/ban-templates",className:"cursor-pointer",children:[v.jsx(jo,{className:"inline mr-1 h-4"}),"Ban Templates",v.jsx(t0,{featName:"banTemplates",durationDays:7})]})})]})]})})]})]}),v.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:g.description})]})}function Zie({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=v.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:v.jsx(zg,{className:"size-5"})}),i=v.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=v.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:v.jsx(Bg,{className:"size-5"})}),i=v.jsx("span",{className:"tracking-wider text-destructive",children:e.id});else throw new Error(`Invalid action type: ${e.type}`);let s;return e.isRevoked?s=v.jsx(zA,{className:"size-4"}):e.banExpiration&&(e.banExpiration==="permanent"?s=v.jsx(OK,{className:"size-4"}):e.banExpiration==="active"&&(s=v.jsx(FA,{className:"size-4"}))),v.jsxs(Vf,{onClick:n,className:"cursor-pointer",children:[v.jsx(Ur,{className:ee("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:v.jsxs("div",{className:"flex justify-start gap-2",children:[r,v.jsx("div",{className:"p-2 font-mono",children:i}),v.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:s})]})}),v.jsx(Ur,{className:"px-4 py-2 border-r",children:v.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:v.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),v.jsx(Ur,{className:"px-4 py-2 border-r",children:v.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),v.jsx(Ur,{className:"px-4 py-2 border-r",children:v.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),v.jsx(Ur,{className:"min-w-[10rem] px-4 py-2",children:v.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:lx(e.timestamp)})})]})}function ese({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=v.jsx(dn,{className:"mx-auto animate-spin"}):r?s=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),v.jsx("br",{}),v.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=v.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):s=v.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",v.jsx("br",{}),v.jsxs("i",{children:["(this is a bug, please report it in ",v.jsx(Zc,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),v.jsx(Vf,{children:v.jsx(Ur,{colSpan:5,className:"px-4 py-2 text-center",children:s})})}function tse({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":v.jsx(v.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return v.jsxs("th",{onClick:l,className:ee("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,v.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function nm({label:e,className:t}){return v.jsx("th",{className:ee("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function nse({search:e,filterbyType:t,filterbyAdmin:n}){const r=x.useRef(null),[i,s]=x.useState([]),[a,o]=x.useState(!1),[l,c]=x.useState(!1),[d,u]=x.useState(null),[h,f]=x.useState({key:"timestamp",desc:!0}),[b,y]=x.useState(!1),m=JL(),p=Wt({method:"GET",path:"/history/search",abortOnUnmount:!0}),g=async w=>{c(!0),u(null),w&&y(!0);const E=$=>{u($),w&&s([])};try{const $={sortingKey:h.key,sortingDesc:h.desc};e&&($.searchValue=e.value,$.searchType=e.type),t&&t!=="!any"&&($.filterbyType=t),n&&n!=="!any"&&($.filterbyAdmin=n),!w&&i.length&&($.offsetParam=i[i.length-1][h.key],$.offsetActionId=i[i.length-1].id);const M=await p({queryParams:$});if(M===void 0)return E("Request failed.");if("error"in M)return E(`Request failed: ${M.error}`);u(null),o(M.hasReachedEnd),y(!1),M.history.length?s(P=>w?M.history:[...P,...M.history]):s([])}catch($){E(`Failed to fetch more data: ${$.message}`)}finally{c(!1),y(!1)}},_=xC({scrollingDelay:0,count:i.length+1,getScrollElement:()=>{var w;return(w=r.current)==null?void 0:w.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),S=_.getVirtualItems(),k=_.getTotalSize();let C=null,T=null;if(S.length>0){const w=S[0].start-_.options.scrollMargin;w>0&&(C=v.jsx("tr",{children:v.jsx("td",{colSpan:3,style:{height:w}})}));const E=k-S[S.length-1].end;E>0&&(T=v.jsx("tr",{children:v.jsx("td",{colSpan:3,style:{height:E}})}))}return x.useEffect(()=>{if(!i.length||!S.length)return;const w=S[S.length-1].index;i.length<=w&&!a&&!l&&g()},[i,S,a,l]),x.useEffect(()=>{_.scrollToIndex(0),g(!0)},[e,t,n,h]),v.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:v.jsx(Si,{className:"h-full",ref:r,children:v.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[v.jsx(wC,{children:v.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[v.jsx(nm,{label:"Action"}),v.jsx(nm,{label:"Player"}),v.jsx(nm,{label:"Reason"}),v.jsx(nm,{label:"Author"}),v.jsx(tse,{label:"Date Time",sortKey:"timestamp",sortingState:h,setSorting:f})]})}),v.jsxs(SC,{className:ee(b&&"opacity-25"),children:[C,S.map(w=>w.index>i.length-1?v.jsx(ese,{playersCount:i.length,hasReachedEnd:a,loadError:d,isFetching:l,retryFetch:g},w.key):v.jsx(Zie,{action:i[w.index],modalOpener:m},w.key)),T]})]})})})}const rse=x.memo(Jie),ise=x.memo(nse),sse=x.memo(iD);function ose(){const[e,t]=x.useState(void 0),[n,r]=x.useState(void 0),i=Wt({method:"GET",path:"/history/stats",abortOnUnmount:!0});x.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=x.useCallback((l,c,d)=>{r({search:l,filterbyType:c,filterbyAdmin:d})},[]),a=x.useMemo(()=>({search:null,filterbyType:void 0,filterbyAdmin:void 0}),[]),o=x.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:v.jsx(zg,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:v.jsx(zg,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:v.jsx(Bg,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:v.jsx(Bg,{}),prefix:"+"}]},[e]);return v.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[v.jsx(sse,{callouts:o}),e&&!("error"in e)?v.jsx(rse,{doSearch:s,initialState:a,adminStats:e.groupedByAdmins}):null,n?v.jsx(ise,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}const $P="Dialog",[MP,RP]=gr($P),[ase,rs]=MP($P),lse=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=x.useRef(null),l=x.useRef(null),[c=!1,d]=Ls({prop:r,defaultProp:i,onChange:s});return x.createElement(ase,{scope:t,triggerRef:o,contentRef:l,contentId:Xr(),titleId:Xr(),descriptionId:Xr(),open:c,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(u=>!u),[d]),modal:a},n)},AP="DialogPortal",[cse,LP]=MP(AP,{forceMount:void 0}),use=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=rs(AP,t);return x.createElement(cse,{scope:t,forceMount:n},x.Children.map(r,a=>x.createElement(yn,{present:n||s.open},x.createElement(dC,{asChild:!0,container:i},a))))},Kx="DialogOverlay",dse=x.forwardRef((e,t)=>{const n=LP(Kx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=rs(Kx,e.__scopeDialog);return s.modal?x.createElement(yn,{present:r||s.open},x.createElement(hse,te({},i,{ref:t}))):null}),hse=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rs(Kx,n);return x.createElement(pC,{as:Io,allowPinchZoom:!0,shards:[i.contentRef]},x.createElement($e.div,te({"data-state":OP(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),tu="DialogContent",fse=x.forwardRef((e,t)=>{const n=LP(tu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=rs(tu,e.__scopeDialog);return x.createElement(yn,{present:r||s.open},s.modal?x.createElement(pse,te({},i,{ref:t})):x.createElement(mse,te({},i,{ref:t})))}),pse=x.forwardRef((e,t)=>{const n=rs(tu,e.__scopeDialog),r=x.useRef(null),i=He(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return fC(s)},[]),x.createElement(DP,te({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:pe(e.onFocusOutside,s=>s.preventDefault())}))}),mse=x.forwardRef((e,t)=>{const n=rs(tu,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return x.createElement(DP,te({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,s),!s.defaultPrevented){var o;r.current||(o=n.triggerRef.current)===null||o===void 0||o.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var a,o;(a=e.onInteractOutside)===null||a===void 0||a.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((o=n.triggerRef.current)===null||o===void 0?void 0:o.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),DP=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=rs(tu,n),l=x.useRef(null),c=He(t,l);return eC(),x.createElement(x.Fragment,null,x.createElement(tC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},x.createElement(Hf,te({role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":OP(o.open)},a,{ref:c,onDismiss:()=>o.onOpenChange(!1)}))),!1)}),PP="DialogTitle",gse=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rs(PP,n);return x.createElement($e.h2,te({id:i.titleId},r,{ref:t}))}),vse="DialogDescription",yse=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rs(vse,n);return x.createElement($e.p,te({id:i.descriptionId},r,{ref:t}))}),_se="DialogClose",bse=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=rs(_se,n);return x.createElement($e.button,te({type:"button"},r,{ref:t,onClick:pe(e.onClick,()=>i.onOpenChange(!1))}))});function OP(e){return e?"open":"closed"}const xse="DialogTitleWarning",[wse,wPe]=IV(xse,{contentName:tu,titleName:PP,docsSlug:"dialog"}),TC=lse,$C=use,qf=dse,Kf=fse,Gf=gse,Yf=yse,Nv=bse,Xf=TC,Sse=$C,NP=x.forwardRef(({className:e,...t},n)=>v.jsx(qf,{ref:n,className:ee("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));NP.displayName=qf.displayName;const Ou=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Sse,{children:[v.jsx(NP,{}),v.jsxs(Kf,{ref:r,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,v.jsxs(Nv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(ns,{className:"h-6 w-6"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ou.displayName=Kf.displayName;const Nu=({className:e,...t})=>v.jsx("div",{className:ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Nu.displayName="DialogHeader";const Iv=({className:e,...t})=>v.jsx("div",{className:ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Iv.displayName="DialogFooter";const Iu=x.forwardRef(({className:e,...t},n)=>v.jsx(Gf,{ref:n,className:ee("text-lg font-semibold leading-none tracking-tight",e),...t}));Iu.displayName=Gf.displayName;const IP=x.forwardRef(({className:e,...t},n)=>v.jsx(Yf,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));IP.displayName=Yf.displayName;const qm=x.forwardRef((e,t)=>x.createElement($e.label,te({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),jP=qm,Cse=Jo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Jn=x.forwardRef(({className:e,...t},n)=>v.jsx(jP,{ref:n,className:ee(Cse(),e),...t}));Jn.displayName=jP.displayName;const kse=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[i,s]=x.useState(!0);x.useEffect(()=>{if(e){i&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),s(!1)),e.style.height=`${r+2}px`;const o=e.scrollHeight;o>n?e.style.height=`${n}px`:e.style.height=`${o+2}px`}},[e,t])},BP=x.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:i,...s},a)=>{const o=x.useRef(null),[l,c]=x.useState("");return kse({textAreaRef:o.current,triggerAutoSize:l,maxHeight:e,minHeight:t}),x.useImperativeHandle(a,()=>({textArea:o.current,maxHeight:e,minHeight:t})),x.useEffect(()=>{(i||s!=null&&s.defaultValue)&&c(i)},[i,s==null?void 0:s.defaultValue]),v.jsx("textarea",{...s,value:i,ref:o,className:ee("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30",n),onChange:d=>{c(d.target.value),r==null||r(d)}})});BP.displayName="AutosizeTextarea";const Ese=["2 hours","8 hours","1 days","2 days","1 weeks","2 weeks","permanent"];function Tse({reasonData:e,onSave:t,isDialogOpen:n,setIsDialogOpen:r}){let i="",s="2 days",a,o="days";e&&(i=e.reason,Ese.includes(Lg(e.duration))||e.duration==="permanent"?s=Lg(e.duration):(s="custom",a=e.duration.value,o=e.duration.unit));const l=x.useRef(null),c=x.useRef(null),[d,u]=x.useState(s),[h,f]=x.useState(o);x.useEffect(()=>{const y=setTimeout(()=>{n||(u(s),f(o),l.current&&(l.current.textArea.value=""),c.current&&(c.current.value=""))},500);return()=>clearTimeout(y)},[n]);const b=y=>{y.preventDefault();const m=y.currentTarget,p=(e==null?void 0:e.id)||null,g=m.reason.value.trim();if(m.reason.value=g,g.length<3)return m.reason.focus(),tn.warning("Reason must be at least 3 characters long");let _;if(d==="permanent")_="permanent";else if(d==="custom"){if(m.durationMultiplier.value<=0)return m.durationMultiplier.focus(),tn.warning("Custom duration must be a positive number");_={value:parseInt(m.durationMultiplier.value),unit:h}}else{const[S,k]=d.split(" ");_={value:parseInt(S),unit:k}}t({id:p,reason:g,duration:_})};return v.jsx(Xf,{open:n,onOpenChange:r,children:v.jsx(Ou,{className:"md:max-w-xl",children:v.jsx("form",{onSubmit:b,children:v.jsxs("div",{className:"space-y-4",children:[v.jsx(Nu,{children:v.jsxs(Iu,{children:[e?"Edit":"Add"," Template"]})}),v.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[v.jsx(Jn,{htmlFor:"banReason",className:"col-span-6 sm:col-auto",children:"Reason"}),v.jsx(BP,{id:"reason",placeholder:"The reason for the ban, rule violated, etc.",className:"col-span-full sm:col-span-5",defaultValue:i,ref:l,maxHeight:160,minLength:3,autoFocus:!0,required:!0,onChangeCapture:y=>{const m=y.target;m.value.includes(`
`)&&(m.value=m.value.replace(/\s*\r*\n+\s*/g," "))}})]}),v.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[v.jsx(Jn,{htmlFor:"durationSelect",className:"col-span-6 sm:col-auto",children:"Duration"}),v.jsxs("div",{className:"col-span-full sm:col-span-5 space-y-1",children:[v.jsxs(Ho,{onValueChange:u,defaultValue:d,children:[v.jsx(Ns,{id:"durationSelect",className:"tracking-wide",children:v.jsx(Wo,{placeholder:"Select Duration"})}),v.jsxs(Is,{className:"tracking-wide",children:[v.jsx(Qe,{value:"custom",className:"font-bold",children:"Custom (set below)"}),v.jsx(Qe,{value:"2 hours",children:"2 HOURS"}),v.jsx(Qe,{value:"8 hours",children:"8 HOURS"}),v.jsx(Qe,{value:"1 days",children:"1 DAY"}),v.jsx(Qe,{value:"2 days",children:"2 DAYS"}),v.jsx(Qe,{value:"1 weeks",children:"1 WEEK"}),v.jsx(Qe,{value:"2 weeks",children:"2 WEEKS"}),v.jsx(Qe,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),v.jsxs("div",{className:"flex flex-row gap-2",children:[v.jsx(sn,{id:"durationMultiplier",type:"number",placeholder:"123",defaultValue:a,disabled:d!=="custom",ref:c,min:1,max:99,required:!0}),v.jsxs(Ho,{onValueChange:f,defaultValue:h,children:[v.jsx(Ns,{id:"durationUnits",className:"tracking-wide",disabled:d!=="custom",children:v.jsx(Wo,{})}),v.jsxs(Is,{className:"tracking-wide",children:[v.jsx(Qe,{value:"hours",children:"HOURS"}),v.jsx(Qe,{value:"days",children:"DAYS"}),v.jsx(Qe,{value:"weeks",children:"WEEKS"}),v.jsx(Qe,{value:"months",children:"MONTHS"})]})]})]})]})]}),v.jsx(Iv,{children:v.jsx(Ve,{type:"submit",children:"Save changes"})})]})})})})}function $se({id:e,reason:t,duration:n,onEdit:r,onRemove:i,disabled:s}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"grow sm:flex items-center justify-items-start gap-2",children:[v.jsx("span",{className:"line-clamp-5 md:line-clamp-3",children:t}),v.jsx("div",{className:ee("bg-black/5 dark:bg-black/40 px-2 py-0.5 my-1 sm:my-0 border text-sm rounded w-max shrink-0 uppercase select-none",n==="permanent"?"border-destructive bg-destructive-hint text-destructive":"border-primary text-primary opacity-85"),children:Lg(n)})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{className:ee("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-primary hover:scale-110"),onClick:()=>r(e),disabled:s,children:v.jsx(TK,{className:"size-6"})}),v.jsx("button",{className:ee("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-destructive hover:scale-110"),onClick:()=>i(e),disabled:s,children:v.jsx(ns,{className:"size-6"})})]})]})}function Mse({onClick:e,disabled:t}){return v.jsxs("li",{onClick:e,className:ee("rounded-lg bg-card border px-2 py-3 flex gap-3",t?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-primary-foreground cursor-pointer"),children:[v.jsx(jA,{className:"size-6"}),v.jsx("span",{children:"Add New Reason"})]})}function Rse(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const jv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ju(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function MC(e){return"nodeType"in e}function vr(e){var t,n;return e?ju(e)?e:MC(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function RC(e){const{Document:t}=vr(e);return e instanceof t}function Qf(e){return ju(e)?!1:e instanceof vr(e).HTMLElement}function FP(e){return e instanceof vr(e).SVGElement}function Bu(e){return e?ju(e)?e.document:MC(e)?RC(e)?e:Qf(e)||FP(e)?e.ownerDocument:document:document:document}const Ci=jv?x.useLayoutEffect:x.useEffect;function AC(e){const t=x.useRef(e);return Ci(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function Ase(){const e=x.useRef(null),t=x.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function zh(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return Ci(()=>{n.current!==e&&(n.current=e)},t),n}function Jf(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function n0(e){const t=AC(e),n=x.useRef(null),r=x.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Gx(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let y_={};function Zf(e,t){return x.useMemo(()=>{if(t)return t;const n=y_[e]==null?0:y_[e]+1;return y_[e]=n,e+"-"+n},[e,t])}function zP(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const o=Object.entries(a);for(const[l,c]of o){const d=s[l];d!=null&&(s[l]=d+e*c)}return s},{...t})}}const bc=zP(1),Hh=zP(-1);function Lse(e){return"clientX"in e&&"clientY"in e}function LC(e){if(!e)return!1;const{KeyboardEvent:t}=vr(e.target);return t&&e instanceof t}function Dse(e){if(!e)return!1;const{TouchEvent:t}=vr(e.target);return t&&e instanceof t}function Yx(e){if(Dse(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Lse(e)?{x:e.clientX,y:e.clientY}:null}const Wh=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Wh.Translate.toString(e),Wh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),a6="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Pse(e){return e.matches(a6)?e:e.querySelector(a6)}const Ose={display:"none"};function Nse(e){let{id:t,value:n}=e;return Ye.createElement("div",{id:t,style:Ose},n)}function Ise(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ye.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function jse(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const HP=x.createContext(null);function Bse(e){const t=x.useContext(HP);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Fse(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:i,event:s}=r;e.forEach(a=>{var o;return(o=a[i])==null?void 0:o.call(a,s)})},[e]),t]}const zse={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},Hse={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Wse(e){let{announcements:t=Hse,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=zse}=e;const{announce:s,announcement:a}=jse(),o=Zf("DndLiveRegion"),[l,c]=x.useState(!1);if(x.useEffect(()=>{c(!0)},[]),Bse(x.useMemo(()=>({onDragStart(u){let{active:h}=u;s(t.onDragStart({active:h}))},onDragMove(u){let{active:h,over:f}=u;t.onDragMove&&s(t.onDragMove({active:h,over:f}))},onDragOver(u){let{active:h,over:f}=u;s(t.onDragOver({active:h,over:f}))},onDragEnd(u){let{active:h,over:f}=u;s(t.onDragEnd({active:h,over:f}))},onDragCancel(u){let{active:h,over:f}=u;s(t.onDragCancel({active:h,over:f}))}}),[s,t])),!l)return null;const d=Ye.createElement(Ye.Fragment,null,Ye.createElement(Nse,{id:r,value:i.draggable}),Ye.createElement(Ise,{id:o,announcement:a}));return n?Yn.createPortal(d,n):d}var pn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(pn||(pn={}));function r0(){}function l6(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Use(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ki=Object.freeze({x:0,y:0});function WP(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function UP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Vse(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function c6(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function VP(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function u6(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const qse=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=u6(t,t.left,t.top),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=WP(u6(l),i);s.push({id:o,data:{droppableContainer:a,value:c}})}}return s.sort(UP)},Kse=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=c6(t),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=c6(l),d=i.reduce((h,f,b)=>h+WP(c[b],f),0),u=Number((d/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:u}})}}return s.sort(UP)};function Gse(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=i-r,o=s-n;if(r<i&&n<s){const l=t.width*t.height,c=e.width*e.height,d=a*o,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const Yse=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:a}=s,o=n.get(a);if(o){const l=Gse(o,t);l>0&&i.push({id:a,data:{droppableContainer:s,value:l}})}}return i.sort(Vse)};function Xse(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function qP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ki}function Qse(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((a,o)=>({...a,top:a.top+e*o.y,bottom:a.bottom+e*o.y,left:a.left+e*o.x,right:a.right+e*o.x}),{...n})}}const Jse=Qse(1);function Zse(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function eoe(e,t,n){const r=Zse(t);if(!r)return e;const{scaleX:i,scaleY:s,x:a,y:o}=r,l=e.left-a-(1-i)*parseFloat(n),c=e.top-o-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,u=s?e.height/s:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const toe={ignoreTransform:!1};function Fu(e,t){t===void 0&&(t=toe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=vr(e).getComputedStyle(e);c&&(n=eoe(n,c,d))}const{top:r,left:i,width:s,height:a,bottom:o,right:l}=n;return{top:r,left:i,width:s,height:a,bottom:o,right:l}}function d6(e){return Fu(e,{ignoreTransform:!0})}function noe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function roe(e,t){return t===void 0&&(t=vr(e).getComputedStyle(e)),t.position==="fixed"}function ioe(e,t){t===void 0&&(t=vr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function Bv(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(RC(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Qf(i)||FP(i)||n.includes(i))return n;const s=vr(e).getComputedStyle(i);return i!==e&&ioe(i,s)&&n.push(i),roe(i,s)?n:r(i.parentNode)}return e?r(e):n}function KP(e){const[t]=Bv(e,1);return t??null}function __(e){return!jv||!e?null:ju(e)?e:MC(e)?RC(e)||e===Bu(e).scrollingElement?window:Qf(e)?e:null:null}function GP(e){return ju(e)?e.scrollX:e.scrollLeft}function YP(e){return ju(e)?e.scrollY:e.scrollTop}function Xx(e){return{x:GP(e),y:YP(e)}}var kn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(kn||(kn={}));function XP(e){return!jv||!e?!1:e===document.scrollingElement}function QP(e){const t={x:0,y:0},n=XP(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,o=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:o,maxScroll:r,minScroll:t}}const soe={x:.2,y:.2};function ooe(e,t,n,r,i){let{top:s,left:a,right:o,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=soe);const{isTop:c,isBottom:d,isLeft:u,isRight:h}=QP(e),f={x:0,y:0},b={x:0,y:0},y={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+y.height?(f.y=kn.Backward,b.y=r*Math.abs((t.top+y.height-s)/y.height)):!d&&l>=t.bottom-y.height&&(f.y=kn.Forward,b.y=r*Math.abs((t.bottom-y.height-l)/y.height)),!h&&o>=t.right-y.width?(f.x=kn.Forward,b.x=r*Math.abs((t.right-y.width-o)/y.width)):!u&&a<=t.left+y.width&&(f.x=kn.Backward,b.x=r*Math.abs((t.left+y.width-a)/y.width)),{direction:f,speed:b}}function aoe(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function JP(e){return e.reduce((t,n)=>bc(t,Xx(n)),ki)}function loe(e){return e.reduce((t,n)=>t+GP(n),0)}function coe(e){return e.reduce((t,n)=>t+YP(n),0)}function uoe(e,t){if(t===void 0&&(t=Fu),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);KP(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const doe=[["x",["left","right"],loe],["y",["top","bottom"],coe]];class DC{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Bv(n),i=JP(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,o]of doe)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=o(r),d=i[s]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ch{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function hoe(e){const{EventTarget:t}=vr(e);return e instanceof t?e:Bu(e)}function b_(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var jr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(jr||(jr={}));function h6(e){e.preventDefault()}function foe(e){e.stopPropagation()}var ot;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(ot||(ot={}));const ZP={start:[ot.Space,ot.Enter],cancel:[ot.Esc],end:[ot.Space,ot.Enter]},poe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ot.Right:return{...n,x:n.x+25};case ot.Left:return{...n,x:n.x-25};case ot.Down:return{...n,y:n.y+25};case ot.Up:return{...n,y:n.y-25}}};class PC{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ch(Bu(n)),this.windowListeners=new ch(vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(jr.Resize,this.handleCancel),this.windowListeners.add(jr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(jr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&uoe(r),n(ki)}handleKeyDown(t){if(LC(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=ZP,coordinateGetter:a=poe,scrollBehavior:o="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:ki;this.referenceCoordinates||(this.referenceCoordinates=d);const u=a(t,{active:n,context:r.current,currentCoordinates:d});if(u){const h=Hh(u,d),f={x:0,y:0},{scrollableAncestors:b}=r.current;for(const y of b){const m=t.code,{isTop:p,isRight:g,isLeft:_,isBottom:S,maxScroll:k,minScroll:C}=QP(y),T=aoe(y),w={x:Math.min(m===ot.Right?T.right-T.width/2:T.right,Math.max(m===ot.Right?T.left:T.left+T.width/2,u.x)),y:Math.min(m===ot.Down?T.bottom-T.height/2:T.bottom,Math.max(m===ot.Down?T.top:T.top+T.height/2,u.y))},E=m===ot.Right&&!g||m===ot.Left&&!_,$=m===ot.Down&&!S||m===ot.Up&&!p;if(E&&w.x!==u.x){const M=y.scrollLeft+h.x,P=m===ot.Right&&M<=k.x||m===ot.Left&&M>=C.x;if(P&&!h.y){y.scrollTo({left:M,behavior:o});return}P?f.x=y.scrollLeft-M:f.x=m===ot.Right?y.scrollLeft-k.x:y.scrollLeft-C.x,f.x&&y.scrollBy({left:-f.x,behavior:o});break}else if($&&w.y!==u.y){const M=y.scrollTop+h.y,P=m===ot.Down&&M<=k.y||m===ot.Up&&M>=C.y;if(P&&!h.x){y.scrollTo({top:M,behavior:o});return}P?f.y=y.scrollTop-M:f.y=m===ot.Down?y.scrollTop-k.y:y.scrollTop-C.y,f.y&&y.scrollBy({top:-f.y,behavior:o});break}}this.handleMove(t,bc(Hh(u,this.referenceCoordinates),f))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}PC.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ZP,onActivation:i}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const o=s.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function f6(e){return!!(e&&"distance"in e)}function p6(e){return!!(e&&"delay"in e)}class OC{constructor(t,n,r){var i;r===void 0&&(r=hoe(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Bu(a),this.documentListeners=new ch(this.document),this.listeners=new ch(r),this.windowListeners=new ch(vr(a)),this.initialCoordinates=(i=Yx(s))!=null?i:ki,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(jr.Resize,this.handleCancel),this.windowListeners.add(jr.DragStart,h6),this.windowListeners.add(jr.VisibilityChange,this.handleCancel),this.windowListeners.add(jr.ContextMenu,h6),this.documentListeners.add(jr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(p6(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(f6(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(jr.Click,foe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(jr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:o}}=s;if(!i)return;const l=(n=Yx(t))!=null?n:ki,c=Hh(i,l);if(!r&&o){if(f6(o)){if(o.tolerance!=null&&b_(c,o.tolerance))return this.handleCancel();if(b_(c,o.distance))return this.handleStart()}return p6(o)&&b_(c,o.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===ot.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const moe={move:{name:"pointermove"},end:{name:"pointerup"}};class NC extends OC{constructor(t){const{event:n}=t,r=Bu(n.target);super(t,moe,r)}}NC.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const goe={move:{name:"mousemove"},end:{name:"mouseup"}};var Qx;(function(e){e[e.RightClick=2]="RightClick"})(Qx||(Qx={}));class voe extends OC{constructor(t){super(t,goe,Bu(t.event.target))}}voe.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Qx.RightClick?!1:(r==null||r({event:n}),!0)}}];const x_={move:{name:"touchmove"},end:{name:"touchend"}};class yoe extends OC{constructor(t){super(t,x_)}static setup(){return window.addEventListener(x_.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(x_.move.name,t)};function t(){}}}yoe.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var uh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(uh||(uh={}));var i0;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(i0||(i0={}));function _oe(e){let{acceleration:t,activator:n=uh.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:o=i0.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:h}=e;const f=xoe({delta:u,disabled:!s}),[b,y]=Ase(),m=x.useRef({x:0,y:0}),p=x.useRef({x:0,y:0}),g=x.useMemo(()=>{switch(n){case uh.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case uh.DraggableRect:return i}},[n,i,l]),_=x.useRef(null),S=x.useCallback(()=>{const C=_.current;if(!C)return;const T=m.current.x*p.current.x,w=m.current.y*p.current.y;C.scrollBy(T,w)},[]),k=x.useMemo(()=>o===i0.TreeOrder?[...c].reverse():c,[o,c]);x.useEffect(()=>{if(!s||!c.length||!g){y();return}for(const C of k){if((r==null?void 0:r(C))===!1)continue;const T=c.indexOf(C),w=d[T];if(!w)continue;const{direction:E,speed:$}=ooe(C,w,g,t,h);for(const M of["x","y"])f[M][E[M]]||($[M]=0,E[M]=0);if($.x>0||$.y>0){y(),_.current=C,b(S,a),m.current=$,p.current=E;return}}m.current={x:0,y:0},p.current={x:0,y:0},y()},[t,S,r,y,s,a,JSON.stringify(g),JSON.stringify(f),b,c,k,d,JSON.stringify(h)])}const boe={x:{[kn.Backward]:!1,[kn.Forward]:!1},y:{[kn.Backward]:!1,[kn.Forward]:!1}};function xoe(e){let{delta:t,disabled:n}=e;const r=Gx(t);return Jf(i=>{if(n||!r||!i)return boe;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[kn.Backward]:i.x[kn.Backward]||s.x===-1,[kn.Forward]:i.x[kn.Forward]||s.x===1},y:{[kn.Backward]:i.y[kn.Backward]||s.y===-1,[kn.Forward]:i.y[kn.Forward]||s.y===1}}},[n,t,r])}function woe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Jf(i=>{var s;return t===null?null:(s=r??i)!=null?s:null},[r,t])}function Soe(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Uh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Uh||(Uh={}));var Jx;(function(e){e.Optimized="optimized"})(Jx||(Jx={}));const m6=new Map;function Coe(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=x.useState(null),{frequency:o,measure:l,strategy:c}=i,d=x.useRef(e),u=m(),h=zh(u),f=x.useCallback(function(p){p===void 0&&(p=[]),!h.current&&a(g=>g===null?p:g.concat(p.filter(_=>!g.includes(_))))},[h]),b=x.useRef(null),y=Jf(p=>{if(u&&!n)return m6;if(!p||p===m6||d.current!==e||s!=null){const g=new Map;for(let _ of e){if(!_)continue;if(s&&s.length>0&&!s.includes(_.id)&&_.rect.current){g.set(_.id,_.rect.current);continue}const S=_.node.current,k=S?new DC(l(S),S):null;_.rect.current=k,k&&g.set(_.id,k)}return g}return p},[e,s,n,u,l]);return x.useEffect(()=>{d.current=e},[e]),x.useEffect(()=>{u||f()},[n,u]),x.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),x.useEffect(()=>{u||typeof o!="number"||b.current!==null||(b.current=setTimeout(()=>{f(),b.current=null},o))},[o,u,f,...r]),{droppableRects:y,measureDroppableContainers:f,measuringScheduled:s!=null};function m(){switch(c){case Uh.Always:return!1;case Uh.BeforeDragging:return n;default:return!n}}}function eO(e,t){return Jf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function koe(e,t){return eO(e,t)}function Eoe(e){let{callback:t,disabled:n}=e;const r=AC(t),i=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Fv(e){let{callback:t,disabled:n}=e;const r=AC(t),i=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Toe(e){return new DC(Fu(e),e)}function g6(e,t,n){t===void 0&&(t=Toe);const[r,i]=x.useReducer(o,null),s=Eoe({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=Fv({callback:i});return Ci(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r;function o(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d}}function $oe(e){const t=eO(e);return qP(e,t)}const v6=[];function Moe(e){const t=x.useRef(e),n=Jf(r=>e?r&&r!==v6&&e&&t.current&&e.parentNode===t.current.parentNode?r:Bv(e):v6,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function Roe(e){const[t,n]=x.useState(null),r=x.useRef(e),i=x.useCallback(s=>{const a=__(s.target);a&&n(o=>o?(o.set(a,Xx(a)),new Map(o)):null)},[]);return x.useEffect(()=>{const s=r.current;if(e!==s){a(s);const o=e.map(l=>{const c=__(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Xx(c)]):null}).filter(l=>l!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(s)};function a(o){o.forEach(l=>{const c=__(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>bc(s,a),ki):JP(e):ki,[e,t])}function y6(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==ki;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Hh(e,n.current):ki}function Aoe(e){x.useEffect(()=>{if(!jv)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Loe(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function tO(e){return x.useMemo(()=>e?noe(e):null,[e])}const w_=[];function Doe(e,t){t===void 0&&(t=Fu);const[n]=e,r=tO(n?vr(n):null),[i,s]=x.useReducer(o,w_),a=Fv({callback:s});return e.length>0&&i===w_&&s(),Ci(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),s())},[e]),i;function o(){return e.length?e.map(l=>XP(l)?r:new DC(t(l),l)):w_}}function Poe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qf(t)?t:e}function Ooe(e){let{measure:t}=e;const[n,r]=x.useState(null),i=x.useCallback(c=>{for(const{target:d}of c)if(Qf(d)){r(u=>{const h=t(d);return u?{...u,width:h.width,height:h.height}:h});break}},[t]),s=Fv({callback:i}),a=x.useCallback(c=>{const d=Poe(c);s==null||s.disconnect(),d&&(s==null||s.observe(d)),r(d?t(d):null)},[t,s]),[o,l]=n0(a);return x.useMemo(()=>({nodeRef:o,rect:n,setRef:l}),[n,o,l])}const Noe=[{sensor:NC,options:{}},{sensor:PC,options:{}}],Ioe={current:{}},Km={draggable:{measure:d6},droppable:{measure:d6,strategy:Uh.WhileDragging,frequency:Jx.Optimized},dragOverlay:{measure:Fu}};class dh extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const joe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:r0},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Km,measureDroppableContainers:r0,windowRect:null,measuringScheduled:!1},Boe={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:r0,draggableNodes:new Map,over:null,measureDroppableContainers:r0},zv=x.createContext(Boe),nO=x.createContext(joe);function Foe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dh}}}function zoe(e,t){switch(t.type){case pn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case pn.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case pn.DragEnd:case pn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new dh(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case pn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new dh(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case pn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new dh(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Hoe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=x.useContext(zv),s=Gx(r),a=Gx(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!LC(s)||document.activeElement===s.target)return;const o=i.get(a);if(!o)return;const{activatorNode:l,node:c}=o;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=Pse(d);if(u){u.focus();break}}})}},[r,t,i,a,s]),null}function Woe(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Uoe(e){return x.useMemo(()=>({draggable:{...Km.draggable,...e==null?void 0:e.draggable},droppable:{...Km.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Km.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Voe(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=x.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;Ci(()=>{if(!a&&!o||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=n(c),u=qP(d,r);if(a||(u.x=0),o||(u.y=0),s.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const h=KP(c);h&&h.scrollBy({top:u.y,left:u.x})}},[t,a,o,r,n])}const rO=x.createContext({...ki,scaleX:1,scaleY:1});var ro;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ro||(ro={}));const qoe=x.memo(function(t){var n,r,i,s;let{id:a,accessibility:o,autoScroll:l=!0,children:c,sensors:d=Noe,collisionDetection:u=Yse,measuring:h,modifiers:f,...b}=t;const y=x.useReducer(zoe,void 0,Foe),[m,p]=y,[g,_]=Fse(),[S,k]=x.useState(ro.Uninitialized),C=S===ro.Initialized,{draggable:{active:T,nodes:w,translate:E},droppable:{containers:$}}=m,M=T?w.get(T):null,P=x.useRef({initial:null,translated:null}),D=x.useMemo(()=>{var Xe;return T!=null?{id:T,data:(Xe=M==null?void 0:M.data)!=null?Xe:Ioe,rect:P}:null},[T,M]),R=x.useRef(null),[O,N]=x.useState(null),[I,j]=x.useState(null),L=zh(b,Object.values(b)),A=Zf("DndDescribedBy",a),F=x.useMemo(()=>$.getEnabled(),[$]),H=Uoe(h),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:J}=Coe(F,{dragging:C,dependencies:[E.x,E.y],config:H.droppable}),W=woe(w,T),U=x.useMemo(()=>I?Yx(I):null,[I]),z=rt(),V=koe(W,H.draggable.measure);Voe({activeNode:T?w.get(T):null,config:z.layoutShiftCompensation,initialRect:V,measure:H.draggable.measure});const K=g6(W,H.draggable.measure,V),q=g6(W?W.parentElement:null),X=x.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=$.getNodeFor((n=X.current.over)==null?void 0:n.id),re=Ooe({measure:H.dragOverlay.measure}),ce=(r=re.nodeRef.current)!=null?r:W,ye=C?(i=re.rect)!=null?i:K:null,ae=!!(re.nodeRef.current&&re.rect),Me=$oe(ae?null:K),Pe=tO(ce?vr(ce):null),ge=Moe(C?ie??W:null),xe=Doe(ge),oe=Woe(f,{transform:{x:E.x-Me.x,y:E.y-Me.y,scaleX:1,scaleY:1},activatorEvent:I,active:D,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:ye,over:X.current.over,overlayNodeRect:re.rect,scrollableAncestors:ge,scrollableAncestorRects:xe,windowRect:Pe}),se=U?bc(U,E):null,fe=Roe(ge),Q=y6(fe),ne=y6(fe,[K]),he=bc(oe,Q),ve=ye?Jse(ye,oe):null,Ce=D&&ve?u({active:D,collisionRect:ve,droppableRects:B,droppableContainers:F,pointerCoordinates:se}):null,Te=VP(Ce,"id"),[we,be]=x.useState(null),mt=ae?oe:bc(oe,ne),Je=Xse(mt,(s=we==null?void 0:we.rect)!=null?s:null,K),qe=x.useCallback((Xe,ut)=>{let{sensor:gt,options:bn}=ut;if(R.current==null)return;const Pt=w.get(R.current);if(!Pt)return;const Ot=Xe.nativeEvent,Jt=new gt({active:R.current,activeNode:Pt,event:Ot,options:bn,context:X,onStart(Vt){const Pn=R.current;if(Pn==null)return;const xn=w.get(Pn);if(!xn)return;const{onDragStart:dt}=L.current,Ze={active:{id:Pn,data:xn.data,rect:P}};Yn.unstable_batchedUpdates(()=>{dt==null||dt(Ze),k(ro.Initializing),p({type:pn.DragStart,initialCoordinates:Vt,active:Pn}),g({type:"onDragStart",event:Ze})})},onMove(Vt){p({type:pn.DragMove,coordinates:Vt})},onEnd:nn(pn.DragEnd),onCancel:nn(pn.DragCancel)});Yn.unstable_batchedUpdates(()=>{N(Jt),j(Xe.nativeEvent)});function nn(Vt){return async function(){const{active:xn,collisions:dt,over:Ze,scrollAdjustedTranslate:Be}=X.current;let vt=null;if(xn&&Be){const{cancelDrop:hn}=L.current;vt={activatorEvent:Ot,active:xn,collisions:dt,delta:Be,over:Ze},Vt===pn.DragEnd&&typeof hn=="function"&&await Promise.resolve(hn(vt))&&(Vt=pn.DragCancel)}R.current=null,Yn.unstable_batchedUpdates(()=>{p({type:Vt}),k(ro.Uninitialized),be(null),N(null),j(null);const hn=Vt===pn.DragEnd?"onDragEnd":"onDragCancel";if(vt){const on=L.current[hn];on==null||on(vt),g({type:hn,event:vt})}})}}},[w]),ct=x.useCallback((Xe,ut)=>(gt,bn)=>{const Pt=gt.nativeEvent,Ot=w.get(bn);if(R.current!==null||!Ot||Pt.dndKit||Pt.defaultPrevented)return;const Jt={active:Ot};Xe(gt,ut.options,Jt)===!0&&(Pt.dndKit={capturedBy:ut.sensor},R.current=bn,qe(gt,ut))},[w,qe]),nt=Soe(d,ct);Aoe(d),Ci(()=>{K&&S===ro.Initializing&&k(ro.Initialized)},[K,S]),x.useEffect(()=>{const{onDragMove:Xe}=L.current,{active:ut,activatorEvent:gt,collisions:bn,over:Pt}=X.current;if(!ut||!gt)return;const Ot={active:ut,activatorEvent:gt,collisions:bn,delta:{x:he.x,y:he.y},over:Pt};Yn.unstable_batchedUpdates(()=>{Xe==null||Xe(Ot),g({type:"onDragMove",event:Ot})})},[he.x,he.y]),x.useEffect(()=>{const{active:Xe,activatorEvent:ut,collisions:gt,droppableContainers:bn,scrollAdjustedTranslate:Pt}=X.current;if(!Xe||R.current==null||!ut||!Pt)return;const{onDragOver:Ot}=L.current,Jt=bn.get(Te),nn=Jt&&Jt.rect.current?{id:Jt.id,rect:Jt.rect.current,data:Jt.data,disabled:Jt.disabled}:null,Vt={active:Xe,activatorEvent:ut,collisions:gt,delta:{x:Pt.x,y:Pt.y},over:nn};Yn.unstable_batchedUpdates(()=>{be(nn),Ot==null||Ot(Vt),g({type:"onDragOver",event:Vt})})},[Te]),Ci(()=>{X.current={activatorEvent:I,active:D,activeNode:W,collisionRect:ve,collisions:Ce,droppableRects:B,draggableNodes:w,draggingNode:ce,draggingNodeRect:ye,droppableContainers:$,over:we,scrollableAncestors:ge,scrollAdjustedTranslate:he},P.current={initial:ye,translated:ve}},[D,W,Ce,ve,w,ce,ye,B,$,we,ge,he]),_oe({...z,delta:E,draggingRect:ve,pointerCoordinates:se,scrollableAncestors:ge,scrollableAncestorRects:xe});const Ie=x.useMemo(()=>({active:D,activeNode:W,activeNodeRect:K,activatorEvent:I,collisions:Ce,containerNodeRect:q,dragOverlay:re,draggableNodes:w,droppableContainers:$,droppableRects:B,over:we,measureDroppableContainers:G,scrollableAncestors:ge,scrollableAncestorRects:xe,measuringConfiguration:H,measuringScheduled:J,windowRect:Pe}),[D,W,K,I,Ce,q,re,w,$,B,we,G,ge,xe,H,J,Pe]),Ke=x.useMemo(()=>({activatorEvent:I,activators:nt,active:D,activeNodeRect:K,ariaDescribedById:{draggable:A},dispatch:p,draggableNodes:w,over:we,measureDroppableContainers:G}),[I,nt,D,K,p,A,w,we,G]);return Ye.createElement(HP.Provider,{value:_},Ye.createElement(zv.Provider,{value:Ke},Ye.createElement(nO.Provider,{value:Ie},Ye.createElement(rO.Provider,{value:Je},c)),Ye.createElement(Hoe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),Ye.createElement(Wse,{...o,hiddenTextDescribedById:A}));function rt(){const Xe=(O==null?void 0:O.autoScrollEnabled)===!1,ut=typeof l=="object"?l.enabled===!1:l===!1,gt=C&&!Xe&&!ut;return typeof l=="object"?{...l,enabled:gt}:{enabled:gt}}}),Koe=x.createContext(null),_6="button",Goe="Droppable";function Yoe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Zf(Goe),{activators:a,activatorEvent:o,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:h}=x.useContext(zv),{role:f=_6,roleDescription:b="draggable",tabIndex:y=0}=i??{},m=(l==null?void 0:l.id)===t,p=x.useContext(m?rO:Koe),[g,_]=n0(),[S,k]=n0(),C=Loe(a,t),T=zh(n);Ci(()=>(u.set(t,{id:t,key:s,node:g,activatorNode:S,data:T}),()=>{const E=u.get(t);E&&E.key===s&&u.delete(t)}),[u,t]);const w=x.useMemo(()=>({role:f,tabIndex:y,"aria-disabled":r,"aria-pressed":m&&f===_6?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[r,f,y,m,b,d.draggable]);return{active:l,activatorEvent:o,activeNodeRect:c,attributes:w,isDragging:m,listeners:r?void 0:C,node:g,over:h,setNodeRef:_,setActivatorNodeRef:k,transform:p}}function Xoe(){return x.useContext(nO)}const Qoe="Droppable",Joe={timeout:25};function Zoe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Zf(Qoe),{active:a,dispatch:o,over:l,measureDroppableContainers:c}=x.useContext(zv),d=x.useRef({disabled:n}),u=x.useRef(!1),h=x.useRef(null),f=x.useRef(null),{disabled:b,updateMeasurementsFor:y,timeout:m}={...Joe,...i},p=zh(y??r),g=x.useCallback(()=>{if(!u.current){u.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(p.current)?p.current:[p.current]),f.current=null},m)},[m]),_=Fv({callback:g,disabled:b||!a}),S=x.useCallback((w,E)=>{_&&(E&&(_.unobserve(E),u.current=!1),w&&_.observe(w))},[_]),[k,C]=n0(S),T=zh(t);return x.useEffect(()=>{!_||!k.current||(_.disconnect(),u.current=!1,_.observe(k.current))},[k,_]),Ci(()=>(o({type:pn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:h,data:T}}),()=>o({type:pn.UnregisterDroppable,key:s,id:r})),[r]),x.useEffect(()=>{n!==d.current.disabled&&(o({type:pn.SetDroppableDisabled,id:r,key:s,disabled:n}),d.current.disabled=n)},[r,s,n,o]),{active:a,rect:h,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:C}}function IC(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function eae(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function rm(e){return e!==null&&e>=0}function tae(e,t){if(e===t)return!0;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 nae(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const iO=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=IC(t,r,n),a=t[i],o=s[i];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},im={scaleX:1,scaleY:1},rae=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:a}=e;const o=(t=s[n])!=null?t:r;if(!o)return null;if(i===n){const c=s[a];return c?{x:0,y:n<a?c.top+c.height-(o.top+o.height):c.top-o.top,...im}:null}const l=iae(s,i,n);return i>n&&i<=a?{x:0,y:-o.height-l,...im}:i<n&&i>=a?{x:0,y:o.height+l,...im}:{x:0,y:0,...im}};function iae(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?n<t?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const sO="Sortable",oO=Ye.createContext({activeIndex:-1,containerId:sO,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:iO,disabled:{draggable:!1,droppable:!1}});function sae(e){let{children:t,id:n,items:r,strategy:i=iO,disabled:s=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:c,measureDroppableContainers:d}=Xoe(),u=Zf(sO,n),h=o.rect!==null,f=x.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),b=a!=null,y=a?f.indexOf(a.id):-1,m=c?f.indexOf(c.id):-1,p=x.useRef(f),g=!tae(f,p.current),_=m!==-1&&y===-1||g,S=nae(s);Ci(()=>{g&&b&&d(f)},[g,f,b,d]),x.useEffect(()=>{p.current=f},[f]);const k=x.useMemo(()=>({activeIndex:y,containerId:u,disabled:S,disableTransforms:_,items:f,overIndex:m,useDragOverlay:h,sortedRects:eae(f,l),strategy:i}),[y,u,S.draggable,S.droppable,_,f,m,l,h,i]);return Ye.createElement(oO.Provider,{value:k},t)}const oae=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return IC(n,r,i).indexOf(t)},aae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:o,previousContainerId:l,transition:c}=e;return!c||!r||o!==s&&i===a?!1:n?!0:a!==i&&t===l},lae={duration:200,easing:"ease"},aO="transform",cae=Wh.Transition.toString({property:aO,duration:0,easing:"linear"}),uae={roleDescription:"sortable"};function dae(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=x.useState(null),o=x.useRef(n);return Ci(()=>{if(!t&&n!==o.current&&r.current){const l=i.current;if(l){const c=Fu(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&a(d)}}n!==o.current&&(o.current=n)},[t,n,r,i]),x.useEffect(()=>{s&&a(null)},[s]),s}function hae(e){let{animateLayoutChanges:t=aae,attributes:n,disabled:r,data:i,getNewIndex:s=oae,id:a,strategy:o,resizeObserverConfig:l,transition:c=lae}=e;const{items:d,containerId:u,activeIndex:h,disabled:f,disableTransforms:b,sortedRects:y,overIndex:m,useDragOverlay:p,strategy:g}=x.useContext(oO),_=fae(r,f),S=d.indexOf(a),k=x.useMemo(()=>({sortable:{containerId:u,index:S,items:d},...i}),[u,i,S,d]),C=x.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:T,node:w,isOver:E,setNodeRef:$}=Zoe({id:a,data:k,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:M,activatorEvent:P,activeNodeRect:D,attributes:R,setNodeRef:O,listeners:N,isDragging:I,over:j,setActivatorNodeRef:L,transform:A}=Yoe({id:a,data:k,attributes:{...uae,...n},disabled:_.draggable}),F=Rse($,O),H=!!M,B=H&&!b&&rm(h)&&rm(m),G=!p&&I,J=G&&B?A:null,U=B?J??(o??g)({rects:y,activeNodeRect:D,activeIndex:h,overIndex:m,index:S}):null,z=rm(h)&&rm(m)?s({id:a,items:d,activeIndex:h,overIndex:m}):S,V=M==null?void 0:M.id,K=x.useRef({activeId:V,items:d,newIndex:z,containerId:u}),q=d!==K.current.items,X=t({active:M,containerId:u,isDragging:I,isSorting:H,id:a,index:S,items:d,newIndex:K.current.newIndex,previousItems:K.current.items,previousContainerId:K.current.containerId,transition:c,wasDragging:K.current.activeId!=null}),ie=dae({disabled:!X,index:S,node:w,rect:T});return x.useEffect(()=>{H&&K.current.newIndex!==z&&(K.current.newIndex=z),u!==K.current.containerId&&(K.current.containerId=u),d!==K.current.items&&(K.current.items=d)},[H,z,u,d]),x.useEffect(()=>{if(V===K.current.activeId)return;if(V&&!K.current.activeId){K.current.activeId=V;return}const ce=setTimeout(()=>{K.current.activeId=V},50);return()=>clearTimeout(ce)},[V]),{active:M,activeIndex:h,attributes:R,data:k,rect:T,index:S,newIndex:z,items:d,isOver:E,isSorting:H,isDragging:I,listeners:N,node:w,overIndex:m,over:j,setNodeRef:F,setActivatorNodeRef:L,setDroppableNodeRef:$,setDraggableNodeRef:O,transform:ie??U,transition:re()};function re(){if(ie||q&&K.current.newIndex===S)return cae;if(!(G&&!LC(P)||!c)&&(H||X))return Wh.Transition.toString({...c,property:aO})}}function fae(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function s0(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const pae=[ot.Down,ot.Right,ot.Up,ot.Left],mae=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=t;if(pae.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const h=i.get(u.id);if(h)switch(e.code){case ot.Down:r.top<h.top&&l.push(u);break;case ot.Up:r.top>h.top&&l.push(u);break;case ot.Left:r.left>h.left&&l.push(u);break;case ot.Right:r.left<h.left&&l.push(u);break}});const c=Kse({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let d=VP(c,"id");if(d===(a==null?void 0:a.id)&&c.length>1&&(d=c[1].id),d!=null){const u=s.get(n.id),h=s.get(d),f=h?i.get(h.id):null,b=h==null?void 0:h.node.current;if(b&&f&&u&&h){const m=Bv(b).some((C,T)=>o[T]!==C),p=lO(u,h),g=gae(u,h),_=m||!p?{x:0,y:0}:{x:g?r.width-f.width:0,y:g?r.height-f.height:0},S={x:f.left,y:f.top};return _.x&&_.y?S:Hh(S,_)}}}};function lO(e,t){return!s0(e)||!s0(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function gae(e,t){return!s0(e)||!s0(t)||!lO(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const cO=new Set,mr=new WeakMap,nu=new WeakMap,Ga=new WeakMap,Zx=new WeakMap,vae=new WeakMap,ru=new WeakMap,o0=new WeakMap,Vd=new WeakSet;let Uo,jC=0,BC=0;const ws="__aa_tgt",Vh="__aa_del",a0="__aa_new",yae=e=>{const t=Cae(e);t&&t.forEach(n=>kae(n))},_ae=e=>{e.forEach(t=>{t.target===Uo&&xae(),mr.has(t.target)&&pl(t.target)})};function bae(e){const t=Zx.get(e);t==null||t.disconnect();let n=mr.get(e),r=0;const i=5;n||(n=iu(e),mr.set(e,n));const{offsetWidth:s,offsetHeight:a}=Uo,l=[n.top-i,s-(n.left+i+n.width),a-(n.top+i+n.height),n.left-i].map(d=>`${-1*Math.floor(d)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&pl(e)},{root:Uo,threshold:1,rootMargin:l});c.observe(e),Zx.set(e,c)}function pl(e){clearTimeout(o0.get(e));const t=Hv(e),n=qh(t)?500:t.duration;o0.set(e,setTimeout(async()=>{const r=Ga.get(e);try{await(r==null?void 0:r.finished),mr.set(e,iu(e)),bae(e)}catch{}},n))}function xae(){clearTimeout(o0.get(Uo)),o0.set(Uo,setTimeout(()=>{cO.forEach(e=>fO(e,t=>uO(()=>pl(t))))},100))}function wae(e){setTimeout(()=>{vae.set(e,setInterval(()=>uO(pl.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function uO(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let ew,sc;const Sae=typeof window<"u"&&"ResizeObserver"in window;Sae&&(Uo=document.documentElement,ew=new MutationObserver(yae),sc=new ResizeObserver(_ae),window.addEventListener("scroll",()=>{BC=window.scrollY,jC=window.scrollX}),sc.observe(Uo));function Cae(e){return e.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(S_(i.target),!r.has(i.target)){r.add(i.target);for(let s=0;s<i.target.children.length;s++){const a=i.target.children.item(s);if(a){if(Vh in a)return!1;S_(i.target,a),r.add(a)}}}if(i.removedNodes.length)for(let s=0;s<i.removedNodes.length;s++){const a=i.removedNodes[s];if(Vh in a)return!1;a instanceof Element&&(r.add(a),S_(i.target,a),nu.set(a,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function S_(e,t){!t&&!(ws in e)?Object.defineProperty(e,ws,{value:e}):t&&!(ws in t)&&Object.defineProperty(t,ws,{value:e})}function kae(e){var t;const n=e.isConnected,r=mr.has(e);n&&nu.has(e)&&nu.delete(e),Ga.has(e)&&((t=Ga.get(e))===null||t===void 0||t.cancel()),a0 in e?b6(e):r&&n?Tae(e):r&&!n?$ae(e):b6(e)}function Pi(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Eae(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function iu(e){const t=e.getBoundingClientRect(),{x:n,y:r}=Eae(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function dO(e,t,n){let r=t.width,i=t.height,s=n.width,a=n.height;const o=getComputedStyle(e);if(o.getPropertyValue("box-sizing")==="content-box"){const c=Pi(o.paddingTop)+Pi(o.paddingBottom)+Pi(o.borderTopWidth)+Pi(o.borderBottomWidth),d=Pi(o.paddingLeft)+Pi(o.paddingRight)+Pi(o.borderRightWidth)+Pi(o.borderLeftWidth);r-=d,s-=d,i-=c,a-=c}return[r,s,i,a].map(Math.round)}function Hv(e){return ws in e&&ru.has(e[ws])?ru.get(e[ws]):{duration:250,easing:"ease-in-out"}}function hO(e){if(ws in e)return e[ws]}function FC(e){const t=hO(e);return t?Vd.has(t):!1}function fO(e,...t){t.forEach(n=>n(e,ru.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,ru.has(r)))}}function zC(e){return Array.isArray(e)?e:[e]}function qh(e){return typeof e=="function"}function Tae(e){const t=mr.get(e),n=iu(e);if(!FC(e))return mr.set(e,n);let r;if(!t)return;const i=Hv(e);if(typeof i!="function"){const s=t.left-n.left,a=t.top-n.top,[o,l,c,d]=dO(e,t,n),u={transform:`translate(${s}px, ${a}px)`},h={transform:"translate(0, 0)"};o!==l&&(u.width=`${o}px`,h.width=`${l}px`),c!==d&&(u.height=`${c}px`,h.height=`${d}px`),r=e.animate([u,h],{duration:i.duration,easing:i.easing})}else{const[s]=zC(i(e,"remain",t,n));r=new Animation(s),r.play()}Ga.set(e,r),mr.set(e,n),r.addEventListener("finish",pl.bind(null,e))}function b6(e){a0 in e&&delete e[a0];const t=iu(e);mr.set(e,t);const n=Hv(e);if(!FC(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=zC(n(e,"add",t));r=new Animation(i),r.play()}Ga.set(e,r),r.addEventListener("finish",pl.bind(null,e))}function x6(e,t){var n;e.remove(),mr.delete(e),nu.delete(e),Ga.delete(e),(n=Zx.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Vh in e&&delete e[Vh],Object.defineProperty(e,a0,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function $ae(e){var t;if(!nu.has(e)||!mr.has(e))return;const[n,r]=nu.get(e);Object.defineProperty(e,Vh,{value:!0,configurable:!0});const i=window.scrollX,s=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=hO(e))===null||t===void 0||t.appendChild(e),!FC(e))return x6(e);const[a,o,l,c]=Rae(e),d=Hv(e),u=mr.get(e);(i!==jC||s!==BC)&&Mae(e,i,s,d);let h,f={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!qh(d))Object.assign(e.style,f),h=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:d.duration,easing:"ease-out"});else{const[b,y]=zC(d(e,"remove",u));(y==null?void 0:y.styleReset)!==!1&&(f=(y==null?void 0:y.styleReset)||f,Object.assign(e.style,f)),h=new Animation(b),h.play()}Ga.set(e,h),h.addEventListener("finish",x6.bind(null,e,f))}function Mae(e,t,n,r){const i=jC-t,s=BC-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(Uo).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+s),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,d=l.clientWidth;const u=performance.now();function h(){requestAnimationFrame(()=>{if(!qh(r)){const f=c-l.clientHeight,b=d-l.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-f}),c=l.clientHeight,d=l.clientWidth,h()):document.documentElement.style.scrollBehavior=a}})}h()}function Rae(e){const t=mr.get(e),[n,,r]=dO(e,t,iu(e));let i=e.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const s=getComputedStyle(i),a=mr.get(i)||iu(i),o=Math.round(t.top-a.top)-Pi(s.borderTopWidth),l=Math.round(t.left-a.left)-Pi(s.borderLeftWidth);return[o,l,n,r]}function Aae(e,t={}){return ew&&sc&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!qh(t)&&!t.disrespectUserMotionPreference||(Vd.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),fO(e,pl,wae,i=>sc==null?void 0:sc.observe(i)),qh(t)?ru.set(e,t):ru.set(e,{duration:250,easing:"ease-in-out",...t}),ew.observe(e,{childList:!0}),cO.add(e))),Object.freeze({parent:e,enable:()=>{Vd.add(e)},disable:()=>{Vd.delete(e)},isEnabled:()=>Vd.has(e)})}function Lae(e){const[t,n]=x.useState(),r=x.useMemo(()=>e,[]),i=x.useCallback(a=>{a instanceof HTMLElement?n(Aae(a,r)):n(void 0)},[r]),s=x.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return[i,s]}function Dae({id:e,disabled:t,className:n,children:r}){const{attributes:i,listeners:s,setNodeRef:a,transform:o,transition:l}=hae({id:e,disabled:t});i.role="listitem";const c={transform:Wh.Transform.toString(o&&{...o,scaleY:1}),transition:l};return v.jsxs("li",{ref:a,style:c,...i,className:ee("bg-card rounded-lg border px-2 py-3 flex gap-3 relative aria-pressed:z-50 aria-pressed:opacity-85 aria-pressed:shadow-xl",n),children:[v.jsx("div",{...s,title:"Drag to reorder",className:ee("text-muted-foreground my-auto",t?"cursor-not-allowed opacity-50":"cursor-grab hover:text-primary hover:scale-110"),children:v.jsx(oK,{className:"size-6"})}),r]})}function Pae({onDragEnd:e,className:t,children:n,ids:r}){const[i,s]=Lae(),a=Use(l6(NC),l6(PC,{coordinateGetter:mae})),o=l=>{e(l),setTimeout(()=>{s(!0)},1)};return v.jsx(qoe,{sensors:a,collisionDetection:qse,onDragStart:()=>s(!1),onDragCancel:()=>s(!0),onDragEnd:o,children:v.jsx(sae,{items:r,strategy:rae,children:v.jsx("ol",{ref:i,className:t,children:n})})})}const bo=()=>{},lr=bo(),C_=Object,ft=e=>e===lr,Wi=e=>typeof e=="function",Vo=(e,t)=>({...e,...t}),Oae=e=>Wi(e.then),sm=new WeakMap;let Nae=0;const Kh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,s;if(C_(e)===e&&!r&&n!=RegExp){if(i=sm.get(e),i)return i;if(i=++Nae+"~",sm.set(e,i),n==Array){for(i="@",s=0;s<e.length;s++)i+=Kh(e[s])+",";sm.set(e,i)}if(n==C_){i="#";const a=C_.keys(e).sort();for(;!ft(s=a.pop());)ft(e[s])||(i+=s+":"+Kh(e[s])+",");sm.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},_s=new WeakMap,k_={},om={},HC="undefined",Wv=typeof window!=HC,tw=typeof document!=HC,Iae=()=>Wv&&typeof window.requestAnimationFrame!=HC,pO=(e,t)=>{const n=_s.get(e);return[()=>!ft(t)&&e.get(t)||k_,r=>{if(!ft(t)){const i=e.get(t);t in om||(om[t]=i),n[5](t,Vo(i,r),i||k_)}},n[6],()=>!ft(t)&&t in om?om[t]:!ft(t)&&e.get(t)||k_]};let nw=!0;const jae=()=>nw,[rw,iw]=Wv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[bo,bo],Bae=()=>{const e=tw&&document.visibilityState;return ft(e)||e!=="hidden"},Fae=e=>(tw&&document.addEventListener("visibilitychange",e),rw("focus",e),()=>{tw&&document.removeEventListener("visibilitychange",e),iw("focus",e)}),zae=e=>{const t=()=>{nw=!0,e()},n=()=>{nw=!1};return rw("online",t),rw("offline",n),()=>{iw("online",t),iw("offline",n)}},Hae={isOnline:jae,isVisible:Bae},Wae={initFocus:Fae,initReconnect:zae},w6=!Ye.useId,Gh=!Wv||"Deno"in window,Uae=e=>Iae()?window.requestAnimationFrame(e):setTimeout(e,1),E_=Gh?x.useEffect:x.useLayoutEffect,T_=typeof navigator<"u"&&navigator.connection,S6=!Gh&&T_&&(["slow-2g","2g"].includes(T_.effectiveType)||T_.saveData),WC=e=>{if(Wi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Kh(e):"",[e,t]};let Vae=0;const sw=()=>++Vae,mO=0,gO=1,vO=2,qae=3;var yd={__proto__:null,ERROR_REVALIDATE_EVENT:qae,FOCUS_EVENT:mO,MUTATE_EVENT:vO,RECONNECT_EVENT:gO};async function yO(...e){const[t,n,r,i]=e,s=Vo({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let l=s.optimisticData;const c=h=>typeof o=="function"?o(h):o!==!1,d=s.throwOnError;if(Wi(n)){const h=n,f=[],b=t.keys();for(const y of b)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&f.push(y);return Promise.all(f.map(u))}return u(n);async function u(h){const[f]=WC(h);if(!f)return;const[b,y]=pO(t,f),[m,p,g,_]=_s.get(t),S=()=>{const D=m[f];return(Wi(s.revalidate)?s.revalidate(b().data,h):s.revalidate!==!1)&&(delete g[f],delete _[f],D&&D[0])?D[0](vO).then(()=>b().data):b().data};if(e.length<3)return S();let k=r,C;const T=sw();p[f]=[T,0];const w=!ft(l),E=b(),$=E.data,M=E._c,P=ft(M)?$:M;if(w&&(l=Wi(l)?l(P,$):l,y({data:l,_c:P})),Wi(k))try{k=k(P)}catch(D){C=D}if(k&&Oae(k))if(k=await k.catch(D=>{C=D}),T!==p[f][0]){if(C)throw C;return k}else C&&w&&c(C)&&(a=!0,y({data:P,_c:lr}));if(a&&!C)if(Wi(a)){const D=a(k,P);y({data:D,error:lr,_c:lr})}else y({data:k,error:lr,_c:lr});if(p[f][1]=sw(),Promise.resolve(S()).then(()=>{y({_c:lr})}),C){if(d)throw C;return}return k}}const C6=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Kae=(e,t)=>{if(!_s.has(e)){const n=Vo(Wae,t),r={},i=yO.bind(lr,e);let s=bo;const a={},o=(d,u)=>{const h=a[d]||[];return a[d]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},l=(d,u,h)=>{e.set(d,u);const f=a[d];if(f)for(const b of f)b(u,h)},c=()=>{if(!_s.has(e)&&(_s.set(e,[r,{},{},{},i,l,o]),!Gh)){const d=n.initFocus(setTimeout.bind(lr,C6.bind(lr,r,mO))),u=n.initReconnect(setTimeout.bind(lr,C6.bind(lr,r,gO)));s=()=>{d&&d(),u&&u(),_s.delete(e)}}};return c(),[e,i,c,s]}return[e,_s.get(e)[4]]},Gae=(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!ft(s)&&a>s||setTimeout(r,o,i)},Yae=(e,t)=>Kh(e)==Kh(t),[_O,Xae]=Kae(new Map),Qae=Vo({onLoadingSlow:bo,onSuccess:bo,onError:bo,onErrorRetry:Gae,onDiscarded:bo,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:S6?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:S6?5e3:3e3,compare:Yae,isPaused:()=>!1,cache:_O,mutate:Xae,fallback:{}},Hae),Jae=(e,t)=>{const n=Vo(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=Vo(i,a))}return n},Zae=x.createContext({}),ele="$inf$",bO=Wv&&window.__SWR_DEVTOOLS_USE__,tle=bO?window.__SWR_DEVTOOLS_USE__:[],nle=()=>{bO&&(window.__SWR_DEVTOOLS_REACT__=Ye)},rle=e=>Wi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ile=()=>Vo(Qae,x.useContext(Zae)),sle=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=WC(t),[,,,o]=_s.get(_O);if(a.startsWith(ele))return n(...s);const l=o[a];return ft(l)?n(...s):(delete o[a],l)}),r),ole=tle.concat(sle),ale=e=>function(...n){const r=ile(),[i,s,a]=rle(n),o=Jae(r,a);let l=e;const{use:c}=o,d=(c||[]).concat(ole);for(let u=d.length;u--;)l=d[u](l);return l(i,s||o.fetcher||null,o)},lle=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};nle();const k6=Ye.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),$_={dedupe:!0},cle=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:u,keepPreviousData:h}=n,[f,b,y,m]=_s.get(r),[p,g]=WC(e),_=x.useRef(!1),S=x.useRef(!1),k=x.useRef(p),C=x.useRef(t),T=x.useRef(n),w=()=>T.current,E=()=>w().isVisible()&&w().isOnline(),[$,M,P,D]=pO(r,p),R=x.useRef({}).current,O=ft(a)?n.fallback[p]:a,N=(X,ie)=>{for(const re in R){const ce=re;if(ce==="data"){if(!i(X[ce],ie[ce])&&(!ft(X[ce])||!i(J,ie[ce])))return!1}else if(ie[ce]!==X[ce])return!1}return!0},I=x.useMemo(()=>{const X=!p||!t?!1:ft(o)?w().isPaused()||s?!1:ft(l)?!0:l:o,ie=Pe=>{const ge=Vo(Pe);return delete ge._k,X?{isValidating:!0,isLoading:!0,...ge}:ge},re=$(),ce=D(),ye=ie(re),ae=re===ce?ye:ie(ce);let Me=ye;return[()=>{const Pe=ie($());return N(Pe,Me)?(Me.data=Pe.data,Me.isLoading=Pe.isLoading,Me.isValidating=Pe.isValidating,Me.error=Pe.error,Me):(Me=Pe,Pe)},()=>ae]},[r,p]),j=bR.useSyncExternalStore(x.useCallback(X=>P(p,(ie,re)=>{N(re,ie)||X()}),[r,p]),I[0],I[1]),L=!_.current,A=f[p]&&f[p].length>0,F=j.data,H=ft(F)?O:F,B=j.error,G=x.useRef(H),J=h?ft(F)?G.current:F:H,W=A&&!ft(B)?!1:L&&!ft(o)?o:w().isPaused()?!1:s?ft(H)?!1:l:ft(H)||l,U=!!(p&&t&&L&&W),z=ft(j.isValidating)?U:j.isValidating,V=ft(j.isLoading)?U:j.isLoading,K=x.useCallback(async X=>{const ie=C.current;if(!p||!ie||S.current||w().isPaused())return!1;let re,ce,ye=!0;const ae=X||{},Me=!y[p]||!ae.dedupe,Pe=()=>w6?!S.current&&p===k.current&&_.current:p===k.current,ge={isValidating:!1,isLoading:!1},xe=()=>{M(ge)},oe=()=>{const fe=y[p];fe&&fe[1]===ce&&delete y[p]},se={isValidating:!0};ft($().data)&&(se.isLoading=!0);try{if(Me&&(M(se),n.loadingTimeout&&ft($().data)&&setTimeout(()=>{ye&&Pe()&&w().onLoadingSlow(p,n)},n.loadingTimeout),y[p]=[ie(g),sw()]),[re,ce]=y[p],re=await re,Me&&setTimeout(oe,n.dedupingInterval),!y[p]||y[p][1]!==ce)return Me&&Pe()&&w().onDiscarded(p),!1;ge.error=lr;const fe=b[p];if(!ft(fe)&&(ce<=fe[0]||ce<=fe[1]||fe[1]===0))return xe(),Me&&Pe()&&w().onDiscarded(p),!1;const Q=$().data;ge.data=i(Q,re)?Q:re,Me&&Pe()&&w().onSuccess(re,p,n)}catch(fe){oe();const Q=w(),{shouldRetryOnError:ne}=Q;Q.isPaused()||(ge.error=fe,Me&&Pe()&&(Q.onError(fe,p,Q),(ne===!0||Wi(ne)&&ne(fe))&&(!w().revalidateOnFocus||!w().revalidateOnReconnect||E())&&Q.onErrorRetry(fe,p,Q,he=>{const ve=f[p];ve&&ve[0]&&ve[0](yd.ERROR_REVALIDATE_EVENT,he)},{retryCount:(ae.retryCount||0)+1,dedupe:!0})))}return ye=!1,xe(),!0},[p,r]),q=x.useCallback((...X)=>yO(r,k.current,...X),[]);if(E_(()=>{C.current=t,T.current=n,ft(F)||(G.current=F)}),E_(()=>{if(!p)return;const X=K.bind(lr,$_);let ie=0;const ce=lle(p,f,(ye,ae={})=>{if(ye==yd.FOCUS_EVENT){const Me=Date.now();w().revalidateOnFocus&&Me>ie&&E()&&(ie=Me+w().focusThrottleInterval,X())}else if(ye==yd.RECONNECT_EVENT)w().revalidateOnReconnect&&E()&&X();else{if(ye==yd.MUTATE_EVENT)return K();if(ye==yd.ERROR_REVALIDATE_EVENT)return K(ae)}});return S.current=!1,k.current=p,_.current=!0,M({_k:g}),W&&(ft(H)||Gh?X():Uae(X)),()=>{S.current=!0,ce()}},[p]),E_(()=>{let X;function ie(){const ce=Wi(c)?c($().data):c;ce&&X!==-1&&(X=setTimeout(re,ce))}function re(){!$().error&&(d||w().isVisible())&&(u||w().isOnline())?K($_).then(ie):ie()}return ie(),()=>{X&&(clearTimeout(X),X=-1)}},[c,d,u,p]),x.useDebugValue(J),s&&ft(H)&&p){if(!w6&&Gh)throw new Error("Fallback data is required when using suspense in SSR.");C.current=t,T.current=n,S.current=!1;const X=m[p];if(!ft(X)){const ie=q(X);k6(ie)}if(ft(B)){const ie=K($_);ft(J)||(ie.status="fulfilled",ie.value=!0),k6(ie)}else throw B}return{mutate:q,get data(){return R.data=!0,J},get error(){return R.error=!0,B},get isValidating(){return R.isValidating=!0,z},get isLoading(){return R.isLoading=!0,V}}},Uv=ale(cle),ule="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let dle=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=ule[n[e]&63];return t};function hle(){var T,w;const[e,t]=x.useState(!1),[n,r]=x.useState(),i=sL(),{hasPerm:s}=ii(),[a,o]=x.useState(!1),[l,c]=x.useState(null),[d,u]=x.useState(!1),h=Wt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),f=Wt({method:"POST",path:"/settings/banTemplates",throwGenericErrors:!0}),b=Uv("/settings/banTemplates",async()=>{const E=await h({});if(!E)throw new Error("No data returned");return E},{isPaused:()=>a||!!l||e}),y=async E=>{o(!0),c(null),u(!1);try{const $=await b.mutate(E,!1);if(!await f({data:$}))throw new Error("No data returned");u(!0)}catch($){$ instanceof Ux||$ instanceof Error?c($.message):c(JSON.stringify($))}finally{o(!1)}};x.useEffect(()=>{if(!d)return;const E=setTimeout(()=>{u(!1)},5e3);return()=>clearTimeout(E)},[d]);const m=E=>{const{active:$,over:M}=E;M&&$.id!==M.id&&y(P=>{const D=P.findIndex(O=>O.id===$.id),R=P.findIndex(O=>O.id===M.id);return IC(P,D,R)})},p=({id:E,reason:$,duration:M})=>{console.log("Save item",E,$,M),y(E?P=>P.map(D=>D.id===E?{id:E,reason:$,duration:M}:D):P=>[...P,{id:dle(21),reason:$,duration:M}]),t(!1),r(void 0)},g=E=>{if(!E||!b.data)return;const $=b.data.find(M=>M.id===E);$&&i({title:"Remove Template",actionLabel:"Remove",confirmBtnVariant:"destructive",message:v.jsxs(v.Fragment,{children:["Are you sure you want to remove this ban template? ",v.jsx("br",{}),v.jsx("blockquote",{className:"opacity-70 italic border-l-4 pl-2",children:$.reason})]}),onConfirm:()=>{console.log("Remove confirmed",E),y(M=>M.filter(P=>P.id!==E))}})},_=E=>{!E||!b.data||(console.log("Edit item",E),r(b.data.find($=>$.id===E)),t(!0))},S=()=>{r(void 0),t(!0)};let k;if(b.error){const E=()=>b.mutate(),$=((T=b==null?void 0:b.error)==null?void 0:T.message)??"unknown error";k=v.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[v.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",$]}),v.jsx("br",{}),v.jsx("button",{className:"underline hover:text-accent",onClick:E,children:"Try again?"})]})}else if(a)k=v.jsx("span",{className:"text-success-inlinex animate-pulse",children:"Saving..."});else if(l){const E=()=>{b.data&&y(()=>b.data)},$=l??"unknown error";k=v.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[v.jsxs("span",{className:"text-destructive-inline",children:["Error saving: ",$]}),v.jsx("br",{}),v.jsx("button",{className:"underline hover:text-accent",onClick:E,children:"Try again?"})]})}else d?k=v.jsx("span",{className:"text-success-inline",children:"Saved."}):(b.isLoading||b.isValidating)&&(k=v.jsx("span",{className:"text-muted-foreground",children:"Loading..."}));const C=s("settings.write");return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[v.jsxs("div",{className:"px-2 md:px-0",children:[v.jsx("h1",{className:"text-3xl mb-2",children:"Ban Templates"}),v.jsxs("p",{children:["Here you can configure ban reasons and durations that will appear as dropdown options when banning a player. ",v.jsx("br",{}),"This is useful for common reasons that happen frequently, like violation of your server rules. ",v.jsx("br",{}),C?v.jsxs("span",{className:"text-muted-foreground italic",children:["TIP: You can also drag and drop to reorder the list. ",v.jsx("br",{})]}):v.jsxs("span",{className:"text-warning-inline",children:["You need the ",v.jsx(zn,{className:"text-warning-inline",children:"Settings: Change"})," permission to edit these reasons."]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[v.jsxs("span",{className:"shrink-0",children:["Configured reasons: ",((w=b.data)==null?void 0:w.length)??0]}),k]}),!b.data&&!l&&v.jsxs("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:[v.jsx(dn,{className:"inline animate-spin h-8"}),"Loading..."]}),b.data&&v.jsxs(Pae,{className:"space-y-2 border p-2 rounded-lg",ids:b.data.map(E=>E.id),onDragEnd:m,children:[b.data.length?b.data.map(E=>v.jsx(Dae,{id:E.id,disabled:!C,children:v.jsx($se,{onEdit:_,onRemove:g,disabled:!C,...E})},E.id)):v.jsx("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:"No reasons configured yet."}),v.jsx(Mse,{onClick:S,disabled:!C})]})]})]}),v.jsx(Tse,{reasonData:n,onSave:p,isDialogOpen:e,setIsDialogOpen:t},n==null?void 0:n.id)]})}const _d=150;function E6({pageName:e}){const[t,n]=x.useState(!0),[r,i]=x.useState(""),[s,a]=x.useState(!1),o=dv(),l=Wt({method:"GET",path:`/systemLog/${e}`,throwGenericErrors:!0}),c=x.useRef(null),d=x.useRef(null),u=x.useMemo(()=>new kA.Terminal(rD),[]),h=x.useMemo(()=>new RA.FitAddon,[]),f=x.useMemo(()=>new LA.SearchAddon,[]),b=(k,C)=>{sl(C)},y=x.useMemo(()=>new PA.WebLinksAddon(b),[]),m=Fn(_d,k=>{window.postMessage({type:"liveConsoleSearchHotkey",action:k})},{noTrailing:!0}),p=()=>{if(!d.current||!u.element||!h){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const k=h.proposeDimensions();k?u.resize(k.cols,k.rows):console.log("refitTerminal: no proposed dimensions")};wi("resize",bS(100,p)),x.useEffect(()=>{if(d.current&&c.current&&!u.element){console.log("xterm init"),d.current.innerHTML="",u.loadAddon(h),u.loadAddon(f),u.loadAddon(y),u.loadAddon(new $A.CanvasAddon),u.loadAddon(new nD(c.current,d.current)),u.open(d.current),u.write("\x1B[?25l"),p();const k=Fn(_d,()=>{u.scrollLines(Math.min(1,2-u.rows))},{noTrailing:!0}),C=Fn(_d,()=>{u.scrollLines(Math.max(1,u.rows-2))},{noTrailing:!0}),T=Fn(_d,()=>{u.scrollToTop()},{noTrailing:!0}),w=Fn(_d,()=>{u.scrollToBottom()},{noTrailing:!0});u.attachCustomKeyEventHandler(E=>E.code==="F5"||E.code==="Escape"||E.code==="KeyF"&&(E.ctrlKey||E.metaKey)||E.code==="F3"?!1:E.code==="KeyC"&&(E.ctrlKey||E.metaKey)?(document.execCommand("copy"),u.clearSelection(),!1):E.code==="PageUp"?(k(),!1):E.code==="PageDown"?(C(),!1):E.code==="Home"?(T(),!1):E.code==="End"?(w(),!1):!kS(E)),l({success:(E,$)=>{n(!1),g(E.data),u.writeln(""),u.writeln("\x1B[33m[END OF LOG - REFRESH THE PAGE TO LOAD MORE]\x1B")},error:(E,$)=>{n(!1),i(E)}})}},[u]),wi("keydown",k=>{k.code==="F5"?t&&(o(),k.preventDefault()):k.code==="Escape"?(f.clearDecorations(),a(!1)):k.code==="KeyF"&&(k.ctrlKey||k.metaKey)?(s?m("focus"):a(!0),k.preventDefault()):k.code==="F3"&&(m(k.shiftKey?"previous":"next"),k.preventDefault())});const g=k=>{const C=k.split(/\r?\n/);C.length&&!C[C.length-1]&&C.pop();for(const T of C)u.writeln(T)};let _="Console Log",S="Output of txAdmin to it's parent terminal, including usually hidden debug messages.";return e==="action"&&(_="Action Log",S="Log of all actions taken by txAdmin or any admin."),v.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[v.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("polyline",{points:"4 17 10 11 4 5"}),v.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),v.jsxs("p",{className:"font-mono text-sm",children:[_," - ",v.jsx("span",{className:"text-muted-foreground",children:S})]})]})}),v.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[t&&!r?v.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:v.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[v.jsx(dn,{className:"w-16 h-16 animate-spin"}),v.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Loading..."})]})}):null,r&&v.jsxs("div",{className:"absolute inset-0 z-20 bg-black/60 flex flex-col gap-4 items-center justify-center",children:[v.jsxs("h2",{className:"text-2xl tracking-wider font-light text-muted-foreground select-none",children:["Error fetching ",_,":"]}),v.jsx("p",{className:"mx-8 max-w-screen-md text-destructive-inline font-mono",children:r})]}),v.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),v.jsx(tD,{show:s,setShow:a,searchAddon:f}),v.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{u.scrollToBottom()},children:v.jsx(NA,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]})]})}const Vv=x.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{className:ee("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30",e),ref:n,...t}));Vv.displayName="Textarea";const fle=bP,xO=x.forwardRef(({children:e},t)=>v.jsx(Av,{ref:t,asChild:!0,children:e}));xO.displayName=Av.displayName;const wO=x.forwardRef(({className:e,...t},n)=>v.jsx(Pv,{ref:n,className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(OA,{className:"h-4 w-4"})}));wO.displayName=Pv.displayName;const SO=x.forwardRef(({className:e,...t},n)=>v.jsx(Ov,{ref:n,className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(ku,{className:"h-4 w-4"})}));SO.displayName=Ov.displayName;const CO=x.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(xP,{children:v.jsxs(Lv,{ref:i,className:ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[v.jsx(wO,{}),v.jsx(wP,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(SO,{})]})}));CO.displayName=Lv.displayName;const ow=x.forwardRef(({className:e,children:t,...n},r)=>v.jsx(Dv,{ref:r,className:ee("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:v.jsx(CP,{children:t})}));ow.displayName=Dv.displayName;const T6=150,$6="!add-new",ple=["permanent","2 hours","8 hours","1 day","2 days","1 week","2 weeks"],kO=x.forwardRef(function({banTemplates:t,disabled:n,onNavigateAway:r},i){const s=x.useRef(null),a=x.useRef(null),o=bu()[1],[l,c]=x.useState("2 days"),[d,u]=x.useState("days"),h=BS();x.useImperativeHandle(i,()=>({getData:()=>{var m,p;return{reason:(m=s.current)==null?void 0:m.value.trim(),duration:l==="custom"?`${(p=a.current)==null?void 0:p.value} ${d}`:l}},clearData:()=>{!s.current||!a.current||(s.current.value="",a.current.value="",c("2 days"),u("days"))},focusReason:()=>{var m;(m=s.current)==null||m.focus()}}),[s,a,l,d]);const f=m=>{if(m===$6)o("/settings/ban-templates"),r==null||r();else{if(!t)return;const p=t.find(_=>_.id===m);if(!p)return;const g=Lg(p.duration);ple.includes(g)?c(g):typeof p.duration=="object"&&(c("custom"),a.current.value=p.duration.value.toString(),u(p.duration.unit)),s.current.value=p.reason,setTimeout(()=>{s.current.focus()},50)}},b=x.useMemo(()=>{if(t)return t.map((m,p)=>{const g=xV(m.duration),_=m.reason.length>T6?m.reason.slice(0,T6-3)+"...":m.reason;return v.jsxs(ow,{value:m.id,className:"focus:bg-secondary focus:text-secondary-foreground",children:[v.jsx("span",{className:"inline-block pr-1 font-mono opacity-75 min-w-[4ch]",children:g})," ",_]},p)})},[t]);let y;return Array.isArray(t)?t.length?y=v.jsxs(v.Fragment,{children:[b,v.jsxs(ow,{value:$6,className:"font-bold text-warning-inline",children:["Add Ban Template",v.jsx(jo,{className:"inline mr-1 h-4"})]})]}):y=v.jsxs("div",{className:"text-warning-inline text-center p-4",children:["You do not have any template configured. ",v.jsx("br",{}),v.jsxs(No,{href:"/settings/ban-templates",className:"cursor-pointer underline hover:text-accent",onClick:()=>{h()},children:["Add Ban Template",v.jsx(jo,{className:"inline mr-1 h-4"})]})]}):y=v.jsx("div",{className:"text-secondary-foreground text-center p-4",children:v.jsx(dn,{className:"inline animate-spin size-6"})}),v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Jn,{htmlFor:"banReason",children:"Reason"}),v.jsxs("div",{className:"flex gap-1",children:[v.jsx(sn,{id:"banReason",ref:s,placeholder:"The reason for the ban, rule violated, etc.",className:"w-full",disabled:n,autoFocus:!0}),v.jsxs(fle,{onValueChange:f,disabled:n,children:[v.jsx(xO,{className:"tracking-wide",children:v.jsxs("button",{className:ee("relative","size-10 inline-flex justify-center items-center rounded-md shrink-0","ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","border bg-black/20 shadow-sm","hover:bg-primary hover:text-primary-foreground hover:border-primary","disabled:opacity-50 disabled:cursor-not-allowed"),children:[v.jsx(Qq,{className:"size-5"}),v.jsx(aP,{featName:"banTemplates",durationDays:7,children:v.jsx("div",{className:"absolute rounded-full size-2 -top-1 -right-1 bg-accent"})})]})}),v.jsx(CO,{className:"tracking-wide w-[calc(100vw-1rem)] sm:max-w-screen-sm",align:"end",children:y})]})]})]}),v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Jn,{htmlFor:"durationSelect",children:"Duration"}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs(Ho,{onValueChange:c,value:l,disabled:n,children:[v.jsx(Ns,{id:"durationSelect",className:"tracking-wide",children:v.jsx(Wo,{placeholder:"Select Duration"})}),v.jsxs(Is,{className:"tracking-wide",children:[v.jsx(Qe,{value:"custom",className:"font-bold",children:"Custom (set below)"}),v.jsx(Qe,{value:"2 hours",children:"2 HOURS"}),v.jsx(Qe,{value:"8 hours",children:"8 HOURS"}),v.jsx(Qe,{value:"1 day",children:"1 DAY"}),v.jsx(Qe,{value:"2 days",children:"2 DAYS"}),v.jsx(Qe,{value:"1 week",children:"1 WEEK"}),v.jsx(Qe,{value:"2 weeks",children:"2 WEEKS"}),v.jsx(Qe,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),v.jsxs("div",{className:"flex flex-row gap-2",children:[v.jsx(sn,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:l!=="custom"||n,ref:a}),v.jsxs(Ho,{onValueChange:u,value:d,children:[v.jsx(Ns,{className:"tracking-wide",id:"durationUnits",disabled:l!=="custom"||n,children:v.jsx(Wo,{})}),v.jsxs(Is,{className:"tracking-wide",children:[v.jsx(Qe,{value:"hours",children:"HOURS"}),v.jsx(Qe,{value:"days",children:"DAYS"}),v.jsx(Qe,{value:"weeks",children:"WEEKS"}),v.jsx(Qe,{value:"months",children:"MONTHS"})]})]})]})]})]})]})});function mle(){const e=x.useRef(null),t=x.useRef(null),[n,r]=x.useState(!1),{hasPerm:i}=ii(),s=Wt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),a=Wt({method:"POST",path:"/history/addLegacyBan",throwGenericErrors:!0}),o=()=>{if(!e.current||!t.current)return;const{reason:d,duration:u}=t.current.getData();if(!d||d.length<3){tn.warning("The reason must be at least 3 characters long."),t.current.focusReason();return}const h=e.current.value;if(!h){tn.warning("You must enter at least one identifier."),e.current.focus();return}const f=h.toLowerCase().split(/[,;\s\n]+/g).map(b=>b.trim()).filter(Boolean);if(!f.length){tn.warning("You must enter at least one valid identifier."),e.current.focus();return}r(!0),a({data:{identifiers:f,reason:d,duration:u},toastLoadingMessage:"Banning identifiers...",genericHandler:{successMsg:"Identifiers banned."},success:b=>{r(!1),e.current.value="",e.current.focus()},error:b=>{r(!1),e.current.focus()}})},l=Uv("/settings/banTemplates",async()=>{const d=await s({});if(!d)throw new Error("No data returned");return d}),c=i("players.ban");return v.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto px-2 md:px-0",children:[v.jsxs("div",{className:"px-2 md:px-0",children:[v.jsx("h1",{className:"text-3xl mb-2",children:"Ban Identifiers"}),v.jsxs("p",{children:["Here you can ban specific player identifiers (like ",v.jsx(zn,{children:"license"})," and ",v.jsx(zn,{children:"discord"}),") without having to search for a registered player.",v.jsx("br",{}),"Bans without a single ",v.jsx(zn,{children:"license"})," identifier are considered ",v.jsx("em",{children:"Legacy Bans"})," and should be avoided if possible. ",v.jsx("br",{}),c?null:v.jsxs("span",{className:"text-warning-inline",children:["You need the ",v.jsx(zn,{className:"text-warning-inline",children:"Player: Ban"})," permission to use this feature."]})]})]}),v.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 border bg-card p-4 rounded-lg",children:[v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Jn,{htmlFor:"banIdentifiers",children:"Identifiers"}),v.jsx(Vv,{ref:e,className:"h-full",disabled:n||!c,placeholder:"discord:xxxx, fivem:xxxx, license:xxxx, steam:xxxx, etc..."})]}),v.jsx(kO,{ref:t,banTemplates:l.data,disabled:n||!c})]}),v.jsxs("div",{className:"flex place-content-center gap-4",children:[v.jsx(Ve,{size:"sm",variant:"outline",disabled:n||!c,onClick:()=>{var d;(d=t.current)==null||d.clearData()},children:"Clear"}),v.jsx(Ve,{size:"sm",variant:"destructive",disabled:n||!c,onClick:o,children:n?v.jsxs("span",{className:"flex items-center leading-relaxed",children:[v.jsx(dn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})]})]})}var EO={exports:{}},gle="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",vle=gle,yle=vle;function TO(){}function $O(){}$O.resetWarningCache=TO;var _le=function(){function e(r,i,s,a,o,l){if(l!==yle){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:$O,resetWarningCache:TO};return n.PropTypes=n,n};EO.exports=_le();var ble=EO.exports;const Z=vn(ble);var xle=Object.defineProperty,wle=(e,t)=>{for(var n in t)xle(e,n,{get:t[n],enumerable:!0})},Ei={};wle(Ei,{assign:()=>kle,colors:()=>Do,createStringInterpolator:()=>XC,skipAnimation:()=>OO,to:()=>PO,willAdvance:()=>QC});var UC=tp(),je=e=>ep(e,UC),VC=tp();je.write=e=>ep(e,VC);var qv=tp();je.onStart=e=>ep(e,qv);var qC=tp();je.onFrame=e=>ep(e,qC);var KC=tp();je.onFinish=e=>ep(e,KC);var xc=[];je.setTimeout=(e,t)=>{const n=je.now()+t,r=()=>{const s=xc.findIndex(a=>a.cancel==r);~s&&xc.splice(s,1),wo-=~s?1:0},i={time:n,handler:e,cancel:r};return xc.splice(MO(n),0,i),wo+=1,RO(),i};var MO=e=>~(~xc.findIndex(t=>t.time>e)||~xc.length);je.cancel=e=>{qv.delete(e),qC.delete(e),KC.delete(e),UC.delete(e),VC.delete(e)};je.sync=e=>{aw=!0,je.batchedUpdates(e),aw=!1};je.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,je.onStart(n)}return r.handler=e,r.cancel=()=>{qv.delete(n),t=null},r};var GC=typeof window<"u"?window.requestAnimationFrame:()=>{};je.use=e=>GC=e;je.now=typeof performance<"u"?()=>performance.now():Date.now;je.batchedUpdates=e=>e();je.catch=console.error;je.frameLoop="always";je.advance=()=>{je.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):LO()};var xo=-1,wo=0,aw=!1;function ep(e,t){aw?(t.delete(e),e(0)):(t.add(e),RO())}function RO(){xo<0&&(xo=0,je.frameLoop!=="demand"&&GC(AO))}function Sle(){xo=-1}function AO(){~xo&&(GC(AO),je.batchedUpdates(LO))}function LO(){const e=xo;xo=je.now();const t=MO(xo);if(t&&(DO(xc.splice(0,t),n=>n.handler()),wo-=t),!wo){Sle();return}qv.flush(),UC.flush(e?Math.min(64,xo-e):16.667),qC.flush(),VC.flush(),KC.flush()}function tp(){let e=new Set,t=e;return{add(n){wo+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return wo-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,wo-=t.size,DO(t,r=>r(n)&&e.add(r)),wo+=e.size,t=e)}}}function DO(e,t){e.forEach(n=>{try{t(n)}catch(r){je.catch(r)}})}function lw(){}var Cle=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),le={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function gs(e,t){if(le.arr(e)){if(!le.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var Ne=(e,t)=>e.forEach(t);function Zi(e,t,n){if(le.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var Xn=e=>le.und(e)?[]:le.arr(e)?e:[e];function hh(e,t){if(e.size){const n=Array.from(e);e.clear(),Ne(n,t)}}var qd=(e,...t)=>hh(e,n=>n(...t)),YC=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),XC,PO,Do=null,OO=!1,QC=lw,kle=e=>{e.to&&(PO=e.to),e.now&&(je.now=e.now),e.colors!==void 0&&(Do=e.colors),e.skipAnimation!=null&&(OO=e.skipAnimation),e.createStringInterpolator&&(XC=e.createStringInterpolator),e.requestAnimationFrame&&je.use(e.requestAnimationFrame),e.batchedUpdates&&(je.batchedUpdates=e.batchedUpdates),e.willAdvance&&(QC=e.willAdvance),e.frameLoop&&(je.frameLoop=e.frameLoop)},fh=new Set,Vr=[],M_=[],l0=0,Kv={get idle(){return!fh.size&&!Vr.length},start(e){l0>e.priority?(fh.add(e),je.onStart(Ele)):(NO(e),je(cw))},advance:cw,sort(e){if(l0)je.onFrame(()=>Kv.sort(e));else{const t=Vr.indexOf(e);~t&&(Vr.splice(t,1),IO(e))}},clear(){Vr=[],fh.clear()}};function Ele(){fh.forEach(NO),fh.clear(),je(cw)}function NO(e){Vr.includes(e)||IO(e)}function IO(e){Vr.splice(Tle(Vr,t=>t.priority>e.priority),0,e)}function cw(e){const t=M_;for(let n=0;n<Vr.length;n++){const r=Vr[n];l0=r.priority,r.idle||(QC(r),r.advance(e),r.idle||t.push(r))}return l0=0,M_=Vr,M_.length=0,Vr=t,Vr.length>0}function Tle(e,t){const n=e.findIndex(t);return n<0?e.length:n}var $le=(e,t,n)=>Math.min(Math.max(n,e),t),Mle={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},gi="[-+]?\\d*\\.?\\d+",c0=gi+"%";function Gv(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Rle=new RegExp("rgb"+Gv(gi,gi,gi)),Ale=new RegExp("rgba"+Gv(gi,gi,gi,gi)),Lle=new RegExp("hsl"+Gv(gi,c0,c0)),Dle=new RegExp("hsla"+Gv(gi,c0,c0,gi)),Ple=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ole=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Nle=/^#([0-9a-fA-F]{6})$/,Ile=/^#([0-9a-fA-F]{8})$/;function jle(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Nle.exec(e))?parseInt(t[1]+"ff",16)>>>0:Do&&Do[e]!==void 0?Do[e]:(t=Rle.exec(e))?(jl(t[1])<<24|jl(t[2])<<16|jl(t[3])<<8|255)>>>0:(t=Ale.exec(e))?(jl(t[1])<<24|jl(t[2])<<16|jl(t[3])<<8|A6(t[4]))>>>0:(t=Ple.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ile.exec(e))?parseInt(t[1],16)>>>0:(t=Ole.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Lle.exec(e))?(M6(R6(t[1]),am(t[2]),am(t[3]))|255)>>>0:(t=Dle.exec(e))?(M6(R6(t[1]),am(t[2]),am(t[3]))|A6(t[4]))>>>0:null}function R_(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function M6(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=R_(i,r,e+1/3),a=R_(i,r,e),o=R_(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function jl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function R6(e){return(parseFloat(e)%360+360)%360/360}function A6(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function am(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function L6(e){let t=jle(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${r}, ${i}, ${s})`}var Yh=(e,t,n)=>{if(le.fun(e))return e;if(le.arr(e))return Yh({range:e,output:t,extrapolate:n});if(le.str(e.output[0]))return XC(e);const r=e,i=r.output,s=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",o=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(c=>c);return c=>{const d=Fle(c,s);return Ble(c,s[d],s[d+1],i[d],i[d+1],l,a,o,r.map)}};function Ble(e,t,n,r,i,s,a,o,l){let c=l?l(e):e;if(c<t){if(a==="identity")return c;a==="clamp"&&(c=t)}if(c>n){if(o==="identity")return c;o==="clamp"&&(c=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=s(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function Fle(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var zle=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return $le(0,1,i/e)},u0=1.70158,lm=u0*1.525,D6=u0+1,P6=2*Math.PI/3,O6=2*Math.PI/4.5,cm=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Hle={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>D6*e*e*e-u0*e*e,easeOutBack:e=>1+D6*Math.pow(e-1,3)+u0*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((lm+1)*2*e-lm)/2:(Math.pow(2*e-2,2)*((lm+1)*(e*2-2)+lm)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*P6),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*P6)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*O6))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*O6)/2+1,easeInBounce:e=>1-cm(1-e),easeOutBounce:cm,easeInOutBounce:e=>e<.5?(1-cm(1-2*e))/2:(1+cm(2*e-1))/2,steps:zle},Xh=Symbol.for("FluidValue.get"),su=Symbol.for("FluidValue.observers"),Wr=e=>!!(e&&e[Xh]),sr=e=>e&&e[Xh]?e[Xh]():e,N6=e=>e[su]||null;function Wle(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Qh(e,t){const n=e[su];n&&n.forEach(r=>{Wle(r,t)})}var jO=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ule(this,e)}},Ule=(e,t)=>BO(e,Xh,t);function zu(e,t){if(e[Xh]){let n=e[su];n||BO(e,su,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Jh(e,t){const n=e[su];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[su]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var BO=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Gm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vle=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,I6=new RegExp(`(${Gm.source})(%|[a-z]+)`,"i"),qle=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Yv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,FO=e=>{const[t,n]=Kle(e);if(!t||YC())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(n);return i||e}else{if(n&&Yv.test(n))return FO(n);if(n)return n}return e},Kle=e=>{const t=Yv.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},A_,Gle=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,zO=e=>{A_||(A_=Do?new RegExp(`(${Object.keys(Do).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>sr(s).replace(Yv,FO).replace(Vle,L6).replace(A_,L6)),n=t.map(s=>s.match(Gm).map(Number)),i=n[0].map((s,a)=>n.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>Yh({...e,output:s}));return s=>{var l;const a=!I6.test(t[0])&&((l=t.find(c=>I6.test(c)))==null?void 0:l.replace(Gm,""));let o=0;return t[0].replace(Gm,()=>`${i[o++](s)}${a||""}`).replace(qle,Gle)}},JC="react-spring: ",HO=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${JC}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Yle=HO(console.warn);function Xle(){Yle(`${JC}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Qle=HO(console.warn);function Jle(){Qle(`${JC}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Xv(e){return le.str(e)&&(e[0]=="#"||/\d/.test(e)||!YC()&&Yv.test(e)||e in(Do||{}))}var va=YC()?x.useEffect:x.useLayoutEffect,Zle=()=>{const e=x.useRef(!1);return va(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function ZC(){const e=x.useState()[1],t=Zle();return()=>{t.current&&e(Math.random())}}function ece(e,t){const[n]=x.useState(()=>({inputs:t,result:e()})),r=x.useRef(),i=r.current;let s=i;return s?t&&s.inputs&&tce(t,s.inputs)||(s={inputs:t,result:e()}):s=n,x.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function tce(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}var e5=e=>x.useEffect(e,nce),nce=[];function uw(e){const t=x.useRef();return x.useEffect(()=>{t.current=e}),t.current}var Zh=Symbol.for("Animated:node"),rce=e=>!!e&&e[Zh]===e,Oi=e=>e&&e[Zh],t5=(e,t)=>Cle(e,Zh,t),Qv=e=>e&&e[Zh]&&e[Zh].getPayload(),WO=class{constructor(){t5(this,this)}getPayload(){return this.payload||[]}},np=class extends WO{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,le.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new np(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return le.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,le.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},ef=class extends np{constructor(e){super(0),this._string=null,this._toString=Yh({output:[e,e]})}static create(e){return new ef(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(le.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Yh({output:[this.getValue(),e]})),this._value=0,super.reset()}},d0={dependencies:null},Jv=class extends WO{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Zi(this.source,(n,r)=>{rce(n)?t[r]=n.getValue(e):Wr(n)?t[r]=sr(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ne(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Zi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){d0.dependencies&&Wr(e)&&d0.dependencies.add(e);const t=Qv(e);t&&Ne(t,n=>this.add(n))}},UO=class extends Jv{constructor(e){super(e)}static create(e){return new UO(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(ice)),!0)}};function ice(e){return(Xv(e)?ef:np).create(e)}function dw(e){const t=Oi(e);return t?t.constructor:le.arr(e)?UO:Xv(e)?ef:np}var j6=(e,t)=>{const n=!le.fun(e)||e.prototype&&e.prototype.isReactComponent;return x.forwardRef((r,i)=>{const s=x.useRef(null),a=n&&x.useCallback(b=>{s.current=ace(i,b)},[i]),[o,l]=oce(r,t),c=ZC(),d=()=>{const b=s.current;if(n&&!b)return;(b?t.applyAnimatedValues(b,o.getValue(!0)):!1)===!1&&c()},u=new sce(d,l),h=x.useRef();va(()=>(h.current=u,Ne(l,b=>zu(b,u)),()=>{h.current&&(Ne(h.current.deps,b=>Jh(b,h.current)),je.cancel(h.current.update))})),x.useEffect(d,[]),e5(()=>()=>{const b=h.current;Ne(b.deps,y=>Jh(y,b))});const f=t.getComponentProps(o.getValue());return x.createElement(e,{...f,ref:a})})},sce=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&je.write(this.update)}};function oce(e,t){const n=new Set;return d0.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Jv(e),d0.dependencies=null,[e,n]}function ace(e,t){return e&&(le.fun(e)?e(t):e.current=t),t}var B6=Symbol.for("AnimatedComponent"),lce=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new Jv(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=a=>{const o=F6(a)||"Anonymous";return le.str(a)?a=s[a]||(s[a]=j6(a,i)):a=a[B6]||(a[B6]=j6(a,i)),a.displayName=`Animated(${o})`,a};return Zi(e,(a,o)=>{le.arr(e)&&(o=F6(a)),s[o]=s(a)}),{animated:s}},F6=e=>le.str(e)?e:e&&le.str(e.displayName)?e.displayName:le.fun(e)&&e.name||null;function or(e,...t){return le.fun(e)?e(...t):e}var ph=(e,t)=>e===!0||!!(t&&e&&(le.fun(e)?e(t):Xn(e).includes(t))),VO=(e,t)=>le.obj(e)?t&&e[t]:e,qO=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,cce=e=>e,Zv=(e,t=cce)=>{let n=uce;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const s=t(e[i],i);le.und(s)||(r[i]=s)}return r},uce=["config","onProps","onStart","onChange","onPause","onResume","onRest"],dce={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function hce(e){const t={};let n=0;if(Zi(e,(r,i)=>{dce[i]||(t[i]=r,n++)}),n)return t}function n5(e){const t=hce(e);if(t){const n={to:t};return Zi(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function tf(e){return e=sr(e),le.arr(e)?e.map(tf):Xv(e)?Ei.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function KO(e){for(const t in e)return!0;return!1}function hw(e){return le.fun(e)||le.arr(e)&&le.obj(e[0])}function fw(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function GO(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var r5={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},pw={...r5.default,mass:1,damping:1,easing:Hle.linear,clamp:!1},fce=class{constructor(){this.velocity=0,Object.assign(this,pw)}};function pce(e,t,n){n&&(n={...n},z6(n,t),t={...n,...t}),z6(e,t),Object.assign(e,t);for(const a in pw)e[a]==null&&(e[a]=pw[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;return le.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r),e}function z6(e,t){if(!le.und(t.decay))e.duration=void 0;else{const n=!le.und(t.tension)||!le.und(t.friction);(n||!le.und(t.frequency)||!le.und(t.damping)||!le.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var H6=[],mce=class{constructor(){this.changed=!1,this.values=H6,this.toValues=null,this.fromValues=H6,this.config=new fce,this.immediate=!1}};function YO(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((a,o)=>{let l,c,d=ph(n.cancel??(r==null?void 0:r.cancel),t);if(d)f();else{le.und(n.pause)||(i.paused=ph(n.pause,t));let b=r==null?void 0:r.pause;b!==!0&&(b=i.paused||ph(b,t)),l=or(n.delay||0,t),b?(i.resumeQueue.add(h),s.pause()):(s.resume(),h())}function u(){i.resumeQueue.add(h),i.timeouts.delete(c),c.cancel(),l=c.time-je.now()}function h(){l>0&&!Ei.skipAnimation?(i.delayed=!0,c=je.setTimeout(f,l),i.pauseQueue.add(u),i.timeouts.add(c)):f()}function f(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(u),i.timeouts.delete(c),e<=(i.cancelId||0)&&(d=!0);try{s.start({...n,callId:e,cancel:d},a)}catch(b){o(b)}}})}var i5=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?wc(e.get()):t.every(n=>n.noop)?XO(e.get()):fi(e.get(),t.every(n=>n.finished)),XO=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),fi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),wc=e=>({value:e,cancelled:!0,finished:!1});function QO(e,t,n,r){const{callId:i,parentId:s,onRest:a}=t,{asyncTo:o,promise:l}=n;return!s&&e===o&&!t.reset?l:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=Zv(t,(m,p)=>p==="onRest"?void 0:m);let d,u;const h=new Promise((m,p)=>(d=m,u=p)),f=m=>{const p=i<=(n.cancelId||0)&&wc(r)||i!==n.asyncId&&fi(r,!1);if(p)throw m.result=p,u(m),m},b=(m,p)=>{const g=new W6,_=new U6;return(async()=>{if(Ei.skipAnimation)throw nf(n),_.result=fi(r,!1),u(_),_;f(g);const S=le.obj(m)?{...m}:{...p,to:m};S.parentId=i,Zi(c,(C,T)=>{le.und(S[T])&&(S[T]=C)});const k=await r.start(S);return f(g),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),k})()};let y;if(Ei.skipAnimation)return nf(n),fi(r,!1);try{let m;le.arr(e)?m=(async p=>{for(const g of p)await b(g)})(e):m=Promise.resolve(e(b,r.stop.bind(r))),await Promise.all([m.then(d),h]),y=fi(r.get(),!0,!1)}catch(m){if(m instanceof W6)y=m.result;else if(m instanceof U6)y=m.result;else throw m}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?o:void 0,n.promise=s?l:void 0)}return le.fun(a)&&je.batchedUpdates(()=>{a(y,r,r.item)}),y})()}function nf(e,t){hh(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var W6=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},U6=class extends Error{constructor(){super("SkipAnimationSignal")}},mw=e=>e instanceof s5,gce=1,s5=class extends jO{constructor(){super(...arguments),this.id=gce++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Oi(this);return e&&e.getValue()}to(...e){return Ei.to(this,e)}interpolate(...e){return Xle(),Ei.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Qh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Kv.sort(this),Qh(this,{type:"priority",parent:this,priority:e})}},Ya=Symbol.for("SpringPhase"),JO=1,gw=2,vw=4,L_=e=>(e[Ya]&JO)>0,Qs=e=>(e[Ya]&gw)>0,bd=e=>(e[Ya]&vw)>0,V6=(e,t)=>t?e[Ya]|=gw|JO:e[Ya]&=~gw,q6=(e,t)=>t?e[Ya]|=vw:e[Ya]&=~vw,vce=class extends s5{constructor(e,t){if(super(),this.animation=new mce,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!le.und(e)||!le.und(t)){const n=le.obj(e)?{...e}:{...t,from:e};le.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Qs(this)||this._state.asyncTo)||bd(this)}get goal(){return sr(this.animation.to)}get velocity(){const e=Oi(this);return e instanceof np?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return L_(this)}get isAnimating(){return Qs(this)}get isPaused(){return bd(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,a=Qv(r.to);!a&&Wr(r.to)&&(i=Xn(sr(r.to))),r.values.forEach((c,d)=>{if(c.done)return;const u=c.constructor==ef?1:a?a[d].lastPosition:i[d];let h=r.immediate,f=u;if(!h){if(f=c.lastPosition,s.tension<=0){c.done=!0;return}let b=c.elapsedTime+=e;const y=r.fromValues[d],m=c.v0!=null?c.v0:c.v0=le.arr(s.velocity)?s.velocity[d]:s.velocity;let p;const g=s.precision||(y==u?.005:Math.min(1,Math.abs(u-y)*.001));if(le.und(s.duration))if(s.decay){const _=s.decay===!0?.998:s.decay,S=Math.exp(-(1-_)*b);f=y+m/(1-_)*(1-S),h=Math.abs(c.lastPosition-f)<=g,p=m*S}else{p=c.lastVelocity==null?m:c.lastVelocity;const _=s.restVelocity||g/10,S=s.clamp?0:s.bounce,k=!le.und(S),C=y==u?c.v0>0:y<u;let T,w=!1;const E=1,$=Math.ceil(e/E);for(let M=0;M<$&&(T=Math.abs(p)>_,!(!T&&(h=Math.abs(u-f)<=g,h)));++M){k&&(w=f==u||f>u==C,w&&(p=-p*S,f=u));const P=-s.tension*1e-6*(f-u),D=-s.friction*.001*p,R=(P+D)/s.mass;p=p+R*E,f=f+p*E}}else{let _=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,b=c.elapsedTime+=e)),_=(s.progress||0)+b/this._memoizedDuration,_=_>1?1:_<0?0:_,c.durationProgress=_),f=y+s.easing(_)*(u-y),p=(f-c.lastPosition)/e,h=_==1}c.lastVelocity=p,Number.isNaN(f)&&(console.warn("Got NaN while animating:",this),h=!0)}a&&!a[d].done&&(h=!1),h?c.done=!0:t=!1,c.setValue(f,s.round)&&(n=!0)});const o=Oi(this),l=o.getValue();if(t){const c=sr(r.to);(l!==c||n)&&!s.decay?(o.setValue(c),this._onChange(c)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return je.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Qs(this)){const{to:e,config:t}=this.animation;je.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return le.und(e)?(n=this.queue||[],this.queue=[]):n=[le.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>i5(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),nf(this._state,e&&this._lastCallId),je.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=le.obj(n)?n[t]:n,(n==null||hw(n))&&(n=void 0),r=le.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return L_(this)||(e.reverse&&([n,r]=[r,n]),r=sr(r),le.und(r)?Oi(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Zv(e,(a,o)=>/^on/.test(o)?VO(a,n):a)),G6(this,e,"onProps"),wd(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return YO(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{bd(this)||(q6(this,!0),qd(s.pauseQueue),wd(this,"onPause",fi(this,xd(this,this.animation.to)),this))},resume:()=>{bd(this)&&(q6(this,!1),Qs(this)&&this._resume(),qd(s.resumeQueue),wd(this,"onResume",fi(this,xd(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const o=ZO(e);if(o)return this._update(o,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(wc(this));const r=!le.und(e.to),i=!le.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(wc(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:d=l,from:u=c}=e;i&&!r&&(!t.default||le.und(d))&&(d=u),t.reverse&&([d,u]=[u,d]);const h=!gs(u,c);h&&(o.from=u),u=sr(u);const f=!gs(d,l);f&&this._focus(d);const b=hw(t.to),{config:y}=o,{decay:m,velocity:p}=y;(r||i)&&(y.velocity=0),t.config&&!b&&pce(y,or(t.config,s),t.config!==a.config?or(a.config,s):void 0);let g=Oi(this);if(!g||le.und(d))return n(fi(this,!0));const _=le.und(t.reset)?i&&!t.default:!le.und(u)&&ph(t.reset,s),S=_?u:this.get(),k=tf(d),C=le.num(k)||le.arr(k)||Xv(k),T=!b&&(!C||ph(a.immediate||t.immediate,s));if(f){const M=dw(d);if(M!==g.constructor)if(T)g=this._set(k);else throw Error(`Cannot animate between ${g.constructor.name} and ${M.name}, as the "to" prop suggests`)}const w=g.constructor;let E=Wr(d),$=!1;if(!E){const M=_||!L_(this)&&h;(f||M)&&($=gs(tf(S),k),E=!$),(!gs(o.immediate,T)&&!T||!gs(y.decay,m)||!gs(y.velocity,p))&&(E=!0)}if($&&Qs(this)&&(o.changed&&!_?E=!0:E||this._stop(l)),!b&&((E||Wr(l))&&(o.values=g.getPayload(),o.toValues=Wr(d)?null:w==ef?[1]:Xn(k)),o.immediate!=T&&(o.immediate=T,!T&&!_&&this._set(l)),E)){const{onRest:M}=o;Ne(_ce,D=>G6(this,t,D));const P=fi(this,xd(this,l));qd(this._pendingCalls,P),this._pendingCalls.add(n),o.changed&&je.batchedUpdates(()=>{var D;o.changed=!_,M==null||M(P,this),_?or(a.onRest,P):(D=o.onStart)==null||D.call(o,P,this)})}_&&this._set(S),b?n(QO(t.to,t,this._state,this)):E?this._start():Qs(this)&&!f?this._pendingCalls.add(n):n(XO(S))}_focus(e){const t=this.animation;e!==t.to&&(N6(this)&&this._detach(),t.to=e,N6(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Wr(t)&&(zu(t,this),mw(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Wr(e)&&Jh(e,this)}_set(e,t=!0){const n=sr(e);if(!le.und(n)){const r=Oi(this);if(!r||!gs(n,r.getValue())){const i=dw(n);!r||r.constructor!=i?t5(this,i.create(n)):r.setValue(n),r&&je.batchedUpdates(()=>{this._onChange(n,t)})}}return Oi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,wd(this,"onStart",fi(this,xd(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),or(this.animation.onChange,e,this)),or(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Oi(this).reset(sr(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),Qs(this)||(V6(this,!0),bd(this)||this._resume())}_resume(){Ei.skipAnimation?this.finish():Kv.start(this)}_stop(e,t){if(Qs(this)){V6(this,!1);const n=this.animation;Ne(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Qh(this,{type:"idle",parent:this});const r=t?wc(this.get()):fi(this.get(),xd(this,e??n.to));qd(this._pendingCalls,r),n.changed&&(n.changed=!1,wd(this,"onRest",r,this))}}};function xd(e,t){const n=tf(t),r=tf(e.get());return gs(r,n)}function ZO(e,t=e.loop,n=e.to){const r=or(t);if(r){const i=r!==!0&&n5(r),s=(i||e).reverse,a=!i||i.reset;return rf({...e,loop:t,default:!1,pause:void 0,to:!s||hw(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function rf(e){const{to:t,from:n}=e=n5(e),r=new Set;return le.obj(t)&&K6(t,r),le.obj(n)&&K6(n,r),e.keys=r.size?Array.from(r):null,e}function yce(e){const t=rf(e);return le.und(t.default)&&(t.default=Zv(t)),t}function K6(e,t){Zi(e,(n,r)=>n!=null&&t.add(r))}var _ce=["onStart","onRest","onChange","onPause","onResume"];function G6(e,t,n){e.animation[n]=t[n]!==qO(t,n)?VO(t[n],e.key):void 0}function wd(e,t,...n){var r,i,s,a;(i=(r=e.animation)[t])==null||i.call(r,...n),(a=(s=e.defaultProps)[t])==null||a.call(s,...n)}var bce=["onStart","onChange","onRest"],xce=1,e9=class{constructor(e,t){this.id=xce++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];le.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(rf(e)),this}start(e){let{queue:t}=this;return e?t=Xn(e).map(rf):this.queue=[],this._flush?this._flush(this,t):(s9(this,t),yw(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ne(Xn(t),r=>n[r].stop(!!e))}else nf(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(le.und(e))this.start({pause:!0});else{const t=this.springs;Ne(Xn(e),n=>t[n].pause())}return this}resume(e){if(le.und(e))this.start({pause:!1});else{const t=this.springs;Ne(Xn(e),n=>t[n].resume())}return this}each(e){Zi(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,hh(e,([o,l])=>{l.value=this.get(),o(l,this,this._item)}));const s=!r&&this._started,a=i||s&&n.size?this.get():null;i&&t.size&&hh(t,([o,l])=>{l.value=a,o(l,this,this._item)}),s&&(this._started=!1,hh(n,([o,l])=>{l.value=a,o(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;je.onFrame(this._onFrame)}};function yw(e,t){return Promise.all(t.map(n=>t9(e,n))).then(n=>i5(e,n))}async function t9(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,c=le.obj(t.default)&&t.default;a&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const d=le.arr(i)||le.fun(i)?i:void 0;d?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ne(bce,y=>{const m=t[y];if(le.fun(m)){const p=e._events[y];t[y]=({finished:g,cancelled:_})=>{const S=p.get(m);S?(g||(S.finished=!1),_&&(S.cancelled=!0)):p.set(m,{value:null,finished:g||!1,cancelled:_||!1})},c&&(c[y]=t[y])}});const u=e._state;t.pause===!u.paused?(u.paused=t.pause,qd(t.pause?u.pauseQueue:u.resumeQueue)):u.paused&&(t.pause=!0);const h=(r||Object.keys(e.springs)).map(y=>e.springs[y].start(t)),f=t.cancel===!0||qO(t,"cancel")===!0;(d||f&&u.asyncId)&&h.push(YO(++e._lastAsyncId,{props:t,state:u,actions:{pause:lw,resume:lw,start(y,m){f?(nf(u,e._lastAsyncId),m(wc(e))):(y.onRest=o,m(QO(d,y,u,e)))}}})),u.paused&&await new Promise(y=>{u.resumeQueue.add(y)});const b=i5(e,await Promise.all(h));if(a&&b.finished&&!(n&&b.noop)){const y=ZO(t,a,i);if(y)return s9(e,[y]),t9(e,y,!0)}return l&&je.batchedUpdates(()=>l(b,e,e.item)),b}function _w(e,t){const n={...e.springs};return t&&Ne(Xn(t),r=>{le.und(r.keys)&&(r=rf(r)),le.obj(r.to)||(r={...r,to:void 0}),i9(n,r,i=>r9(i))}),n9(e,n),n}function n9(e,t){Zi(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,zu(n,e))})}function r9(e,t){const n=new vce;return n.key=e,t&&zu(n,t),n}function i9(e,t,n){t.keys&&Ne(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function s9(e,t){Ne(t,n=>{i9(e.springs,n,r=>r9(r,e))})}var rp=({children:e,...t})=>{const n=x.useContext(h0),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=ece(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=h0;return x.createElement(s,{value:t},e)},h0=wce(rp,{});rp.Provider=h0.Provider;rp.Consumer=h0.Consumer;function wce(e,t){return Object.assign(e,x.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var o9=()=>{const e=[],t=function(r){Jle();const i=[];return Ne(e,(s,a)=>{if(le.und(r))i.push(s.start());else{const o=n(r,s,a);o&&i.push(s.start(o))}}),i};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const i=e.indexOf(r);~i&&e.splice(i,1)},t.pause=function(){return Ne(e,r=>r.pause(...arguments)),this},t.resume=function(){return Ne(e,r=>r.resume(...arguments)),this},t.set=function(r){Ne(e,(i,s)=>{const a=le.fun(r)?r(s,i):r;a&&i.set(a)})},t.start=function(r){const i=[];return Ne(e,(s,a)=>{if(le.und(r))i.push(s.start());else{const o=this._getProps(r,s,a);o&&i.push(s.start(o))}}),i},t.stop=function(){return Ne(e,r=>r.stop(...arguments)),this},t.update=function(r){return Ne(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return le.fun(r)?r(s,i):r};return t._getProps=n,t};function Sce(e,t,n){const r=le.fun(t)&&t;r&&!n&&(n=[]);const i=x.useMemo(()=>r||arguments.length==3?o9():void 0,[]),s=x.useRef(0),a=ZC(),o=x.useMemo(()=>({ctrls:[],queue:[],flush(p,g){const _=_w(p,g);return s.current>0&&!o.queue.length&&!Object.keys(_).some(k=>!p.springs[k])?yw(p,g):new Promise(k=>{n9(p,_),o.queue.push(()=>{k(yw(p,g))}),a()})}}),[]),l=x.useRef([...o.ctrls]),c=[],d=uw(e)||0;x.useMemo(()=>{Ne(l.current.slice(e,d),p=>{fw(p,i),p.stop(!0)}),l.current.length=e,u(d,e)},[e]),x.useMemo(()=>{u(0,Math.min(d,e))},n);function u(p,g){for(let _=p;_<g;_++){const S=l.current[_]||(l.current[_]=new e9(null,o.flush)),k=r?r(_,S):t[_];k&&(c[_]=yce(k))}}const h=l.current.map((p,g)=>_w(p,c[g])),f=x.useContext(rp),b=uw(f),y=f!==b&&KO(f);va(()=>{s.current++,o.ctrls=l.current;const{queue:p}=o;p.length&&(o.queue=[],Ne(p,g=>g())),Ne(l.current,(g,_)=>{i==null||i.add(g),y&&g.start({default:f});const S=c[_];S&&(GO(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),e5(()=>()=>{Ne(o.ctrls,p=>p.stop(!0))});const m=h.map(p=>({...p}));return i?[m,i]:m}function Us(e,t){const n=le.fun(e),[[r],i]=Sce(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,i]:r}function ml(e,t,n){const r=le.fun(t)&&t,{reset:i,sort:s,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:c,ref:d,config:u}=r?r():t,h=x.useMemo(()=>r||arguments.length==3?o9():void 0,[]),f=Xn(e),b=[],y=x.useRef(null),m=i?null:y.current;va(()=>{y.current=b}),e5(()=>(Ne(b,R=>{h==null||h.add(R.ctrl),R.ctrl.ref=h}),()=>{Ne(y.current,R=>{R.expired&&clearTimeout(R.expirationId),fw(R.ctrl,h),R.ctrl.stop(!0)})}));const p=kce(f,r?r():t,m),g=i&&y.current||[];va(()=>Ne(g,({ctrl:R,item:O,key:N})=>{fw(R,h),or(c,O,N)}));const _=[];if(m&&Ne(m,(R,O)=>{R.expired?(clearTimeout(R.expirationId),g.push(R)):(O=_[O]=p.indexOf(R.key),~O&&(b[O]=R))}),Ne(f,(R,O)=>{b[O]||(b[O]={key:p[O],item:R,phase:"mount",ctrl:new e9},b[O].ctrl.item=R)}),_.length){let R=-1;const{leave:O}=r?r():t;Ne(_,(N,I)=>{const j=m[I];~N?(R=b.indexOf(j),b[R]={...j,item:f[N]}):O&&b.splice(++R,0,j)})}le.fun(s)&&b.sort((R,O)=>s(R.item,O.item));let S=-a;const k=ZC(),C=Zv(t),T=new Map,w=x.useRef(new Map),E=x.useRef(!1);Ne(b,(R,O)=>{const N=R.key,I=R.phase,j=r?r():t;let L,A;const F=or(j.delay||0,N);if(I=="mount")L=j.enter,A="enter";else{const J=p.indexOf(N)<0;if(I!="leave")if(J)L=j.leave,A="leave";else if(L=j.update)A="update";else return;else if(!J)L=j.enter,A="enter";else return}if(L=or(L,R.item,O),L=le.obj(L)?n5(L):{to:L},!L.config){const J=u||C.config;L.config=or(J,R.item,O,A)}S+=a;const H={...C,delay:F+S,ref:d,immediate:j.immediate,reset:!1,...L};if(A=="enter"&&le.und(H.from)){const J=r?r():t,W=le.und(J.initial)||m?J.from:J.initial;H.from=or(W,R.item,O)}const{onResolve:B}=H;H.onResolve=J=>{or(B,J);const W=y.current,U=W.find(z=>z.key===N);if(U&&!(J.cancelled&&U.phase!="update")&&U.ctrl.idle){const z=W.every(V=>V.ctrl.idle);if(U.phase=="leave"){const V=or(o,U.item);if(V!==!1){const K=V===!0?0:V;if(U.expired=!0,!z&&K>0){K<=2147483647&&(U.expirationId=setTimeout(k,K));return}}}z&&W.some(V=>V.expired)&&(w.current.delete(U),l&&(E.current=!0),k())}};const G=_w(R.ctrl,H);A==="leave"&&l?w.current.set(R,{phase:A,springs:G,payload:H}):T.set(R,{phase:A,springs:G,payload:H})});const $=x.useContext(rp),M=uw($),P=$!==M&&KO($);va(()=>{P&&Ne(b,R=>{R.ctrl.start({default:$})})},[$]),Ne(T,(R,O)=>{if(w.current.size){const N=b.findIndex(I=>I.key===O.key);b.splice(N,1)}}),va(()=>{Ne(w.current.size?w.current:T,({phase:R,payload:O},N)=>{const{ctrl:I}=N;N.phase=R,h==null||h.add(I),P&&R=="enter"&&I.start({default:$}),O&&(GO(I,O.ref),(I.ref||h)&&!E.current?I.update(O):(I.start(O),E.current&&(E.current=!1)))})},i?void 0:n);const D=R=>x.createElement(x.Fragment,null,b.map((O,N)=>{const{springs:I}=T.get(O)||O.ctrl,j=R({...I},O.item,O,N);return j&&j.type?x.createElement(j.type,{...j.props,key:le.str(O.key)||le.num(O.key)?O.key:O.ctrl.id,ref:j.ref}):j}));return h?[D,h]:D}var Cce=1;function kce(e,{key:t,keys:n=t},r){if(n===null){const i=new Set;return e.map(s=>{const a=r&&r.find(o=>o.item===s&&o.phase!=="leave"&&!i.has(o));return a?(i.add(a),a.key):Cce++})}return le.und(n)?e:le.fun(n)?e.map(n):Xn(n)}var a9=class extends s5{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Yh(...t);const n=this._get(),r=dw(n);t5(this,r.create(n))}advance(e){const t=this._get(),n=this.get();gs(t,n)||(Oi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Y6(this._active)&&D_(this)}_get(){const e=le.arr(this.source)?this.source.map(sr):Xn(sr(this.source));return this.calc(...e)}_start(){this.idle&&!Y6(this._active)&&(this.idle=!1,Ne(Qv(this),e=>{e.done=!1}),Ei.skipAnimation?(je.batchedUpdates(()=>this.advance()),D_(this)):Kv.start(this))}_attach(){let e=1;Ne(Xn(this.source),t=>{Wr(t)&&zu(t,this),mw(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Ne(Xn(this.source),e=>{Wr(e)&&Jh(e,this)}),this._active.clear(),D_(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=Xn(this.source).reduce((t,n)=>Math.max(t,(mw(n)?n.priority:0)+1),0))}};function Ece(e){return e.idle!==!1}function Y6(e){return!e.size||Array.from(e).every(Ece)}function D_(e){e.idle||(e.idle=!0,Ne(Qv(e),t=>{t.done=!0}),Qh(e,{type:"idle",parent:e}))}var qo=(e,...t)=>new a9(e,t);Ei.assign({createStringInterpolator:zO,to:(e,t)=>new a9(e,t)});var l9=/^--/;function Tce(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!l9.test(e)&&!(mh.hasOwnProperty(e)&&mh[e])?t+"px":(""+t).trim()}var X6={};function $ce(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{style:r,children:i,scrollTop:s,scrollLeft:a,viewBox:o,...l}=t,c=Object.values(l),d=Object.keys(l).map(u=>n||e.hasAttribute(u)?u:X6[u]||(X6[u]=u.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));i!==void 0&&(e.textContent=i);for(const u in r)if(r.hasOwnProperty(u)){const h=Tce(u,r[u]);l9.test(u)?e.style.setProperty(u,h):e.style[u]=h}d.forEach((u,h)=>{e.setAttribute(u,c[h])}),s!==void 0&&(e.scrollTop=s),a!==void 0&&(e.scrollLeft=a),o!==void 0&&e.setAttribute("viewBox",o)}var mh={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mce=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Rce=["Webkit","Ms","Moz","O"];mh=Object.keys(mh).reduce((e,t)=>(Rce.forEach(n=>e[Mce(n,t)]=e[t]),e),mh);var Ace=/^(matrix|translate|scale|rotate|skew)/,Lce=/^(translate)/,Dce=/^(rotate|skew)/,P_=(e,t)=>le.num(e)&&e!==0?e+t:e,Ym=(e,t)=>le.arr(e)?e.every(n=>Ym(n,t)):le.num(e)?e===t:parseFloat(e)===t,Pce=class extends Jv{constructor({x:e,y:t,z:n,...r}){const i=[],s=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),s.push(a=>[`translate3d(${a.map(o=>P_(o,"px")).join(",")})`,Ym(a,0)])),Zi(r,(a,o)=>{if(o==="transform")i.push([a||""]),s.push(l=>[l,l===""]);else if(Ace.test(o)){if(delete r[o],le.und(a))return;const l=Lce.test(o)?"px":Dce.test(o)?"deg":"";i.push(Xn(a)),s.push(o==="rotate3d"?([c,d,u,h])=>[`rotate3d(${c},${d},${u},${P_(h,l)})`,Ym(h,0)]:c=>[`${o}(${c.map(d=>P_(d,l)).join(",")})`,Ym(c,o.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new Oce(i,s)),super(r)}},Oce=class extends jO{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Ne(this.inputs,(n,r)=>{const i=sr(n[0]),[s,a]=this.transforms[r](le.arr(i)?i:n.map(sr));e+=" "+s,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Ne(this.inputs,t=>Ne(t,n=>Wr(n)&&zu(n,this)))}observerRemoved(e){e==0&&Ne(this.inputs,t=>Ne(t,n=>Wr(n)&&Jh(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Qh(this,e)}},Nce=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Ei.assign({batchedUpdates:Yn.unstable_batchedUpdates,createStringInterpolator:zO,colors:Mle});var Ice=lce(Nce,{applyAnimatedValues:$ce,createAnimatedStyle:e=>new Pce(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),xt=Ice.animated;function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}var jce={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},Q6=function(e,t){return"translate("+e+"px, "+t+"px)"},c9=x.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,s=Ut(),a=_r(),o=a.animate,l=a.config,c=uI(),d=c[0],u=c[1],h=x.useRef(!1),f=void 0,b=!1,y=u.width>0&&u.height>0,m=Math.round(n[0]),p=Math.round(n[1]);y&&(r==="top"?(m-=u.width/2,p-=u.height+14):r==="right"?(m+=14,p-=u.height/2):r==="bottom"?(m-=u.width/2,p+=14):r==="left"?(m-=u.width+14,p-=u.height/2):r==="center"&&(m-=u.width/2,p-=u.height/2),f={transform:Q6(m,p)},h.current||(b=!0),h.current=[m,p]);var g=Us({to:f,config:l,immediate:!o||b}),_=Xa({},jce,s.tooltip.wrapper,{transform:(t=g.transform)!=null?t:Q6(m,p),opacity:g.transform?1:0});return v.jsx(xt.div,{ref:d,style:_,children:i})});c9.displayName="TooltipWrapper";var Bce=x.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return v.jsx("span",{style:Xa({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),u9=x.memo(function(e){var t,n=e.id,r=e.value,i=e.format,s=e.enableChip,a=s!==void 0&&s,o=e.color,l=e.renderContent,c=Ut(),d=ey(i);if(typeof l=="function")t=l();else{var u=r;d!==void 0&&u!==void 0&&(u=d(u)),t=v.jsxs("div",{style:c.tooltip.basic,children:[a&&v.jsx(Bce,{color:o,style:c.tooltip.chip}),u!==void 0?v.jsxs("span",{children:[n,": ",v.jsx("strong",{children:""+u})]}):n]})}return v.jsx("div",{style:c.tooltip.container,children:t})}),Fce={width:"100%",borderCollapse:"collapse"},zce=x.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,s=e.renderContent,a=Ut();return i.length?(t=typeof s=="function"?s():v.jsxs("div",{children:[n&&n,v.jsx("table",{style:Xa({},Fce,a.tooltip.table),children:v.jsx("tbody",{children:i.map(function(o,l){return v.jsx("tr",{children:o.map(function(c,d){return v.jsx("td",{style:a.tooltip.tableCell,children:c},d)})},l)})})})]}),v.jsx("div",{style:a.tooltip.container,children:t})):null});zce.displayName="TableTooltip";var bw=x.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,s=Ut(),a=_r(),o=a.animate,l=a.config,c=x.useMemo(function(){return Xa({},s.crosshair.line,{pointerEvents:"none"})},[s.crosshair.line]),d=Us({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!o});return v.jsx(xt.line,Xa({},d,{fill:"none",style:c}))});bw.displayName="CrosshairLine";var Hce=x.memo(function(e){var t,n,r=e.width,i=e.height,s=e.type,a=e.x,o=e.y;return s==="cross"?(t={x0:a,x1:a,y0:0,y1:i},n={x0:0,x1:r,y0:o,y1:o}):s==="top-left"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:0,x1:a,y0:o,y1:o}):s==="top"?t={x0:a,x1:a,y0:0,y1:o}:s==="top-right"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:a,x1:r,y0:o,y1:o}):s==="right"?n={x0:a,x1:r,y0:o,y1:o}:s==="bottom-right"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:a,x1:r,y0:o,y1:o}):s==="bottom"?t={x0:a,x1:a,y0:o,y1:i}:s==="bottom-left"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:0,x1:a,y0:o,y1:o}):s==="left"?n={x0:0,x1:a,y0:o,y1:o}:s==="x"?t={x0:a,x1:a,y0:0,y1:i}:s==="y"&&(n={x0:0,x1:r,y0:o,y1:o}),v.jsxs(v.Fragment,{children:[t&&v.jsx(bw,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&v.jsx(bw,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});Hce.displayName="Crosshair";var d9=x.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),xw={isVisible:!1,position:[null,null],content:null,anchor:null},h9=x.createContext(xw),Wce=function(e){var t=x.useState(xw),n=t[0],r=t[1],i=x.useCallback(function(o,l,c){var d=l[0],u=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[d,u],anchor:c,content:o})},[r]),s=x.useCallback(function(o,l,c){c===void 0&&(c="top");var d=e.current.getBoundingClientRect(),u=e.current.offsetWidth,h=u===d.width?1:u/d.width,f="touches"in l?l.touches[0]:l,b=f.clientX,y=f.clientY,m=(b-d.left)*h,p=(y-d.top)*h;c!=="left"&&c!=="right"||(c=m<d.width/2?"right":"left"),r({isVisible:!0,position:[m,p],anchor:c,content:o})},[e,r]),a=x.useCallback(function(){r(xw)},[r]);return{actions:x.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:s,hideTooltip:a}},[i,s,a]),state:n}},o5=function(){var e=x.useContext(d9);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},Uce=function(){var e=x.useContext(h9);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},Vce=function(e){return e.isVisible},qce=function(){var e=Uce();return Vce(e)?v.jsx(c9,{position:e.position,anchor:e.anchor,children:e.content}):null},Kce=function(e){var t=e.container,n=e.children,r=Wce(t),i=r.actions,s=r.state;return v.jsx(d9.Provider,{value:i,children:v.jsx(h9.Provider,{value:s,children:n})})};function Gce(){this.__data__=[],this.size=0}var Yce=Gce;function Xce(e,t){return e===t||e!==e&&t!==t}var ip=Xce,Qce=ip;function Jce(e,t){for(var n=e.length;n--;)if(Qce(e[n][0],t))return n;return-1}var e1=Jce,Zce=e1,eue=Array.prototype,tue=eue.splice;function nue(e){var t=this.__data__,n=Zce(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tue.call(t,n,1),--this.size,!0}var rue=nue,iue=e1;function sue(e){var t=this.__data__,n=iue(t,e);return n<0?void 0:t[n][1]}var oue=sue,aue=e1;function lue(e){return aue(this.__data__,e)>-1}var cue=lue,uue=e1;function due(e,t){var n=this.__data__,r=uue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var hue=due,fue=Yce,pue=rue,mue=oue,gue=cue,vue=hue;function Hu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hu.prototype.clear=fue;Hu.prototype.delete=pue;Hu.prototype.get=mue;Hu.prototype.has=gue;Hu.prototype.set=vue;var t1=Hu,yue=t1;function _ue(){this.__data__=new yue,this.size=0}var bue=_ue;function xue(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var wue=xue;function Sue(e){return this.__data__.get(e)}var Cue=Sue;function kue(e){return this.__data__.has(e)}var Eue=kue,Tue=typeof vo=="object"&&vo&&vo.Object===Object&&vo,f9=Tue,$ue=f9,Mue=typeof self=="object"&&self&&self.Object===Object&&self,Rue=$ue||Mue||Function("return this")(),is=Rue,Aue=is,Lue=Aue.Symbol,Wu=Lue,J6=Wu,p9=Object.prototype,Due=p9.hasOwnProperty,Pue=p9.toString,Sd=J6?J6.toStringTag:void 0;function Oue(e){var t=Due.call(e,Sd),n=e[Sd];try{e[Sd]=void 0;var r=!0}catch{}var i=Pue.call(e);return r&&(t?e[Sd]=n:delete e[Sd]),i}var Nue=Oue,Iue=Object.prototype,jue=Iue.toString;function Bue(e){return jue.call(e)}var Fue=Bue,Z6=Wu,zue=Nue,Hue=Fue,Wue="[object Null]",Uue="[object Undefined]",eT=Z6?Z6.toStringTag:void 0;function Vue(e){return e==null?e===void 0?Uue:Wue:eT&&eT in Object(e)?zue(e):Hue(e)}var ta=Vue;function que(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ss=que,Kue=ta,Gue=ss,Yue="[object AsyncFunction]",Xue="[object Function]",Que="[object GeneratorFunction]",Jue="[object Proxy]";function Zue(e){if(!Gue(e))return!1;var t=Kue(e);return t==Xue||t==Que||t==Yue||t==Jue}var n1=Zue;const m9=vn(n1);var ede=is,tde=ede["__core-js_shared__"],nde=tde,O_=nde,tT=function(){var e=/[^.]+$/.exec(O_&&O_.keys&&O_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function rde(e){return!!tT&&tT in e}var ide=rde,sde=Function.prototype,ode=sde.toString;function ade(e){if(e!=null){try{return ode.call(e)}catch{}try{return e+""}catch{}}return""}var g9=ade,lde=n1,cde=ide,ude=ss,dde=g9,hde=/[\\^$.*+?()[\]{}|]/g,fde=/^\[object .+?Constructor\]$/,pde=Function.prototype,mde=Object.prototype,gde=pde.toString,vde=mde.hasOwnProperty,yde=RegExp("^"+gde.call(vde).replace(hde,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _de(e){if(!ude(e)||cde(e))return!1;var t=lde(e)?yde:fde;return t.test(dde(e))}var bde=_de;function xde(e,t){return e==null?void 0:e[t]}var wde=xde,Sde=bde,Cde=wde;function kde(e,t){var n=Cde(e,t);return Sde(n)?n:void 0}var gl=kde,Ede=gl,Tde=is,$de=Ede(Tde,"Map"),a5=$de,Mde=gl,Rde=Mde(Object,"create"),r1=Rde,nT=r1;function Ade(){this.__data__=nT?nT(null):{},this.size=0}var Lde=Ade;function Dde(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Pde=Dde,Ode=r1,Nde="__lodash_hash_undefined__",Ide=Object.prototype,jde=Ide.hasOwnProperty;function Bde(e){var t=this.__data__;if(Ode){var n=t[e];return n===Nde?void 0:n}return jde.call(t,e)?t[e]:void 0}var Fde=Bde,zde=r1,Hde=Object.prototype,Wde=Hde.hasOwnProperty;function Ude(e){var t=this.__data__;return zde?t[e]!==void 0:Wde.call(t,e)}var Vde=Ude,qde=r1,Kde="__lodash_hash_undefined__";function Gde(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qde&&t===void 0?Kde:t,this}var Yde=Gde,Xde=Lde,Qde=Pde,Jde=Fde,Zde=Vde,ehe=Yde;function Uu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Uu.prototype.clear=Xde;Uu.prototype.delete=Qde;Uu.prototype.get=Jde;Uu.prototype.has=Zde;Uu.prototype.set=ehe;var the=Uu,rT=the,nhe=t1,rhe=a5;function ihe(){this.size=0,this.__data__={hash:new rT,map:new(rhe||nhe),string:new rT}}var she=ihe;function ohe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ahe=ohe,lhe=ahe;function che(e,t){var n=e.__data__;return lhe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var i1=che,uhe=i1;function dhe(e){var t=uhe(this,e).delete(e);return this.size-=t?1:0,t}var hhe=dhe,fhe=i1;function phe(e){return fhe(this,e).get(e)}var mhe=phe,ghe=i1;function vhe(e){return ghe(this,e).has(e)}var yhe=vhe,_he=i1;function bhe(e,t){var n=_he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var xhe=bhe,whe=she,She=hhe,Che=mhe,khe=yhe,Ehe=xhe;function Vu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vu.prototype.clear=whe;Vu.prototype.delete=She;Vu.prototype.get=Che;Vu.prototype.has=khe;Vu.prototype.set=Ehe;var l5=Vu,The=t1,$he=a5,Mhe=l5,Rhe=200;function Ahe(e,t){var n=this.__data__;if(n instanceof The){var r=n.__data__;if(!$he||r.length<Rhe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mhe(r)}return n.set(e,t),this.size=n.size,this}var Lhe=Ahe,Dhe=t1,Phe=bue,Ohe=wue,Nhe=Cue,Ihe=Eue,jhe=Lhe;function qu(e){var t=this.__data__=new Dhe(e);this.size=t.size}qu.prototype.clear=Phe;qu.prototype.delete=Ohe;qu.prototype.get=Nhe;qu.prototype.has=Ihe;qu.prototype.set=jhe;var s1=qu,Bhe=gl,Fhe=function(){try{var e=Bhe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),v9=Fhe,iT=v9;function zhe(e,t,n){t=="__proto__"&&iT?iT(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var c5=zhe,Hhe=c5,Whe=ip;function Uhe(e,t,n){(n!==void 0&&!Whe(e[t],n)||n===void 0&&!(t in e))&&Hhe(e,t,n)}var y9=Uhe;function Vhe(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var qhe=Vhe,Khe=qhe,Ghe=Khe(),_9=Ghe,f0={exports:{}};f0.exports;(function(e,t){var n=is,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var u=c.length,h=o?o(u):new c.constructor(u);return c.copy(h),h}e.exports=l})(f0,f0.exports);var b9=f0.exports,Yhe=is,Xhe=Yhe.Uint8Array,x9=Xhe,sT=x9;function Qhe(e){var t=new e.constructor(e.byteLength);return new sT(t).set(new sT(e)),t}var u5=Qhe,Jhe=u5;function Zhe(e,t){var n=t?Jhe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var w9=Zhe;function efe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var S9=efe,tfe=ss,oT=Object.create,nfe=function(){function e(){}return function(t){if(!tfe(t))return{};if(oT)return oT(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),rfe=nfe;function ife(e,t){return function(n){return e(t(n))}}var C9=ife,sfe=C9,ofe=sfe(Object.getPrototypeOf,Object),d5=ofe,afe=Object.prototype;function lfe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||afe;return e===n}var h5=lfe,cfe=rfe,ufe=d5,dfe=h5;function hfe(e){return typeof e.constructor=="function"&&!dfe(e)?cfe(ufe(e)):{}}var k9=hfe;function ffe(e){return e!=null&&typeof e=="object"}var Ti=ffe,pfe=ta,mfe=Ti,gfe="[object Arguments]";function vfe(e){return mfe(e)&&pfe(e)==gfe}var yfe=vfe,aT=yfe,_fe=Ti,E9=Object.prototype,bfe=E9.hasOwnProperty,xfe=E9.propertyIsEnumerable,wfe=aT(function(){return arguments}())?aT:function(e){return _fe(e)&&bfe.call(e,"callee")&&!xfe.call(e,"callee")},o1=wfe,Sfe=Array.isArray,yr=Sfe,Cfe=9007199254740991;function kfe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Cfe}var f5=kfe,Efe=n1,Tfe=f5;function $fe(e){return e!=null&&Tfe(e.length)&&!Efe(e)}var Ku=$fe,Mfe=Ku,Rfe=Ti;function Afe(e){return Rfe(e)&&Mfe(e)}var T9=Afe,p0={exports:{}};function Lfe(){return!1}var Dfe=Lfe;p0.exports;(function(e,t){var n=is,r=Dfe,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||r;e.exports=c})(p0,p0.exports);var a1=p0.exports,Pfe=ta,Ofe=d5,Nfe=Ti,Ife="[object Object]",jfe=Function.prototype,Bfe=Object.prototype,$9=jfe.toString,Ffe=Bfe.hasOwnProperty,zfe=$9.call(Object);function Hfe(e){if(!Nfe(e)||Pfe(e)!=Ife)return!1;var t=Ofe(e);if(t===null)return!0;var n=Ffe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&$9.call(n)==zfe}var p5=Hfe;const m5=vn(p5);var Wfe=ta,Ufe=f5,Vfe=Ti,qfe="[object Arguments]",Kfe="[object Array]",Gfe="[object Boolean]",Yfe="[object Date]",Xfe="[object Error]",Qfe="[object Function]",Jfe="[object Map]",Zfe="[object Number]",epe="[object Object]",tpe="[object RegExp]",npe="[object Set]",rpe="[object String]",ipe="[object WeakMap]",spe="[object ArrayBuffer]",ope="[object DataView]",ape="[object Float32Array]",lpe="[object Float64Array]",cpe="[object Int8Array]",upe="[object Int16Array]",dpe="[object Int32Array]",hpe="[object Uint8Array]",fpe="[object Uint8ClampedArray]",ppe="[object Uint16Array]",mpe="[object Uint32Array]",Bt={};Bt[ape]=Bt[lpe]=Bt[cpe]=Bt[upe]=Bt[dpe]=Bt[hpe]=Bt[fpe]=Bt[ppe]=Bt[mpe]=!0;Bt[qfe]=Bt[Kfe]=Bt[spe]=Bt[Gfe]=Bt[ope]=Bt[Yfe]=Bt[Xfe]=Bt[Qfe]=Bt[Jfe]=Bt[Zfe]=Bt[epe]=Bt[tpe]=Bt[npe]=Bt[rpe]=Bt[ipe]=!1;function gpe(e){return Vfe(e)&&Ufe(e.length)&&!!Bt[Wfe(e)]}var vpe=gpe;function ype(e){return function(t){return e(t)}}var sp=ype,m0={exports:{}};m0.exports;(function(e,t){var n=f9,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s&&n.process,o=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(m0,m0.exports);var l1=m0.exports,_pe=vpe,bpe=sp,lT=l1,cT=lT&&lT.isTypedArray,xpe=cT?bpe(cT):_pe,g5=xpe;function wpe(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var M9=wpe,Spe=c5,Cpe=ip,kpe=Object.prototype,Epe=kpe.hasOwnProperty;function Tpe(e,t,n){var r=e[t];(!(Epe.call(e,t)&&Cpe(r,n))||n===void 0&&!(t in e))&&Spe(e,t,n)}var v5=Tpe,$pe=v5,Mpe=c5;function Rpe(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?Mpe(n,o,l):$pe(n,o,l)}return n}var Gu=Rpe;function Ape(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Lpe=Ape,Dpe=9007199254740991,Ppe=/^(?:0|[1-9]\d*)$/;function Ope(e,t){var n=typeof e;return t=t??Dpe,!!t&&(n=="number"||n!="symbol"&&Ppe.test(e))&&e>-1&&e%1==0&&e<t}var c1=Ope,Npe=Lpe,Ipe=o1,jpe=yr,Bpe=a1,Fpe=c1,zpe=g5,Hpe=Object.prototype,Wpe=Hpe.hasOwnProperty;function Upe(e,t){var n=jpe(e),r=!n&&Ipe(e),i=!n&&!r&&Bpe(e),s=!n&&!r&&!i&&zpe(e),a=n||r||i||s,o=a?Npe(e.length,String):[],l=o.length;for(var c in e)(t||Wpe.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Fpe(c,l)))&&o.push(c);return o}var R9=Upe;function Vpe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var qpe=Vpe,Kpe=ss,Gpe=h5,Ype=qpe,Xpe=Object.prototype,Qpe=Xpe.hasOwnProperty;function Jpe(e){if(!Kpe(e))return Ype(e);var t=Gpe(e),n=[];for(var r in e)r=="constructor"&&(t||!Qpe.call(e,r))||n.push(r);return n}var Zpe=Jpe,eme=R9,tme=Zpe,nme=Ku;function rme(e){return nme(e)?eme(e,!0):tme(e)}var op=rme,ime=Gu,sme=op;function ome(e){return ime(e,sme(e))}var ame=ome,uT=y9,lme=b9,cme=w9,ume=S9,dme=k9,dT=o1,hT=yr,hme=T9,fme=a1,pme=n1,mme=ss,gme=p5,vme=g5,fT=M9,yme=ame;function _me(e,t,n,r,i,s,a){var o=fT(e,n),l=fT(t,n),c=a.get(l);if(c){uT(e,n,c);return}var d=s?s(o,l,n+"",e,t,a):void 0,u=d===void 0;if(u){var h=hT(l),f=!h&&fme(l),b=!h&&!f&&vme(l);d=l,h||f||b?hT(o)?d=o:hme(o)?d=ume(o):f?(u=!1,d=lme(l,!0)):b?(u=!1,d=cme(l,!0)):d=[]:gme(l)||dT(l)?(d=o,dT(o)?d=yme(o):(!mme(o)||pme(o))&&(d=dme(l))):u=!1}u&&(a.set(l,d),i(d,l,r,s,a),a.delete(l)),uT(e,n,d)}var bme=_me,xme=s1,wme=y9,Sme=_9,Cme=bme,kme=ss,Eme=op,Tme=M9;function A9(e,t,n,r,i){e!==t&&Sme(t,function(s,a){if(i||(i=new xme),kme(s))Cme(e,t,a,n,A9,r,i);else{var o=r?r(Tme(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),wme(e,a,o)}},Eme)}var $me=A9;function Mme(e){return e}var u1=Mme;function Rme(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Ame=Rme,Lme=Ame,pT=Math.max;function Dme(e,t,n){return t=pT(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=pT(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),Lme(e,this,o)}}var L9=Dme;function Pme(e){return function(){return e}}var Ome=Pme,Nme=Ome,mT=v9,Ime=u1,jme=mT?function(e,t){return mT(e,"toString",{configurable:!0,enumerable:!1,value:Nme(t),writable:!0})}:Ime,Bme=jme,Fme=800,zme=16,Hme=Date.now;function Wme(e){var t=0,n=0;return function(){var r=Hme(),i=zme-(r-n);if(n=r,i>0){if(++t>=Fme)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ume=Wme,Vme=Bme,qme=Ume,Kme=qme(Vme),D9=Kme,Gme=u1,Yme=L9,Xme=D9;function Qme(e,t){return Xme(Yme(e,t,Gme),e+"")}var y5=Qme,Jme=ip,Zme=Ku,ege=c1,tge=ss;function nge(e,t,n){if(!tge(n))return!1;var r=typeof t;return(r=="number"?Zme(n)&&ege(t,n.length):r=="string"&&t in n)?Jme(n[t],e):!1}var P9=nge,rge=y5,ige=P9;function sge(e){return rge(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&ige(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var oge=sge,age=$me,lge=oge,cge=lge(function(e,t,n){age(e,t,n)}),uge=cge;const dge=vn(uge);var hge=ta,fge=Ti,pge="[object Symbol]";function mge(e){return typeof e=="symbol"||fge(e)&&hge(e)==pge}var d1=mge,gge=yr,vge=d1,yge=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_ge=/^\w*$/;function bge(e,t){if(gge(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||vge(e)?!0:_ge.test(e)||!yge.test(e)||t!=null&&e in Object(t)}var _5=bge,O9=l5,xge="Expected a function";function b5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(xge);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(b5.Cache||O9),n}b5.Cache=O9;var wge=b5,Sge=wge,Cge=500;function kge(e){var t=Sge(e,function(r){return n.size===Cge&&n.clear(),r}),n=t.cache;return t}var Ege=kge,Tge=Ege,$ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mge=/\\(\\)?/g,Rge=Tge(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace($ge,function(n,r,i,s){t.push(i?s.replace(Mge,"$1"):r||n)}),t}),Age=Rge;function Lge(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var h1=Lge,gT=Wu,Dge=h1,Pge=yr,Oge=d1,Nge=1/0,vT=gT?gT.prototype:void 0,yT=vT?vT.toString:void 0;function N9(e){if(typeof e=="string")return e;if(Pge(e))return Dge(e,N9)+"";if(Oge(e))return yT?yT.call(e):"";var t=e+"";return t=="0"&&1/e==-Nge?"-0":t}var Ige=N9,jge=Ige;function Bge(e){return e==null?"":jge(e)}var Fge=Bge,zge=yr,Hge=_5,Wge=Age,Uge=Fge;function Vge(e,t){return zge(e)?e:Hge(e,t)?[e]:Wge(Uge(e))}var Yu=Vge,qge=d1,Kge=1/0;function Gge(e){if(typeof e=="string"||qge(e))return e;var t=e+"";return t=="0"&&1/e==-Kge?"-0":t}var Xu=Gge,Yge=Yu,Xge=Xu;function Qge(e,t){t=Yge(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Xge(t[n++])];return n&&n==r?e:void 0}var ap=Qge,Jge=ap;function Zge(e,t,n){var r=e==null?void 0:Jge(e,t);return r===void 0?n:r}var I9=Zge;const js=vn(I9);var e0e=v5,t0e=Yu,n0e=c1,_T=ss,r0e=Xu;function i0e(e,t,n,r){if(!_T(e))return e;t=t0e(t,e);for(var i=-1,s=t.length,a=s-1,o=e;o!=null&&++i<s;){var l=r0e(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var d=o[l];c=r?r(d,l,o):void 0,c===void 0&&(c=_T(d)?d:n0e(t[i+1])?[]:{})}e0e(o,l,c),o=o[l]}return e}var j9=i0e,s0e=j9;function o0e(e,t,n){return e==null?e:s0e(e,t,n)}var a0e=o0e;const Kd=vn(a0e);function f1(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function x5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qu(){}var Qa=.7,ou=1/Qa,Sc="\\s*([+-]?\\d+)\\s*",sf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l0e=/^#([0-9a-f]{3,8})$/,c0e=new RegExp(`^rgb\\(${Sc},${Sc},${Sc}\\)$`),u0e=new RegExp(`^rgb\\(${Yi},${Yi},${Yi}\\)$`),d0e=new RegExp(`^rgba\\(${Sc},${Sc},${Sc},${sf}\\)$`),h0e=new RegExp(`^rgba\\(${Yi},${Yi},${Yi},${sf}\\)$`),f0e=new RegExp(`^hsl\\(${sf},${Yi},${Yi}\\)$`),p0e=new RegExp(`^hsla\\(${sf},${Yi},${Yi},${sf}\\)$`),bT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};f1(Qu,Ko,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xT,formatHex:xT,formatHex8:m0e,formatHsl:g0e,formatRgb:wT,toString:wT});function xT(){return this.rgb().formatHex()}function m0e(){return this.rgb().formatHex8()}function g0e(){return F9(this).formatHsl()}function wT(){return this.rgb().formatRgb()}function Ko(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=l0e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ST(t):n===3?new Hn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?um(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?um(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=c0e.exec(e))?new Hn(t[1],t[2],t[3],1):(t=u0e.exec(e))?new Hn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=d0e.exec(e))?um(t[1],t[2],t[3],t[4]):(t=h0e.exec(e))?um(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=f0e.exec(e))?ET(t[1],t[2]/100,t[3]/100,1):(t=p0e.exec(e))?ET(t[1],t[2]/100,t[3]/100,t[4]):bT.hasOwnProperty(e)?ST(bT[e]):e==="transparent"?new Hn(NaN,NaN,NaN,0):null}function ST(e){return new Hn(e>>16&255,e>>8&255,e&255,1)}function um(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hn(e,t,n,r)}function B9(e){return e instanceof Qu||(e=Ko(e)),e?(e=e.rgb(),new Hn(e.r,e.g,e.b,e.opacity)):new Hn}function au(e,t,n,r){return arguments.length===1?B9(e):new Hn(e,t,n,r??1)}function Hn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}f1(Hn,au,x5(Qu,{brighter(e){return e=e==null?ou:Math.pow(ou,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qa:Math.pow(Qa,e),new Hn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hn(Oa(this.r),Oa(this.g),Oa(this.b),g0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:CT,formatHex:CT,formatHex8:v0e,formatRgb:kT,toString:kT}));function CT(){return`#${ya(this.r)}${ya(this.g)}${ya(this.b)}`}function v0e(){return`#${ya(this.r)}${ya(this.g)}${ya(this.b)}${ya((isNaN(this.opacity)?1:this.opacity)*255)}`}function kT(){const e=g0(this.opacity);return`${e===1?"rgb(":"rgba("}${Oa(this.r)}, ${Oa(this.g)}, ${Oa(this.b)}${e===1?")":`, ${e})`}`}function g0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ya(e){return e=Oa(e),(e<16?"0":"")+e.toString(16)}function ET(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mi(e,t,n,r)}function F9(e){if(e instanceof mi)return new mi(e.h,e.s,e.l,e.opacity);if(e instanceof Qu||(e=Ko(e)),!e)return new mi;if(e instanceof mi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new mi(a,o,l,e.opacity)}function y0e(e,t,n,r){return arguments.length===1?F9(e):new mi(e,t,n,r??1)}function mi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}f1(mi,y0e,x5(Qu,{brighter(e){return e=e==null?ou:Math.pow(ou,e),new mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qa:Math.pow(Qa,e),new mi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Hn(N_(e>=240?e-240:e+120,i,r),N_(e,i,r),N_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mi(TT(this.h),dm(this.s),dm(this.l),g0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=g0(this.opacity);return`${e===1?"hsl(":"hsla("}${TT(this.h)}, ${dm(this.s)*100}%, ${dm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TT(e){return e=(e||0)%360,e<0?e+360:e}function dm(e){return Math.max(0,Math.min(1,e||0))}function N_(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const _0e=Math.PI/180,b0e=180/Math.PI;var z9=-.14861,w5=1.78277,S5=-.29227,p1=-.90649,of=1.97294,$T=of*p1,MT=of*w5,RT=w5*S5-p1*z9;function x0e(e){if(e instanceof Na)return new Na(e.h,e.s,e.l,e.opacity);e instanceof Hn||(e=B9(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(RT*r+$T*t-MT*n)/(RT+$T-MT),s=r-i,a=(of*(n-i)-S5*s)/p1,o=Math.sqrt(a*a+s*s)/(of*i*(1-i)),l=o?Math.atan2(a,s)*b0e-120:NaN;return new Na(l<0?l+360:l,o,i,e.opacity)}function es(e,t,n,r){return arguments.length===1?x0e(e):new Na(e,t,n,r??1)}function Na(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}f1(Na,es,x5(Qu,{brighter(e){return e=e==null?ou:Math.pow(ou,e),new Na(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qa:Math.pow(Qa,e),new Na(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_0e,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Hn(255*(t+n*(z9*r+w5*i)),255*(t+n*(S5*r+p1*i)),255*(t+n*(of*r)),this.opacity)}}));function w0e(e,t,n,r,i){var s=e*e,a=s*e;return((1-3*e+3*s-a)*t+(4-6*s+3*a)*n+(1+3*e+3*s-3*a)*r+a*i)/6}function S0e(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],s=e[r+1],a=r>0?e[r-1]:2*i-s,o=r<t-1?e[r+2]:2*s-i;return w0e((n-r/t)*t,a,i,s,o)}}const m1=e=>()=>e;function H9(e,t){return function(n){return e+n*t}}function C0e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function k0e(e,t){var n=t-e;return n?H9(e,n>180||n<-180?n-360*Math.round(n/360):n):m1(isNaN(e)?t:e)}function E0e(e){return(e=+e)==1?Cc:function(t,n){return n-t?C0e(t,n,e):m1(isNaN(t)?n:t)}}function Cc(e,t){var n=t-e;return n?H9(e,n):m1(isNaN(e)?t:e)}const v0=function e(t){var n=E0e(t);function r(i,s){var a=n((i=au(i)).r,(s=au(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Cc(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function T0e(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),s=new Array(n),a,o;for(a=0;a<n;++a)o=au(t[a]),r[a]=o.r||0,i[a]=o.g||0,s[a]=o.b||0;return r=e(r),i=e(i),s=e(s),o.opacity=1,function(l){return o.r=r(l),o.g=i(l),o.b=s(l),o+""}}}var $0e=T0e(S0e);function M0e(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function R0e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function A0e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=g1(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function L0e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function D0e(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=g1(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var ww=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,I_=new RegExp(ww.source,"g");function P0e(e){return function(){return e}}function O0e(e){return function(t){return e(t)+""}}function C5(e,t){var n=ww.lastIndex=I_.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=ww.exec(e))&&(i=I_.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:pi(r,i)})),n=I_.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?O0e(l[0].x):P0e(t):(t=l.length,function(c){for(var d=0,u;d<t;++d)o[(u=l[d]).i]=u.x(c);return o.join("")})}function g1(e,t){var n=typeof t,r;return t==null||n==="boolean"?m1(t):(n==="number"?pi:n==="string"?(r=Ko(t))?(t=r,v0):C5:t instanceof Ko?v0:t instanceof Date?L0e:R0e(t)?M0e:Array.isArray(t)?A0e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?D0e:pi)(e,t)}function W9(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var AT=180/Math.PI,Sw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function U9(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*AT,skewX:Math.atan(l)*AT,scaleX:a,scaleY:o}}var hm;function N0e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Sw:U9(t.a,t.b,t.c,t.d,t.e,t.f)}function I0e(e){return e==null||(hm||(hm=document.createElementNS("http://www.w3.org/2000/svg","g")),hm.setAttribute("transform",e),!(e=hm.transform.baseVal.consolidate()))?Sw:(e=e.matrix,U9(e.a,e.b,e.c,e.d,e.e,e.f))}function V9(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,d,u,h,f,b){if(c!==u||d!==h){var y=f.push("translate(",null,t,null,n);b.push({i:y-4,x:pi(c,u)},{i:y-2,x:pi(d,h)})}else(u||h)&&f.push("translate("+u+t+h+n)}function a(c,d,u,h){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(i(u)+"rotate(",null,r)-2,x:pi(c,d)})):d&&u.push(i(u)+"rotate("+d+r)}function o(c,d,u,h){c!==d?h.push({i:u.push(i(u)+"skewX(",null,r)-2,x:pi(c,d)}):d&&u.push(i(u)+"skewX("+d+r)}function l(c,d,u,h,f,b){if(c!==u||d!==h){var y=f.push(i(f)+"scale(",null,",",null,")");b.push({i:y-4,x:pi(c,u)},{i:y-2,x:pi(d,h)})}else(u!==1||h!==1)&&f.push(i(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=e(c),d=e(d),s(c.translateX,c.translateY,d.translateX,d.translateY,u,h),a(c.rotate,d.rotate,u,h),o(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var b=-1,y=h.length,m;++b<y;)u[(m=h[b]).i]=m.x(f);return u.join("")}}}var j0e=V9(N0e,"px, ","px)","deg)"),B0e=V9(I0e,", ",")",")"),F0e=1e-12;function LT(e){return((e=Math.exp(e))+1/e)/2}function z0e(e){return((e=Math.exp(e))-1/e)/2}function H0e(e){return((e=Math.exp(2*e))-1)/(e+1)}const W0e=function e(t,n,r){function i(s,a){var o=s[0],l=s[1],c=s[2],d=a[0],u=a[1],h=a[2],f=d-o,b=u-l,y=f*f+b*b,m,p;if(y<F0e)p=Math.log(h/c)/t,m=function(T){return[o+T*f,l+T*b,c*Math.exp(t*T*p)]};else{var g=Math.sqrt(y),_=(h*h-c*c+r*y)/(2*c*n*g),S=(h*h-c*c-r*y)/(2*h*n*g),k=Math.log(Math.sqrt(_*_+1)-_),C=Math.log(Math.sqrt(S*S+1)-S);p=(C-k)/t,m=function(T){var w=T*p,E=LT(k),$=c/(n*g)*(E*H0e(t*w+k)-z0e(k));return[o+$*f,l+$*b,c*E/LT(t*w+k)]}}return m.duration=p*1e3*t/Math.SQRT2,m}return i.rho=function(s){var a=Math.max(.001,+s),o=a*a,l=o*o;return e(a,o,l)},i}(Math.SQRT2,2,4);function q9(e){return function t(n){n=+n;function r(i,s){var a=e((i=es(i)).h,(s=es(s)).h),o=Cc(i.s,s.s),l=Cc(i.l,s.l),c=Cc(i.opacity,s.opacity);return function(d){return i.h=a(d),i.s=o(d),i.l=l(Math.pow(d,n)),i.opacity=c(d),i+""}}return r.gamma=t,r}(1)}q9(k0e);var k5=q9(Cc),U0e=ta,V0e=yr,q0e=Ti,K0e="[object String]";function G0e(e){return typeof e=="string"||!V0e(e)&&q0e(e)&&U0e(e)==K0e}var Y0e=G0e;const X0e=vn(Y0e);function Q0e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var K9=Q0e;const Re=vn(K9);function kc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function J0e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function v1(e){let t,n,r;e.length!==2?(t=kc,n=(o,l)=>kc(e(o),l),r=(o,l)=>e(o)-l):(t=e===kc||e===J0e?e:Z0e,n=e,r=e);function i(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const u=c+d>>>1;n(o[u],l)<0?c=u+1:d=u}while(c<d)}return c}function s(o,l,c=0,d=o.length){if(c<d){if(t(l,l)!==0)return d;do{const u=c+d>>>1;n(o[u],l)<=0?c=u+1:d=u}while(c<d)}return c}function a(o,l,c=0,d=o.length){const u=i(o,l,c,d-1);return u>c&&r(o[u-1],l)>-r(o[u],l)?u-1:u}return{left:i,center:a,right:s}}function Z0e(){return 0}function eve(e){return e===null?NaN:+e}function*tve(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const nve=v1(kc),rve=nve.right;v1(eve).center;class DT extends Map{constructor(t,n=ove){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(PT(this,t))}has(t){return super.has(PT(this,t))}set(t,n){return super.set(ive(this,t),n)}delete(t){return super.delete(sve(this,t))}}function PT({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ive({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function sve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ove(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ave(e=kc){if(e===kc)return G9;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function G9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const lve=Math.sqrt(50),cve=Math.sqrt(10),uve=Math.sqrt(2);function y0(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=lve?10:s>=cve?5:s>=uve?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?y0(e,t,n*2):[o,l,c]}function Cw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?y0(t,e,n):y0(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function kw(e,t,n){return t=+t,e=+e,n=+n,y0(e,t,n)[2]}function Ew(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?kw(t,e,n):kw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function io(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function OT(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Y9(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?G9:ave(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,d=Math.log(l),u=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*u/l+h)),b=Math.min(r,Math.floor(t+(l-c)*u/l+h));Y9(e,t,f,b,i)}const s=e[t];let a=n,o=r;for(Cd(e,n,t),i(e[r],s)>0&&Cd(e,n,r);a<o;){for(Cd(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Cd(e,n,o):(++o,Cd(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Cd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dve(e,t,n){if(e=Float64Array.from(tve(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OT(e);if(t>=1)return io(e);var r,i=(r-1)*t,s=Math.floor(i),a=io(Y9(e,s).subarray(0,s+1)),o=OT(e.subarray(s+1));return a+(o-a)*(i-s)}}function X9(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function vl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function hve(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const NT=Symbol("implicit");function _a(){var e=new DT,t=[],n=[],r=NT;function i(s){let a=e.get(s);if(a===void 0){if(r!==NT)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new DT;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return _a(t,n).unknown(r)},vl.apply(i,arguments),i}function y1(){var e=_a().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,d=.5;delete e.unknown;function u(){var h=t().length,f=i<r,b=f?i:r,y=f?r:i;s=(y-b)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),b+=(y-b-s*(h-l))*d,a=s*(1-l),o&&(b=Math.round(b),a=Math.round(a));var m=X9(h).map(function(p){return b+s*p});return n(f?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),u()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,u()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,u()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),u()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),u()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,u()):c},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),u()):d},e.copy=function(){return y1(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(d)},vl.apply(u(),arguments)}function Q9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Q9(t())},e}function fve(){return Q9(y1.apply(null,arguments).paddingInner(1))}function pve(e){return function(){return e}}function mve(e){return+e}var IT=[0,1];function So(e){return e}function Tw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:pve(isNaN(t)?NaN:.5)}function gve(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function vve(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Tw(i,r),s=n(a,s)):(r=Tw(r,i),s=n(s,a)),function(o){return s(r(o))}}function yve(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Tw(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=rve(e,o,1,r)-1;return s[l](i[l](o))}}function _1(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function E5(){var e=IT,t=IT,n=g1,r,i,s,a=So,o,l,c;function d(){var h=Math.min(e.length,t.length);return a!==So&&(a=gve(e[0],e[h-1])),o=h>2?yve:vve,l=c=null,u}function u(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return u.invert=function(h){return a(i((c||(c=o(t,e.map(r),pi)))(h)))},u.domain=function(h){return arguments.length?(e=Array.from(h,mve),d()):e.slice()},u.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},u.rangeRound=function(h){return t=Array.from(h),n=W9,d()},u.clamp=function(h){return arguments.length?(a=h?!0:So,d()):a!==So},u.interpolate=function(h){return arguments.length?(n=h,d()):n},u.unknown=function(h){return arguments.length?(s=h,u):s},function(h,f){return r=h,i=f,d()}}function J9(){return E5()(So,So)}function _ve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _0(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function lu(e){return e=_0(Math.abs(e)),e?e[1]:NaN}function bve(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function xve(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var wve=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(e){if(!(t=wve.exec(e)))throw new Error("invalid format: "+e);var t;return new T5({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}af.prototype=T5.prototype;function T5(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}T5.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Sve(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Z9;function Cve(e,t){var n=_0(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Z9=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+_0(e,Math.max(0,t+s-1))[0]}function jT(e,t){var n=_0(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const BT={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:_ve,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return jT(e*100,t)},r:jT,s:Cve,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function FT(e){return e}var zT=Array.prototype.map,HT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kve(e){var t=e.grouping===void 0||e.thousands===void 0?FT:bve(zT.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?FT:xve(zT.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"-":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(u){u=af(u);var h=u.fill,f=u.align,b=u.sign,y=u.symbol,m=u.zero,p=u.width,g=u.comma,_=u.precision,S=u.trim,k=u.type;k==="n"?(g=!0,k="g"):BT[k]||(_===void 0&&(_=12),S=!0,k="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",T=y==="$"?r:/[%p]/.test(k)?a:"",w=BT[k],E=/[defgprs%]/.test(k);_=_===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function $(M){var P=C,D=T,R,O,N;if(k==="c")D=w(M)+D,M="";else{M=+M;var I=M<0||1/M<0;if(M=isNaN(M)?l:w(Math.abs(M),_),S&&(M=Sve(M)),I&&+M==0&&b!=="+"&&(I=!1),P=(I?b==="("?b:o:b==="-"||b==="("?"":b)+P,D=(k==="s"?HT[8+Z9/3]:"")+D+(I&&b==="("?")":""),E){for(R=-1,O=M.length;++R<O;)if(N=M.charCodeAt(R),48>N||N>57){D=(N===46?i+M.slice(R+1):M.slice(R))+D,M=M.slice(0,R);break}}}g&&!m&&(M=t(M,1/0));var j=P.length+M.length+D.length,L=j<p?new Array(p-j+1).join(h):"";switch(g&&m&&(M=t(L+M,L.length?p-D.length:1/0),L=""),f){case"<":M=P+M+D+L;break;case"=":M=P+L+M+D;break;case"^":M=L.slice(0,j=L.length>>1)+P+M+D+L.slice(j);break;default:M=L+P+M+D;break}return s(M)}return $.toString=function(){return u+""},$}function d(u,h){var f=c((u=af(u),u.type="f",u)),b=Math.max(-8,Math.min(8,Math.floor(lu(h)/3)))*3,y=Math.pow(10,-b),m=HT[8+b/3];return function(p){return f(y*p)+m}}return{format:c,formatPrefix:d}}var fm,lp,eN;Eve({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function Eve(e){return fm=kve(e),lp=fm.format,eN=fm.formatPrefix,fm}function Tve(e){return Math.max(0,-lu(Math.abs(e)))}function $ve(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lu(t)/3)))*3-lu(Math.abs(e)))}function Mve(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,lu(t)-lu(e))+1}function Rve(e,t,n,r){var i=Ew(e,t,n),s;switch(r=af(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=$ve(i,a))&&(r.precision=s),eN(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Mve(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Tve(i))&&(r.precision=s-(r.type==="%")*2);break}}return lp(r)}function $5(e){var t=e.domain;return e.ticks=function(n){var r=t();return Cw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Rve(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,d=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);d-- >0;){if(c=kw(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function oc(){var e=J9();return e.copy=function(){return _1(e,oc())},vl.apply(e,arguments),$5(e)}function tN(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function WT(e){return Math.log(e)}function UT(e){return Math.exp(e)}function Ave(e){return-Math.log(-e)}function Lve(e){return-Math.exp(-e)}function Dve(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Pve(e){return e===10?Dve:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ove(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VT(e){return(t,n)=>-e(-t,n)}function Nve(e){const t=e(WT,UT),n=t.domain;let r=10,i,s;function a(){return i=Ove(r),s=Pve(r),n()[0]<0?(i=VT(i),s=VT(s),e(Ave,Lve)):e(WT,UT),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],d=l[l.length-1];const u=d<c;u&&([c,d]=[d,c]);let h=i(c),f=i(d),b,y;const m=o==null?10:+o;let p=[];if(!(r%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(b=1;b<r;++b)if(y=h<0?b/s(-h):b*s(h),!(y<c)){if(y>d)break;p.push(y)}}else for(;h<=f;++h)for(b=r-1;b>=1;--b)if(y=h>0?b/s(-h):b*s(h),!(y<c)){if(y>d)break;p.push(y)}p.length*2<m&&(p=Cw(c,d,m))}else p=Cw(h,f,Math.min(f-h,m)).map(s);return u?p.reverse():p},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=af(l)).precision==null&&(l.trim=!0),l=lp(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return d=>{let u=d/s(Math.round(i(d)));return u*r<r-.5&&(u*=r),u<=c?l(d):""}},t.nice=()=>n(tN(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function nN(){const e=Nve(E5()).domain([1,10]);return e.copy=()=>_1(e,nN()).base(e.base()),vl.apply(e,arguments),e}function qT(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function KT(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ive(e){var t=1,n=e(qT(t),KT(t));return n.constant=function(r){return arguments.length?e(qT(t=+r),KT(t)):t},$5(n)}function rN(){var e=Ive(E5());return e.copy=function(){return _1(e,rN()).constant(e.constant())},vl.apply(e,arguments)}const j_=new Date,B_=new Date;function _n(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>_n(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(j_.setTime(+s),B_.setTime(+a),e(j_),e(B_),Math.floor(n(j_,B_))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const b0=_n(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);b0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_n(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):b0);b0.range;const Ss=1e3,Gr=Ss*60,Cs=Gr*60,Bs=Cs*24,M5=Bs*7,GT=Bs*30,F_=Bs*365,ba=_n(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ss)},(e,t)=>(t-e)/Ss,e=>e.getUTCSeconds());ba.range;const R5=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ss)},(e,t)=>{e.setTime(+e+t*Gr)},(e,t)=>(t-e)/Gr,e=>e.getMinutes());R5.range;const A5=_n(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Gr)},(e,t)=>(t-e)/Gr,e=>e.getUTCMinutes());A5.range;const L5=_n(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ss-e.getMinutes()*Gr)},(e,t)=>{e.setTime(+e+t*Cs)},(e,t)=>(t-e)/Cs,e=>e.getHours());L5.range;const D5=_n(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cs)},(e,t)=>(t-e)/Cs,e=>e.getUTCHours());D5.range;const P5=_n(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Gr)/Bs,e=>e.getDate()-1);P5.range;const iN=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bs,e=>e.getUTCDate()-1);iN.range;const sN=_n(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Bs,e=>Math.floor(e/Bs));sN.range;function yl(e){return _n(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Gr)/M5)}const O5=yl(0),jve=yl(1),Bve=yl(2),Fve=yl(3),zve=yl(4),Hve=yl(5),Wve=yl(6);O5.range;jve.range;Bve.range;Fve.range;zve.range;Hve.range;Wve.range;function _l(e){return _n(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/M5)}const N5=_l(0),Uve=_l(1),Vve=_l(2),qve=_l(3),Kve=_l(4),Gve=_l(5),Yve=_l(6);N5.range;Uve.range;Vve.range;qve.range;Kve.range;Gve.range;Yve.range;const I5=_n(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());I5.range;const j5=_n(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());j5.range;const b1=_n(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());b1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});b1.range;const x1=_n(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());x1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_n(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});x1.range;function oN(e,t,n,r,i,s){const a=[[ba,1,Ss],[ba,5,5*Ss],[ba,15,15*Ss],[ba,30,30*Ss],[s,1,Gr],[s,5,5*Gr],[s,15,15*Gr],[s,30,30*Gr],[i,1,Cs],[i,3,3*Cs],[i,6,6*Cs],[i,12,12*Cs],[r,1,Bs],[r,2,2*Bs],[n,1,M5],[t,1,GT],[t,3,3*GT],[e,1,F_]];function o(c,d,u){const h=d<c;h&&([c,d]=[d,c]);const f=u&&typeof u.range=="function"?u:l(c,d,u),b=f?f.range(c,+d+1):[];return h?b.reverse():b}function l(c,d,u){const h=Math.abs(d-c)/u,f=v1(([,,m])=>m).right(a,h);if(f===a.length)return e.every(Ew(c/F_,d/F_,u));if(f===0)return b0.every(Math.max(Ew(c,d,u),1));const[b,y]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return b.every(y)}return[o,l]}const[Xve,Qve]=oN(x1,j5,N5,sN,D5,A5),[Jve,Zve]=oN(b1,I5,O5,P5,L5,R5);var z_=new Date,H_=new Date;function Vs(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=function(s,a){return t(s=new Date(+s),a==null?1:Math.floor(a)),s},i.range=function(s,a,o){var l=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return Vs(function(a){if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return z_.setTime(+s),H_.setTime(+a),e(z_),e(H_),Math.floor(n(z_,H_))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}const e1e=1e3,B5=e1e*60,t1e=B5*60,F5=t1e*24,aN=F5*7;var z5=Vs(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*B5)/F5,e=>e.getDate()-1);z5.range;function bl(e){return Vs(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*B5)/aN})}var lN=bl(0),x0=bl(1),n1e=bl(2),r1e=bl(3),cu=bl(4),i1e=bl(5),s1e=bl(6);lN.range;x0.range;n1e.range;r1e.range;cu.range;i1e.range;s1e.range;var Ja=Vs(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Ja.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Vs(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};Ja.range;var H5=Vs(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/F5},function(e){return e.getUTCDate()-1});H5.range;function xl(e){return Vs(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/aN})}var cN=xl(0),w0=xl(1),o1e=xl(2),a1e=xl(3),uu=xl(4),l1e=xl(5),c1e=xl(6);cN.range;w0.range;o1e.range;a1e.range;uu.range;l1e.range;c1e.range;var Za=Vs(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Za.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Vs(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};Za.range;function W_(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function U_(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function kd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function u1e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ed(i),d=Td(i),u=Ed(s),h=Td(s),f=Ed(a),b=Td(a),y=Ed(o),m=Td(o),p=Ed(l),g=Td(l),_={a:I,A:j,b:L,B:A,c:null,d:e8,e:e8,f:D1e,g:W1e,G:V1e,H:R1e,I:A1e,j:L1e,L:uN,m:P1e,M:O1e,p:F,q:H,Q:r8,s:i8,S:N1e,u:I1e,U:j1e,V:B1e,w:F1e,W:z1e,x:null,X:null,y:H1e,Y:U1e,Z:q1e,"%":n8},S={a:B,A:G,b:J,B:W,c:null,d:t8,e:t8,f:X1e,g:oye,G:lye,H:K1e,I:G1e,j:Y1e,L:hN,m:Q1e,M:J1e,p:U,q:z,Q:r8,s:i8,S:Z1e,u:eye,U:tye,V:nye,w:rye,W:iye,x:null,X:null,y:sye,Y:aye,Z:cye,"%":n8},k={a:$,A:M,b:P,B:D,c:R,d:JT,e:JT,f:E1e,g:QT,G:XT,H:ZT,I:ZT,j:w1e,L:k1e,m:x1e,M:S1e,p:E,q:b1e,Q:$1e,s:M1e,S:C1e,u:m1e,U:g1e,V:v1e,w:p1e,W:y1e,x:O,X:N,y:QT,Y:XT,Z:_1e,"%":T1e};_.x=C(n,_),_.X=C(r,_),_.c=C(t,_),S.x=C(n,S),S.X=C(r,S),S.c=C(t,S);function C(V,K){return function(q){var X=[],ie=-1,re=0,ce=V.length,ye,ae,Me;for(q instanceof Date||(q=new Date(+q));++ie<ce;)V.charCodeAt(ie)===37&&(X.push(V.slice(re,ie)),(ae=YT[ye=V.charAt(++ie)])!=null?ye=V.charAt(++ie):ae=ye==="e"?" ":"0",(Me=K[ye])&&(ye=Me(q,ae)),X.push(ye),re=ie+1);return X.push(V.slice(re,ie)),X.join("")}}function T(V,K){return function(q){var X=kd(1900,void 0,1),ie=w(X,V,q+="",0),re,ce;if(ie!=q.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(K&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(re=U_(kd(X.y,0,1)),ce=re.getUTCDay(),re=ce>4||ce===0?w0.ceil(re):w0(re),re=H5.offset(re,(X.V-1)*7),X.y=re.getUTCFullYear(),X.m=re.getUTCMonth(),X.d=re.getUTCDate()+(X.w+6)%7):(re=W_(kd(X.y,0,1)),ce=re.getDay(),re=ce>4||ce===0?x0.ceil(re):x0(re),re=z5.offset(re,(X.V-1)*7),X.y=re.getFullYear(),X.m=re.getMonth(),X.d=re.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),ce="Z"in X?U_(kd(X.y,0,1)).getUTCDay():W_(kd(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(ce+5)%7:X.w+X.U*7-(ce+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,U_(X)):W_(X)}}function w(V,K,q,X){for(var ie=0,re=K.length,ce=q.length,ye,ae;ie<re;){if(X>=ce)return-1;if(ye=K.charCodeAt(ie++),ye===37){if(ye=K.charAt(ie++),ae=k[ye in YT?K.charAt(ie++):ye],!ae||(X=ae(V,q,X))<0)return-1}else if(ye!=q.charCodeAt(X++))return-1}return X}function E(V,K,q){var X=c.exec(K.slice(q));return X?(V.p=d.get(X[0].toLowerCase()),q+X[0].length):-1}function $(V,K,q){var X=f.exec(K.slice(q));return X?(V.w=b.get(X[0].toLowerCase()),q+X[0].length):-1}function M(V,K,q){var X=u.exec(K.slice(q));return X?(V.w=h.get(X[0].toLowerCase()),q+X[0].length):-1}function P(V,K,q){var X=p.exec(K.slice(q));return X?(V.m=g.get(X[0].toLowerCase()),q+X[0].length):-1}function D(V,K,q){var X=y.exec(K.slice(q));return X?(V.m=m.get(X[0].toLowerCase()),q+X[0].length):-1}function R(V,K,q){return w(V,t,K,q)}function O(V,K,q){return w(V,n,K,q)}function N(V,K,q){return w(V,r,K,q)}function I(V){return a[V.getDay()]}function j(V){return s[V.getDay()]}function L(V){return l[V.getMonth()]}function A(V){return o[V.getMonth()]}function F(V){return i[+(V.getHours()>=12)]}function H(V){return 1+~~(V.getMonth()/3)}function B(V){return a[V.getUTCDay()]}function G(V){return s[V.getUTCDay()]}function J(V){return l[V.getUTCMonth()]}function W(V){return o[V.getUTCMonth()]}function U(V){return i[+(V.getUTCHours()>=12)]}function z(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var K=C(V+="",_);return K.toString=function(){return V},K},parse:function(V){var K=T(V+="",!1);return K.toString=function(){return V},K},utcFormat:function(V){var K=C(V+="",S);return K.toString=function(){return V},K},utcParse:function(V){var K=T(V+="",!0);return K.toString=function(){return V},K}}}var YT={"-":"",_:" ",0:"0"},$n=/^\s*\d+/,d1e=/^%/,h1e=/[\\^$*+?|[\]().{}]/g;function pt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function f1e(e){return e.replace(h1e,"\\$&")}function Ed(e){return new RegExp("^(?:"+e.map(f1e).join("|")+")","i")}function Td(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function p1e(e,t,n){var r=$n.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function m1e(e,t,n){var r=$n.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function g1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function v1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function y1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function XT(e,t,n){var r=$n.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function QT(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _1e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function b1e(e,t,n){var r=$n.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function x1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JT(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function w1e(e,t,n){var r=$n.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ZT(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function S1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function C1e(e,t,n){var r=$n.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function k1e(e,t,n){var r=$n.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function E1e(e,t,n){var r=$n.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function T1e(e,t,n){var r=d1e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $1e(e,t,n){var r=$n.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function M1e(e,t,n){var r=$n.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function e8(e,t){return pt(e.getDate(),t,2)}function R1e(e,t){return pt(e.getHours(),t,2)}function A1e(e,t){return pt(e.getHours()%12||12,t,2)}function L1e(e,t){return pt(1+z5.count(Ja(e),e),t,3)}function uN(e,t){return pt(e.getMilliseconds(),t,3)}function D1e(e,t){return uN(e,t)+"000"}function P1e(e,t){return pt(e.getMonth()+1,t,2)}function O1e(e,t){return pt(e.getMinutes(),t,2)}function N1e(e,t){return pt(e.getSeconds(),t,2)}function I1e(e){var t=e.getDay();return t===0?7:t}function j1e(e,t){return pt(lN.count(Ja(e)-1,e),t,2)}function dN(e){var t=e.getDay();return t>=4||t===0?cu(e):cu.ceil(e)}function B1e(e,t){return e=dN(e),pt(cu.count(Ja(e),e)+(Ja(e).getDay()===4),t,2)}function F1e(e){return e.getDay()}function z1e(e,t){return pt(x0.count(Ja(e)-1,e),t,2)}function H1e(e,t){return pt(e.getFullYear()%100,t,2)}function W1e(e,t){return e=dN(e),pt(e.getFullYear()%100,t,2)}function U1e(e,t){return pt(e.getFullYear()%1e4,t,4)}function V1e(e,t){var n=e.getDay();return e=n>=4||n===0?cu(e):cu.ceil(e),pt(e.getFullYear()%1e4,t,4)}function q1e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+pt(t/60|0,"0",2)+pt(t%60,"0",2)}function t8(e,t){return pt(e.getUTCDate(),t,2)}function K1e(e,t){return pt(e.getUTCHours(),t,2)}function G1e(e,t){return pt(e.getUTCHours()%12||12,t,2)}function Y1e(e,t){return pt(1+H5.count(Za(e),e),t,3)}function hN(e,t){return pt(e.getUTCMilliseconds(),t,3)}function X1e(e,t){return hN(e,t)+"000"}function Q1e(e,t){return pt(e.getUTCMonth()+1,t,2)}function J1e(e,t){return pt(e.getUTCMinutes(),t,2)}function Z1e(e,t){return pt(e.getUTCSeconds(),t,2)}function eye(e){var t=e.getUTCDay();return t===0?7:t}function tye(e,t){return pt(cN.count(Za(e)-1,e),t,2)}function fN(e){var t=e.getUTCDay();return t>=4||t===0?uu(e):uu.ceil(e)}function nye(e,t){return e=fN(e),pt(uu.count(Za(e),e)+(Za(e).getUTCDay()===4),t,2)}function rye(e){return e.getUTCDay()}function iye(e,t){return pt(w0.count(Za(e)-1,e),t,2)}function sye(e,t){return pt(e.getUTCFullYear()%100,t,2)}function oye(e,t){return e=fN(e),pt(e.getUTCFullYear()%100,t,2)}function aye(e,t){return pt(e.getUTCFullYear()%1e4,t,4)}function lye(e,t){var n=e.getUTCDay();return e=n>=4||n===0?uu(e):uu.ceil(e),pt(e.getUTCFullYear()%1e4,t,4)}function cye(){return"+0000"}function n8(){return"%"}function r8(e){return+e}function i8(e){return Math.floor(+e/1e3)}var Bl,w1,pN,mN,gN;uye({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uye(e){return Bl=u1e(e),w1=Bl.format,pN=Bl.parse,mN=Bl.utcFormat,gN=Bl.utcParse,Bl}function dye(e){return new Date(e)}function hye(e){return e instanceof Date?+e:+new Date(+e)}function W5(e,t,n,r,i,s,a,o,l,c){var d=J9(),u=d.invert,h=d.domain,f=c(".%L"),b=c(":%S"),y=c("%I:%M"),m=c("%I %p"),p=c("%a %d"),g=c("%b %d"),_=c("%B"),S=c("%Y");function k(C){return(l(C)<C?f:o(C)<C?b:a(C)<C?y:s(C)<C?m:r(C)<C?i(C)<C?p:g:n(C)<C?_:S)(C)}return d.invert=function(C){return new Date(u(C))},d.domain=function(C){return arguments.length?h(Array.from(C,hye)):h().map(dye)},d.ticks=function(C){var T=h();return e(T[0],T[T.length-1],C??10)},d.tickFormat=function(C,T){return T==null?k:c(T)},d.nice=function(C){var T=h();return(!C||typeof C.range!="function")&&(C=t(T[0],T[T.length-1],C??10)),C?h(tN(T,C)):d},d.copy=function(){return _1(d,W5(e,t,n,r,i,s,a,o,l,c))},d}function vN(){return vl.apply(W5(Jve,Zve,b1,I5,O5,P5,L5,R5,ba,w1).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fye(){return vl.apply(W5(Xve,Qve,x1,j5,N5,iN,D5,A5,ba,mN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function pye(){var e=0,t=1,n,r,i,s,a=So,o=!1,l;function c(u){return u==null||isNaN(u=+u)?l:a(i===0?.5:(u=(s(u)-n)*i,o?Math.max(0,Math.min(1,u)):u))}c.domain=function(u){return arguments.length?([e,t]=u,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(u){return arguments.length?(o=!!u,c):o},c.interpolator=function(u){return arguments.length?(a=u,c):a};function d(u){return function(h){var f,b;return arguments.length?([f,b]=h,a=u(f,b),c):[a(0),a(1)]}}return c.range=d(g1),c.rangeRound=d(W9),c.unknown=function(u){return arguments.length?(l=u,c):l},function(u){return s=u,n=u(e),r=u(t),i=n===r?0:1/(r-n),c}}function mye(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function yN(){var e=$5(pye()(So));return e.copy=function(){return mye(e,yN())},hve.apply(e,arguments)}function We(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}const _N=We("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),bN=We("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),xN=We("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),wN=We("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),SN=We("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),CN=We("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),kN=We("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),EN=We("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),U5=We("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),gye=We("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),kt=e=>$0e(e[e.length-1]);var S1=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(We);const vye=kt(S1);var C1=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(We);const yye=kt(C1);var k1=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(We);const _ye=kt(k1);var E1=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(We);const bye=kt(E1);var T1=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(We);const xye=kt(T1);var $1=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(We);const wye=kt($1);var M1=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(We);const Sye=kt(M1);var R1=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(We);const TN=kt(R1);var A1=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(We);const Cye=kt(A1);var L1=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(We);const kye=kt(L1);var D1=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(We);const Eye=kt(D1);var P1=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(We);const Tye=kt(P1);var O1=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(We);const $ye=kt(O1);var N1=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(We);const Mye=kt(N1);var I1=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(We);const Rye=kt(I1);var j1=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(We);const Aye=kt(j1);var B1=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(We);const Lye=kt(B1);var F1=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(We);const Dye=kt(F1);var z1=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(We);const $N=kt(z1);var H1=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(We);const Pye=kt(H1);var W1=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(We);const MN=kt(W1);var U1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(We);const Oye=kt(U1);var V1=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(We);const Nye=kt(V1);var q1=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(We);const Iye=kt(q1);var K1=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(We);const jye=kt(K1);var G1=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(We);const Bye=kt(G1);var Y1=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(We);const Fye=kt(Y1);function zye(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const Hye=k5(es(300,.5,0),es(-240,.5,1));var Wye=k5(es(-100,.75,.35),es(80,1.5,.8)),RN=k5(es(260,.75,.35),es(80,1.5,.8)),pm=es();function Uye(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return pm.h=360*e-100,pm.s=1.5-1.5*t,pm.l=.8-.9*t,pm+""}var mm=au(),Vye=Math.PI/3,qye=Math.PI*2/3;function Kye(e){var t;return e=(.5-e)*Math.PI,mm.r=255*(t=Math.sin(e))*t,mm.g=255*(t=Math.sin(e+Vye))*t,mm.b=255*(t=Math.sin(e+qye))*t,mm+""}function Gye(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function X1(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const AN=X1(We("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Yye=X1(We("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Xye=X1(We("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Qye=X1(We("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Jye="__lodash_hash_undefined__";function Zye(e){return this.__data__.set(e,Jye),this}var e_e=Zye;function t_e(e){return this.__data__.has(e)}var n_e=t_e,r_e=l5,i_e=e_e,s_e=n_e;function S0(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new r_e;++t<n;)this.add(e[t])}S0.prototype.add=S0.prototype.push=i_e;S0.prototype.has=s_e;var V5=S0;function o_e(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var a_e=o_e;function l_e(e){return e!==e}var c_e=l_e;function u_e(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var d_e=u_e,h_e=a_e,f_e=c_e,p_e=d_e;function m_e(e,t,n){return t===t?p_e(e,t,n):h_e(e,f_e,n)}var g_e=m_e,v_e=g_e;function y_e(e,t){var n=e==null?0:e.length;return!!n&&v_e(e,t,0)>-1}var LN=y_e;function __e(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var DN=__e;function b_e(e,t){return e.has(t)}var q5=b_e,x_e=V5,w_e=LN,S_e=DN,C_e=h1,k_e=sp,E_e=q5,T_e=200;function $_e(e,t,n,r){var i=-1,s=w_e,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=C_e(t,k_e(n))),r?(s=S_e,a=!1):t.length>=T_e&&(s=E_e,a=!1,t=new x_e(t));e:for(;++i<o;){var d=e[i],u=n==null?d:n(d);if(d=r||d!==0?d:0,a&&u===u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else s(t,u,r)||l.push(d)}return l}var M_e=$_e,R_e=M_e,A_e=y5,L_e=T9,D_e=A_e(function(e,t){return L_e(e)?R_e(e,t):[]}),P_e=D_e;const PN=vn(P_e);function zt(e){return function(){return e}}const s8=Math.abs,In=Math.atan2,ia=Math.cos,O_e=Math.max,V_=Math.min,Ai=Math.sin,ac=Math.sqrt,jn=1e-12,lf=Math.PI,C0=lf/2,Xm=2*lf;function N_e(e){return e>1?0:e<-1?lf:Math.acos(e)}function o8(e){return e>=1?C0:e<=-1?-C0:Math.asin(e)}const $w=Math.PI,Mw=2*$w,la=1e-6,I_e=Mw-la;function ON(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function j_e(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ON;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class B_e{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ON:j_e(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,d=a-t,u=o-n,h=d*d+u*u;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>la)if(!(Math.abs(u*l-c*d)>la)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,b=i-o,y=l*l+c*c,m=f*f+b*b,p=Math.sqrt(y),g=Math.sqrt(h),_=s*Math.tan(($w-Math.acos((y+h-m)/(2*p*g)))/2),S=_/g,k=_/p;Math.abs(S-1)>la&&this._append`L${t+S*d},${n+S*u}`,this._append`A${s},${s},0,0,${+(u*f>d*b)},${this._x1=t+k*l},${this._y1=n+k*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,d=n+l,u=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>la||Math.abs(this._y1-d)>la)&&this._append`L${c},${d}`,r&&(h<0&&(h=h%Mw+Mw),h>I_e?this._append`A${r},${r},0,1,${u},${t-o},${n-l}A${r},${r},0,1,${u},${this._x1=c},${this._y1=d}`:h>la&&this._append`A${r},${r},0,${+(h>=$w)},${u},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function NN(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new B_e(t)}function F_e(e){return e.innerRadius}function z_e(e){return e.outerRadius}function H_e(e){return e.startAngle}function W_e(e){return e.endAngle}function U_e(e){return e&&e.padAngle}function V_e(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,d=a-i,u=o-s,h=u*l-d*c;if(!(h*h<jn))return h=(d*(t-s)-u*(e-i))/h,[e+h*l,t+h*c]}function gm(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/ac(o*o+l*l),d=c*l,u=-c*o,h=e+d,f=t+u,b=n+d,y=r+u,m=(h+b)/2,p=(f+y)/2,g=b-h,_=y-f,S=g*g+_*_,k=i-s,C=h*y-b*f,T=(_<0?-1:1)*ac(O_e(0,k*k*S-C*C)),w=(C*_-g*T)/S,E=(-C*g-_*T)/S,$=(C*_+g*T)/S,M=(-C*g+_*T)/S,P=w-m,D=E-p,R=$-m,O=M-p;return P*P+D*D>R*R+O*O&&(w=$,E=M),{cx:w,cy:E,x01:-d,y01:-u,x11:w*(i/k-1),y11:E*(i/k-1)}}function q_e(){var e=F_e,t=z_e,n=zt(0),r=null,i=H_e,s=W_e,a=U_e,o=null,l=NN(c);function c(){var d,u,h=+e.apply(this,arguments),f=+t.apply(this,arguments),b=i.apply(this,arguments)-C0,y=s.apply(this,arguments)-C0,m=s8(y-b),p=y>b;if(o||(o=d=l()),f<h&&(u=f,f=h,h=u),!(f>jn))o.moveTo(0,0);else if(m>Xm-jn)o.moveTo(f*ia(b),f*Ai(b)),o.arc(0,0,f,b,y,!p),h>jn&&(o.moveTo(h*ia(y),h*Ai(y)),o.arc(0,0,h,y,b,p));else{var g=b,_=y,S=b,k=y,C=m,T=m,w=a.apply(this,arguments)/2,E=w>jn&&(r?+r.apply(this,arguments):ac(h*h+f*f)),$=V_(s8(f-h)/2,+n.apply(this,arguments)),M=$,P=$,D,R;if(E>jn){var O=o8(E/h*Ai(w)),N=o8(E/f*Ai(w));(C-=O*2)>jn?(O*=p?1:-1,S+=O,k-=O):(C=0,S=k=(b+y)/2),(T-=N*2)>jn?(N*=p?1:-1,g+=N,_-=N):(T=0,g=_=(b+y)/2)}var I=f*ia(g),j=f*Ai(g),L=h*ia(k),A=h*Ai(k);if($>jn){var F=f*ia(_),H=f*Ai(_),B=h*ia(S),G=h*Ai(S),J;if(m<lf)if(J=V_e(I,j,B,G,F,H,L,A)){var W=I-J[0],U=j-J[1],z=F-J[0],V=H-J[1],K=1/Ai(N_e((W*z+U*V)/(ac(W*W+U*U)*ac(z*z+V*V)))/2),q=ac(J[0]*J[0]+J[1]*J[1]);M=V_($,(h-q)/(K-1)),P=V_($,(f-q)/(K+1))}else M=P=0}T>jn?P>jn?(D=gm(B,G,I,j,f,P,p),R=gm(F,H,L,A,f,P,p),o.moveTo(D.cx+D.x01,D.cy+D.y01),P<$?o.arc(D.cx,D.cy,P,In(D.y01,D.x01),In(R.y01,R.x01),!p):(o.arc(D.cx,D.cy,P,In(D.y01,D.x01),In(D.y11,D.x11),!p),o.arc(0,0,f,In(D.cy+D.y11,D.cx+D.x11),In(R.cy+R.y11,R.cx+R.x11),!p),o.arc(R.cx,R.cy,P,In(R.y11,R.x11),In(R.y01,R.x01),!p))):(o.moveTo(I,j),o.arc(0,0,f,g,_,!p)):o.moveTo(I,j),!(h>jn)||!(C>jn)?o.lineTo(L,A):M>jn?(D=gm(L,A,F,H,h,-M,p),R=gm(I,j,B,G,h,-M,p),o.lineTo(D.cx+D.x01,D.cy+D.y01),M<$?o.arc(D.cx,D.cy,M,In(D.y01,D.x01),In(R.y01,R.x01),!p):(o.arc(D.cx,D.cy,M,In(D.y01,D.x01),In(D.y11,D.x11),!p),o.arc(0,0,h,In(D.cy+D.y11,D.cx+D.x11),In(R.cy+R.y11,R.cx+R.x11),p),o.arc(R.cx,R.cy,M,In(R.y11,R.x11),In(R.y01,R.x01),!p))):o.arc(0,0,h,k,S,p)}if(o.closePath(),d)return o=null,d+""||null}return c.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,u=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-lf/2;return[ia(u)*d,Ai(u)*d]},c.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:zt(+d),c):e},c.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:zt(+d),c):t},c.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:zt(+d),c):n},c.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:zt(+d),c):r},c.startAngle=function(d){return arguments.length?(i=typeof d=="function"?d:zt(+d),c):i},c.endAngle=function(d){return arguments.length?(s=typeof d=="function"?d:zt(+d),c):s},c.padAngle=function(d){return arguments.length?(a=typeof d=="function"?d:zt(+d),c):a},c.context=function(d){return arguments.length?(o=d??null,c):o},c}function K5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function IN(e){this._context=e}IN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function jN(e){return new IN(e)}function K_e(e){return e[0]}function G_e(e){return e[1]}function BN(e,t){var n=zt(!0),r=null,i=jN,s=null,a=NN(o);e=typeof e=="function"?e:e===void 0?K_e:zt(e),t=typeof t=="function"?t:t===void 0?G_e:zt(t);function o(l){var c,d=(l=K5(l)).length,u,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=d;++c)!(c<d&&n(u=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(u,c,l),+t(u,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:zt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:zt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:zt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Y_e(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function X_e(e){return e}function Q_e(){var e=X_e,t=Y_e,n=null,r=zt(0),i=zt(Xm),s=zt(0);function a(o){var l,c=(o=K5(o)).length,d,u,h=0,f=new Array(c),b=new Array(c),y=+r.apply(this,arguments),m=Math.min(Xm,Math.max(-Xm,i.apply(this,arguments)-y)),p,g=Math.min(Math.abs(m)/c,s.apply(this,arguments)),_=g*(m<0?-1:1),S;for(l=0;l<c;++l)(S=b[f[l]=l]=+e(o[l],l,o))>0&&(h+=S);for(t!=null?f.sort(function(k,C){return t(b[k],b[C])}):n!=null&&f.sort(function(k,C){return n(o[k],o[C])}),l=0,u=h?(m-c*_)/h:0;l<c;++l,y=p)d=f[l],S=b[d],p=y+(S>0?S*u:0)+_,b[d]={data:o[d],index:l,value:S,startAngle:y,endAngle:p,padAngle:g};return b}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:zt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:zt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:zt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:zt(+o),a):s},a}function Go(){}function k0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Q1(e){this._context=e}Q1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:k0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:k0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J_e(e){return new Q1(e)}function FN(e){this._context=e}FN.prototype={areaStart:Go,areaEnd:Go,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:k0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Z_e(e){return new FN(e)}function zN(e){this._context=e}zN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:k0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ebe(e){return new zN(e)}function HN(e,t){this._basis=new Q1(e),this._beta=t}HN.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const tbe=function e(t){function n(r){return t===1?new Q1(r):new HN(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function E0(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function G5(e,t){this._context=e,this._k=(1-t)/6}G5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:E0(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:E0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nbe=function e(t){function n(r){return new G5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Y5(e,t){this._context=e,this._k=(1-t)/6}Y5.prototype={areaStart:Go,areaEnd:Go,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:E0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rbe=function e(t){function n(r){return new Y5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function X5(e,t){this._context=e,this._k=(1-t)/6}X5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:E0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ibe=function e(t){function n(r){return new X5(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Q5(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>jn){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>jn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/d,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/d}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function WN(e,t){this._context=e,this._alpha=t}WN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Q5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sbe=function e(t){function n(r){return t?new WN(r,t):new G5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function UN(e,t){this._context=e,this._alpha=t}UN.prototype={areaStart:Go,areaEnd:Go,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Q5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const obe=function e(t){function n(r){return t?new UN(r,t):new Y5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function VN(e,t){this._context=e,this._alpha=t}VN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Q5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const abe=function e(t){function n(r){return t?new VN(r,t):new X5(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function qN(e){this._context=e}qN.prototype={areaStart:Go,areaEnd:Go,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function lbe(e){return new qN(e)}function a8(e){return e<0?-1:1}function l8(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(a8(s)+a8(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function c8(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function q_(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function T0(e){this._context=e}T0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:q_(this,this._t0,c8(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,q_(this,c8(this,n=l8(this,e,t)),n);break;default:q_(this,this._t0,n=l8(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function KN(e){this._context=new GN(e)}(KN.prototype=Object.create(T0.prototype)).point=function(e,t){T0.prototype.point.call(this,t,e)};function GN(e){this._context=e}GN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function cbe(e){return new T0(e)}function ube(e){return new KN(e)}function YN(e){this._context=e}YN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=u8(e),i=u8(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function u8(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function dbe(e){return new YN(e)}function J1(e,t){this._context=e,this._t=t}J1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function hbe(e){return new J1(e,.5)}function fbe(e){return new J1(e,0)}function pbe(e){return new J1(e,1)}function d8(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function h8(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function mbe(e,t){return e[t]}function gbe(e){const t=[];return t.key=e,t}function vbe(){var e=zt([]),t=h8,n=d8,r=mbe;function i(s){var a=Array.from(e.apply(this,arguments),gbe),o,l=a.length,c=-1,d;for(const u of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(u,a[o].key,c,s)]).data=u;for(o=0,d=K5(t(a));o<l;++o)a[d[o]].index=o;return n(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:zt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:zt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?h8:typeof s=="function"?s:zt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??d8,i):n},i}function ybe(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}var _be=ap,bbe=j9,xbe=Yu;function wbe(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=_be(e,a);n(o,a)&&bbe(s,xbe(a,e),o)}return s}var Sbe=wbe;function Cbe(e,t){return e!=null&&t in Object(e)}var kbe=Cbe,Ebe=Yu,Tbe=o1,$be=yr,Mbe=c1,Rbe=f5,Abe=Xu;function Lbe(e,t,n){t=Ebe(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Abe(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Rbe(i)&&Mbe(a,i)&&($be(e)||Tbe(e)))}var Dbe=Lbe,Pbe=kbe,Obe=Dbe;function Nbe(e,t){return e!=null&&Obe(e,t,Pbe)}var XN=Nbe,Ibe=Sbe,jbe=XN;function Bbe(e,t){return Ibe(e,t,function(n,r){return jbe(e,r)})}var Fbe=Bbe;function zbe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var J5=zbe,f8=Wu,Hbe=o1,Wbe=yr,p8=f8?f8.isConcatSpreadable:void 0;function Ube(e){return Wbe(e)||Hbe(e)||!!(p8&&e&&e[p8])}var Vbe=Ube,qbe=J5,Kbe=Vbe;function QN(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Kbe),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?QN(o,t-1,n,r,i):qbe(i,o):r||(i[i.length]=o)}return i}var JN=QN,Gbe=JN;function Ybe(e){var t=e==null?0:e.length;return t?Gbe(e,1):[]}var Xbe=Ybe,Qbe=Xbe,Jbe=L9,Zbe=D9;function exe(e){return Zbe(Jbe(e,void 0,Qbe),e+"")}var ZN=exe,txe=Fbe,nxe=ZN,rxe=nxe(function(e,t){return e==null?{}:txe(e,t)}),ixe=rxe;const sxe=vn(ixe);function oxe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var axe=oxe,lxe=V5,cxe=axe,uxe=q5,dxe=1,hxe=2;function fxe(e,t,n,r,i,s){var a=n&dxe,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var u=-1,h=!0,f=n&hxe?new lxe:void 0;for(s.set(e,t),s.set(t,e);++u<o;){var b=e[u],y=t[u];if(r)var m=a?r(y,b,u,t,e,s):r(b,y,u,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!cxe(t,function(p,g){if(!uxe(f,g)&&(b===p||i(b,p,n,r,s)))return f.push(g)})){h=!1;break}}else if(!(b===y||i(b,y,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var eI=fxe;function pxe(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var mxe=pxe;function gxe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Z5=gxe,m8=Wu,g8=x9,vxe=ip,yxe=eI,_xe=mxe,bxe=Z5,xxe=1,wxe=2,Sxe="[object Boolean]",Cxe="[object Date]",kxe="[object Error]",Exe="[object Map]",Txe="[object Number]",$xe="[object RegExp]",Mxe="[object Set]",Rxe="[object String]",Axe="[object Symbol]",Lxe="[object ArrayBuffer]",Dxe="[object DataView]",v8=m8?m8.prototype:void 0,K_=v8?v8.valueOf:void 0;function Pxe(e,t,n,r,i,s,a){switch(n){case Dxe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Lxe:return!(e.byteLength!=t.byteLength||!s(new g8(e),new g8(t)));case Sxe:case Cxe:case Txe:return vxe(+e,+t);case kxe:return e.name==t.name&&e.message==t.message;case $xe:case Rxe:return e==t+"";case Exe:var o=_xe;case Mxe:var l=r&xxe;if(o||(o=bxe),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=wxe,a.set(e,t);var d=yxe(o(e),o(t),r,i,s,a);return a.delete(e),d;case Axe:if(K_)return K_.call(e)==K_.call(t)}return!1}var Oxe=Pxe,Nxe=J5,Ixe=yr;function jxe(e,t,n){var r=t(e);return Ixe(e)?r:Nxe(r,n(e))}var tI=jxe;function Bxe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}var nI=Bxe;function Fxe(){return[]}var rI=Fxe,zxe=nI,Hxe=rI,Wxe=Object.prototype,Uxe=Wxe.propertyIsEnumerable,y8=Object.getOwnPropertySymbols,Vxe=y8?function(e){return e==null?[]:(e=Object(e),zxe(y8(e),function(t){return Uxe.call(e,t)}))}:Hxe,e3=Vxe,qxe=C9,Kxe=qxe(Object.keys,Object),Gxe=Kxe,Yxe=h5,Xxe=Gxe,Qxe=Object.prototype,Jxe=Qxe.hasOwnProperty;function Zxe(e){if(!Yxe(e))return Xxe(e);var t=[];for(var n in Object(e))Jxe.call(e,n)&&n!="constructor"&&t.push(n);return t}var ewe=Zxe,twe=R9,nwe=ewe,rwe=Ku;function iwe(e){return rwe(e)?twe(e):nwe(e)}var cp=iwe,swe=tI,owe=e3,awe=cp;function lwe(e){return swe(e,awe,owe)}var iI=lwe,_8=iI,cwe=1,uwe=Object.prototype,dwe=uwe.hasOwnProperty;function hwe(e,t,n,r,i,s){var a=n&cwe,o=_8(e),l=o.length,c=_8(t),d=c.length;if(l!=d&&!a)return!1;for(var u=l;u--;){var h=o[u];if(!(a?h in t:dwe.call(t,h)))return!1}var f=s.get(e),b=s.get(t);if(f&&b)return f==t&&b==e;var y=!0;s.set(e,t),s.set(t,e);for(var m=a;++u<l;){h=o[u];var p=e[h],g=t[h];if(r)var _=a?r(g,p,h,t,e,s):r(p,g,h,e,t,s);if(!(_===void 0?p===g||i(p,g,n,r,s):_)){y=!1;break}m||(m=h=="constructor")}if(y&&!m){var S=e.constructor,k=t.constructor;S!=k&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof k=="function"&&k instanceof k)&&(y=!1)}return s.delete(e),s.delete(t),y}var fwe=hwe,pwe=gl,mwe=is,gwe=pwe(mwe,"DataView"),vwe=gwe,ywe=gl,_we=is,bwe=ywe(_we,"Promise"),xwe=bwe,wwe=gl,Swe=is,Cwe=wwe(Swe,"Set"),sI=Cwe,kwe=gl,Ewe=is,Twe=kwe(Ewe,"WeakMap"),$we=Twe,Rw=vwe,Aw=a5,Lw=xwe,Dw=sI,Pw=$we,oI=ta,Ju=g9,b8="[object Map]",Mwe="[object Object]",x8="[object Promise]",w8="[object Set]",S8="[object WeakMap]",C8="[object DataView]",Rwe=Ju(Rw),Awe=Ju(Aw),Lwe=Ju(Lw),Dwe=Ju(Dw),Pwe=Ju(Pw),ca=oI;(Rw&&ca(new Rw(new ArrayBuffer(1)))!=C8||Aw&&ca(new Aw)!=b8||Lw&&ca(Lw.resolve())!=x8||Dw&&ca(new Dw)!=w8||Pw&&ca(new Pw)!=S8)&&(ca=function(e){var t=oI(e),n=t==Mwe?e.constructor:void 0,r=n?Ju(n):"";if(r)switch(r){case Rwe:return C8;case Awe:return b8;case Lwe:return x8;case Dwe:return w8;case Pwe:return S8}return t});var Z1=ca,G_=s1,Owe=eI,Nwe=Oxe,Iwe=fwe,k8=Z1,E8=yr,T8=a1,jwe=g5,Bwe=1,$8="[object Arguments]",M8="[object Array]",vm="[object Object]",Fwe=Object.prototype,R8=Fwe.hasOwnProperty;function zwe(e,t,n,r,i,s){var a=E8(e),o=E8(t),l=a?M8:k8(e),c=o?M8:k8(t);l=l==$8?vm:l,c=c==$8?vm:c;var d=l==vm,u=c==vm,h=l==c;if(h&&T8(e)){if(!T8(t))return!1;a=!0,d=!1}if(h&&!d)return s||(s=new G_),a||jwe(e)?Owe(e,t,n,r,i,s):Nwe(e,t,l,n,r,i,s);if(!(n&Bwe)){var f=d&&R8.call(e,"__wrapped__"),b=u&&R8.call(t,"__wrapped__");if(f||b){var y=f?e.value():e,m=b?t.value():t;return s||(s=new G_),i(y,m,n,r,s)}}return h?(s||(s=new G_),Iwe(e,t,n,r,i,s)):!1}var Hwe=zwe,Wwe=Hwe,A8=Ti;function aI(e,t,n,r,i){return e===t?!0:e==null||t==null||!A8(e)&&!A8(t)?e!==e&&t!==t:Wwe(e,t,n,r,aI,i)}var t3=aI,Uwe=t3;function Vwe(e,t){return Uwe(e,t)}var qwe=Vwe;const Kwe=vn(qwe);var Gwe={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"transparent",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}};function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(this,arguments)}function n3(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Ywe=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],Xwe=function(e,t){return bi({},t,e)},Qwe=function(e,t){var n=dge({},e,t);return Ywe.forEach(function(r){Kd(n,r,Xwe(js(n,r),n.text))}),n},lI=x.createContext(),cI=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,s=i===void 0?"default":i,a=x.useMemo(function(){var o=X0e(s)?r5[s]:s;return{animate:r,config:o}},[r,s]);return v.jsx(lI.Provider,{value:a,children:t})},L8={animate:Z.bool,motionConfig:Z.oneOfType([Z.oneOf(Object.keys(r5)),Z.shape({mass:Z.number,tension:Z.number,friction:Z.number,clamp:Z.bool,precision:Z.number,velocity:Z.number,duration:Z.number,easing:Z.func})])};cI.propTypes={children:Z.node.isRequired,animate:L8.animate,config:L8.motionConfig};var _r=function(){return x.useContext(lI)},Jwe=function(e){var t=_r(),n=t.animate,r=t.config,i=function(o){var l=x.useRef();return x.useEffect(function(){l.current=o},[o]),l.current}(e),s=x.useMemo(function(){return C5(i,e)},[i,e]),a=Us({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return qo(a,s)},Zwe={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:Re(S1),PRGn:Re(C1),PiYG:Re(k1),PuOr:Re(E1),RdBu:Re(T1),RdGy:Re($1),RdYlBu:Re(M1),RdYlGn:Re(R1),spectral:Re(A1),blues:Re(U1),greens:Re(V1),greys:Re(q1),oranges:Re(Y1),purples:Re(K1),reds:Re(G1),BuGn:Re(L1),BuPu:Re(D1),GnBu:Re(P1),OrRd:Re(O1),PuBuGn:Re(N1),PuBu:Re(I1),PuRd:Re(j1),RdPu:Re(B1),YlGnBu:Re(F1),YlGn:Re(z1),YlOrBr:Re(H1),YlOrRd:Re(W1)},e2e=Object.keys(Zwe);Re(S1),Re(C1),Re(k1),Re(E1),Re(T1),Re($1),Re(M1),Re(R1),Re(A1),Re(U1),Re(V1),Re(q1),Re(Y1),Re(K1),Re(G1),Re(L1),Re(D1),Re(P1),Re(O1),Re(N1),Re(I1),Re(j1),Re(B1),Re(F1),Re(z1),Re(H1),Re(W1);Z.oneOfType([Z.oneOf(e2e),Z.func,Z.arrayOf(Z.string)]);var t2e={basis:J_e,basisClosed:Z_e,basisOpen:ebe,bundle:tbe,cardinal:nbe,cardinalClosed:rbe,cardinalOpen:ibe,catmullRom:sbe,catmullRomClosed:obe,catmullRomOpen:abe,linear:jN,linearClosed:lbe,monotoneX:cbe,monotoneY:ube,natural:dbe,step:hbe,stepAfter:pbe,stepBefore:fbe},r3=Object.keys(t2e);r3.filter(function(e){return e.endsWith("Closed")});PN(r3,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");PN(r3,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");Z.shape({top:Z.number,right:Z.number,bottom:Z.number,left:Z.number}).isRequired;var n2e=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];Z.oneOf(n2e);_a(U5);var r2e={top:0,right:0,bottom:0,left:0},i3=function(e,t,n){return n===void 0&&(n={}),x.useMemo(function(){var r=bi({},r2e,n);return{margin:r,innerWidth:e-r.left-r.right,innerHeight:t-r.top-r.bottom,outerWidth:e,outerHeight:t}},[e,t,n.top,n.right,n.bottom,n.left])},uI=function(){var e=x.useRef(null),t=x.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=x.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(s){var a=s[0];return r(a.contentRect)})})[0];return x.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},i2e=function(e){return x.useMemo(function(){return Qwe(Gwe,e)},[e])},s2e=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?w1(e.slice("5")):lp(e):function(t){return""+t}},ey=function(e){return x.useMemo(function(){return s2e(e)},[e])},dI=x.createContext(),o2e={},hI=function(e){var t=e.theme,n=t===void 0?o2e:t,r=e.children,i=i2e(n);return v.jsx(dI.Provider,{value:i,children:r})};hI.propTypes={children:Z.node.isRequired,theme:Z.object};var Ut=function(){return x.useContext(dI)},a2e=["outlineWidth","outlineColor","outlineOpacity"],s3=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,n3(e,a2e)},fI=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?x.cloneElement(r,{},t):t};fI.propTypes={children:Z.node.isRequired,condition:Z.bool.isRequired,wrapper:Z.element.isRequired};var l2e={position:"relative"},ty=function(e){var t=e.children,n=e.theme,r=e.renderWrapper,i=r===void 0||r,s=e.isInteractive,a=s===void 0||s,o=e.animate,l=e.motionConfig,c=x.useRef(null);return v.jsx(hI,{theme:n,children:v.jsx(cI,{animate:o,config:l,children:v.jsx(Kce,{container:c,children:v.jsxs(fI,{condition:i,wrapper:v.jsx("div",{style:l2e,ref:c}),children:[t,a&&v.jsx(qce,{})]})})})})};ty.propTypes={children:Z.element.isRequired,isInteractive:Z.bool,renderWrapper:Z.bool,theme:Z.object,animate:Z.bool,motionConfig:Z.string};Z.func.isRequired,Z.bool,Z.bool,Z.object.isRequired,Z.bool.isRequired,Z.string;var pI=function(e){var t=e.children,n=uI(),r=n[0],i=n[1],s=i.width>0&&i.height>0;return v.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:s&&t({width:i.width,height:i.height})})};pI.propTypes={children:Z.func.isRequired};var c2e=["id","colors"],mI=function(e){var t=e.id,n=e.colors,r=n3(e,c2e);return v.jsx("linearGradient",bi({id:t,x1:0,x2:0,y1:0,y2:1},r,{children:n.map(function(i){var s=i.offset,a=i.color,o=i.opacity;return v.jsx("stop",{offset:s+"%",stopColor:a,stopOpacity:o!==void 0?o:1},s)})}))};mI.propTypes={id:Z.string.isRequired,colors:Z.arrayOf(Z.shape({offset:Z.number.isRequired,color:Z.string.isRequired,opacity:Z.number})).isRequired,gradientTransform:Z.string};var gI={linearGradient:mI},$d={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},Ow=x.memo(function(e){var t=e.id,n=e.background,r=n===void 0?$d.background:n,i=e.color,s=i===void 0?$d.color:i,a=e.size,o=a===void 0?$d.size:a,l=e.padding,c=l===void 0?$d.padding:l,d=e.stagger,u=d===void 0?$d.stagger:d,h=o+c,f=o/2,b=c/2;return u===!0&&(h=2*o+2*c),v.jsxs("pattern",{id:t,width:h,height:h,patternUnits:"userSpaceOnUse",children:[v.jsx("rect",{width:h,height:h,fill:r}),v.jsx("circle",{cx:b+f,cy:b+f,r:f,fill:s}),u&&v.jsx("circle",{cx:1.5*c+o+f,cy:1.5*c+o+f,r:f,fill:s})]})});Ow.displayName="PatternDots",Ow.propTypes={id:Z.string.isRequired,color:Z.string.isRequired,background:Z.string.isRequired,size:Z.number.isRequired,padding:Z.number.isRequired,stagger:Z.bool.isRequired};var Qr=function(e){return e*Math.PI/180},ny=function(e){return 180*e/Math.PI},u2e=function(e){return e.startAngle+(e.endAngle-e.startAngle)/2},Ia=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},d2e=function(e){var t=e%360;return t<0&&(t+=360),t},h2e={svg:{align:{left:"start",center:"middle",right:"end",start:"start",middle:"middle",end:"end"},baseline:{top:"text-before-edge",center:"central",bottom:"alphabetic"}},canvas:{align:{left:"left",center:"center",right:"right",start:"left",middle:"center",end:"right"},baseline:{top:"top",center:"middle",bottom:"bottom"}}},Md={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},Nw=x.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?Md.spacing:n,i=e.rotation,s=i===void 0?Md.rotation:i,a=e.background,o=a===void 0?Md.background:a,l=e.color,c=l===void 0?Md.color:l,d=e.lineWidth,u=d===void 0?Md.lineWidth:d,h=Math.round(s)%360,f=Math.abs(r);h>180?h-=360:h>90?h-=180:h<-180?h+=360:h<-90&&(h+=180);var b,y=f,m=f;return h===0?b=`
                M 0 0 L `+y+` 0
                M 0 `+m+" L "+y+" "+m+`
            `:h===90?b=`
                M 0 0 L 0 `+m+`
                M `+y+" 0 L "+y+" "+m+`
            `:(y=Math.abs(f/Math.sin(Qr(h))),m=f/Math.sin(Qr(90-h)),b=h>0?`
                    M 0 `+-m+" L "+2*y+" "+m+`
                    M `+-y+" "+-m+" L "+y+" "+m+`
                    M `+-y+" 0 L "+y+" "+2*m+`
                `:`
                    M `+-y+" "+m+" L "+y+" "+-m+`
                    M `+-y+" "+2*m+" L "+2*y+" "+-m+`
                    M 0 `+2*m+" L "+2*y+` 0
                `),v.jsxs("pattern",{id:t,width:y,height:m,patternUnits:"userSpaceOnUse",children:[v.jsx("rect",{width:y,height:m,fill:o,stroke:"rgba(255, 0, 0, 0.1)",strokeWidth:0}),v.jsx("path",{d:b,strokeWidth:u,stroke:c,strokeLinecap:"square"})]})});Nw.displayName="PatternLines",Nw.propTypes={id:Z.string.isRequired,spacing:Z.number.isRequired,rotation:Z.number.isRequired,background:Z.string.isRequired,color:Z.string.isRequired,lineWidth:Z.number.isRequired};var Rd={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},Iw=x.memo(function(e){var t=e.id,n=e.color,r=n===void 0?Rd.color:n,i=e.background,s=i===void 0?Rd.background:i,a=e.size,o=a===void 0?Rd.size:a,l=e.padding,c=l===void 0?Rd.padding:l,d=e.stagger,u=d===void 0?Rd.stagger:d,h=o+c,f=c/2;return u===!0&&(h=2*o+2*c),v.jsxs("pattern",{id:t,width:h,height:h,patternUnits:"userSpaceOnUse",children:[v.jsx("rect",{width:h,height:h,fill:s}),v.jsx("rect",{x:f,y:f,width:o,height:o,fill:r}),u&&v.jsx("rect",{x:1.5*c+o,y:1.5*c+o,width:o,height:o,fill:r})]})});Iw.displayName="PatternSquares",Iw.propTypes={id:Z.string.isRequired,color:Z.string.isRequired,background:Z.string.isRequired,size:Z.number.isRequired,padding:Z.number.isRequired,stagger:Z.bool.isRequired};var vI={patternDots:Ow,patternLines:Nw,patternSquares:Iw},f2e=["type"],jw=bi({},gI,vI),yI=function(e){var t=e.defs;return!t||t.length<1?null:v.jsx("defs",{"aria-hidden":!0,children:t.map(function(n){var r=n.type,i=n3(n,f2e);return jw[r]?x.createElement(jw[r],bi({key:i.id},i)):null})})};yI.propTypes={defs:Z.arrayOf(Z.shape({type:Z.oneOf(Object.keys(jw)).isRequired,id:Z.string.isRequired}))};var p2e=x.memo(yI),o3=function(e){var t=e.width,n=e.height,r=e.margin,i=e.defs,s=e.children,a=e.role,o=e.ariaLabel,l=e.ariaLabelledBy,c=e.ariaDescribedBy,d=e.isFocusable,u=Ut();return v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,role:a,"aria-label":o,"aria-labelledby":l,"aria-describedby":c,focusable:d,tabIndex:d?0:void 0,children:[v.jsx(p2e,{defs:i}),v.jsx("rect",{width:t,height:n,fill:u.background}),v.jsx("g",{transform:"translate("+r.left+","+r.top+")",children:s})]})};o3.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,margin:Z.shape({top:Z.number.isRequired,left:Z.number.isRequired}).isRequired,defs:Z.array,children:Z.oneOfType([Z.arrayOf(Z.node),Z.node]).isRequired,role:Z.string,isFocusable:Z.bool,ariaLabel:Z.string,ariaLabelledBy:Z.string,ariaDescribedBy:Z.string};var _I=function(e){var t=e.size,n=e.color,r=e.borderWidth,i=e.borderColor;return v.jsx("circle",{r:t/2,fill:n,stroke:i,strokeWidth:r,style:{pointerEvents:"none"}})};_I.propTypes={size:Z.number.isRequired,color:Z.string.isRequired,borderWidth:Z.number.isRequired,borderColor:Z.string.isRequired};var m2e=x.memo(_I),bI=function(e){var t=e.x,n=e.y,r=e.symbol,i=r===void 0?m2e:r,s=e.size,a=e.datum,o=e.color,l=e.borderWidth,c=e.borderColor,d=e.label,u=e.labelTextAnchor,h=u===void 0?"middle":u,f=e.labelYOffset,b=f===void 0?-12:f,y=Ut(),m=_r(),p=m.animate,g=m.config,_=Us({transform:"translate("+t+", "+n+")",config:g,immediate:!p});return v.jsxs(xt.g,{transform:_.transform,style:{pointerEvents:"none"},children:[x.createElement(i,{size:s,color:o,datum:a,borderWidth:l,borderColor:c}),d&&v.jsx("text",{textAnchor:h,y:b,style:s3(y.dots.text),children:d})]})};bI.propTypes={x:Z.number.isRequired,y:Z.number.isRequired,datum:Z.object.isRequired,size:Z.number.isRequired,color:Z.string.isRequired,borderWidth:Z.number.isRequired,borderColor:Z.string.isRequired,symbol:Z.oneOfType([Z.func,Z.object]),label:Z.oneOfType([Z.string,Z.number]),labelTextAnchor:Z.oneOf(["start","middle","end"]),labelYOffset:Z.number};x.memo(bI);var xI=function(e){var t=e.width,n=e.height,r=e.axis,i=e.scale,s=e.value,a=e.lineStyle,o=e.textStyle,l=e.legend,c=e.legendPosition,d=c===void 0?"top-right":c,u=e.legendOffsetX,h=u===void 0?14:u,f=e.legendOffsetY,b=f===void 0?14:f,y=e.legendOrientation,m=y===void 0?"horizontal":y,p=Ut(),g=0,_=0,S=0,k=0;r==="y"?(S=i(s),_=t):(g=i(s),k=n);var C=null;if(l){var T=function(w){var E=w.axis,$=w.width,M=w.height,P=w.position,D=w.offsetX,R=w.offsetY,O=w.orientation,N=0,I=0,j=O==="vertical"?-90:0,L="start";if(E==="x")switch(P){case"top-left":N=-D,I=R,L="end";break;case"top":I=-R,L=O==="horizontal"?"middle":"start";break;case"top-right":N=D,I=R,L=O==="horizontal"?"start":"end";break;case"right":N=D,I=M/2,L=O==="horizontal"?"start":"middle";break;case"bottom-right":N=D,I=M-R,L="start";break;case"bottom":I=M+R,L=O==="horizontal"?"middle":"end";break;case"bottom-left":I=M-R,N=-D,L=O==="horizontal"?"end":"start";break;case"left":N=-D,I=M/2,L=O==="horizontal"?"end":"middle"}else switch(P){case"top-left":N=D,I=-R,L="start";break;case"top":N=$/2,I=-R,L=O==="horizontal"?"middle":"start";break;case"top-right":N=$-D,I=-R,L=O==="horizontal"?"end":"start";break;case"right":N=$+D,L=O==="horizontal"?"start":"middle";break;case"bottom-right":N=$-D,I=R,L="end";break;case"bottom":N=$/2,I=R,L=O==="horizontal"?"middle":"end";break;case"bottom-left":N=D,I=R,L=O==="horizontal"?"start":"end";break;case"left":N=-D,L=O==="horizontal"?"end":"middle"}return{x:N,y:I,rotation:j,textAnchor:L}}({axis:r,width:t,height:n,position:d,offsetX:h,offsetY:b,orientation:m});C=v.jsx("text",{transform:"translate("+T.x+", "+T.y+") rotate("+T.rotation+")",textAnchor:T.textAnchor,dominantBaseline:"central",style:o,children:l})}return v.jsxs("g",{transform:"translate("+g+", "+S+")",children:[v.jsx("line",{x1:0,x2:_,y1:0,y2:k,stroke:p.markers.lineColor,strokeWidth:p.markers.lineStrokeWidth,style:a}),C]})};xI.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,axis:Z.oneOf(["x","y"]).isRequired,scale:Z.func.isRequired,value:Z.oneOfType([Z.number,Z.string,Z.instanceOf(Date)]).isRequired,lineStyle:Z.object,textStyle:Z.object,legend:Z.string,legendPosition:Z.oneOf(["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"]),legendOffsetX:Z.number.isRequired,legendOffsetY:Z.number.isRequired,legendOrientation:Z.oneOf(["horizontal","vertical"]).isRequired};var g2e=x.memo(xI),wI=function(e){var t=e.markers,n=e.width,r=e.height,i=e.xScale,s=e.yScale;return t&&t.length!==0?t.map(function(a,o){return v.jsx(g2e,bi({},a,{width:n,height:r,scale:a.axis==="y"?s:i}),o)}):null};wI.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,xScale:Z.func.isRequired,yScale:Z.func.isRequired,markers:Z.arrayOf(Z.shape({axis:Z.oneOf(["x","y"]).isRequired,value:Z.oneOfType([Z.number,Z.string,Z.instanceOf(Date)]).isRequired,lineStyle:Z.object,textStyle:Z.object}))};var v2e=x.memo(wI),SI=function(e){return m9(e)?e:function(t){return js(t,e)}},ja=function(e){return x.useMemo(function(){return SI(e)},[e])},y2e=function(e,t,n,r,i,s){return e<=i&&i<=e+n&&t<=s&&s<=t+r},Y_=function(e,t){var n,r="touches"in t?t.touches[0]:t,i=r.clientX,s=r.clientY,a=e.getBoundingClientRect(),o=(n=e.getBBox!==void 0?e.getBBox():{width:e.offsetWidth||0,height:e.offsetHeight||0}).width===a.width?1:n.width/a.width;return[(i-a.left)*o,(s-a.top)*o]},_2e=Object.keys(gI),b2e=Object.keys(vI),x2e=function(e,t,n){if(e==="*")return!0;if(m9(e))return e(t);if(m5(e)){var r=n?js(t,n):t;return Kwe(sxe(r,Object.keys(e)),e)}return!1},CI=function(e,t,n,r){var i=r===void 0?{}:r,s=i.dataKey,a=i.colorKey,o=a===void 0?"color":a,l=i.targetKey,c=l===void 0?"fill":l,d=[],u={};return e.length&&t.length&&(d=[].concat(e),t.forEach(function(h){for(var f=function(){var y=n[b],m=y.id,p=y.match;if(x2e(p,h,s)){var g=e.find(function($){return $.id===m});if(g){if(b2e.includes(g.type))if(g.background==="inherit"||g.color==="inherit"){var _=js(h,o),S=g.background,k=g.color,C=m;g.background==="inherit"&&(C=C+".bg."+_,S=_),g.color==="inherit"&&(C=C+".fg."+_,k=_),Kd(h,c,"url(#"+C+")"),u[C]||(d.push(bi({},g,{id:C,background:S,color:k})),u[C]=1)}else Kd(h,c,"url(#"+m+")");else if(_2e.includes(g.type))if(g.colors.map(function($){return $.color}).includes("inherit")){var T=js(h,o),w=m,E=bi({},g,{colors:g.colors.map(function($,M){return $.color!=="inherit"?$:(w=w+"."+M+"."+T,bi({},$,{color:$.color==="inherit"?T:$.color}))})});E.id=w,Kd(h,c,"url(#"+w+")"),u[w]||(d.push(E),u[w]=1)}else Kd(h,c,"url(#"+m+")")}return"break"}},b=0;b<n.length&&f()!=="break";b++);})),d};function w2e(){}var S2e=w2e,X_=sI,C2e=S2e,k2e=Z5,E2e=1/0,T2e=X_&&1/k2e(new X_([,-0]))[1]==E2e?function(e){return new X_(e)}:C2e,$2e=T2e,M2e=V5,R2e=LN,A2e=DN,L2e=q5,D2e=$2e,P2e=Z5,O2e=200;function N2e(e,t,n){var r=-1,i=R2e,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=A2e;else if(s>=O2e){var c=t?null:D2e(e);if(c)return P2e(c);a=!1,i=L2e,l=new M2e}else l=t?[]:o;e:for(;++r<s;){var d=e[r],u=t?t(d):d;if(d=n||d!==0?d:0,a&&u===u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),o.push(d)}else i(l,u,n)||(l!==o&&l.push(u),o.push(d))}return o}var I2e=N2e,j2e=s1,B2e=t3,F2e=1,z2e=2;function H2e(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],d=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var u=new j2e;if(r)var h=r(c,d,l,e,t,u);if(!(h===void 0?B2e(d,c,F2e|z2e,r,u):h))return!1}}return!0}var W2e=H2e,U2e=ss;function V2e(e){return e===e&&!U2e(e)}var kI=V2e,q2e=kI,K2e=cp;function G2e(e){for(var t=K2e(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,q2e(i)]}return t}var Y2e=G2e;function X2e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var EI=X2e,Q2e=W2e,J2e=Y2e,Z2e=EI;function eSe(e){var t=J2e(e);return t.length==1&&t[0][2]?Z2e(t[0][0],t[0][1]):function(n){return n===e||Q2e(n,e,t)}}var tSe=eSe,nSe=t3,rSe=I9,iSe=XN,sSe=_5,oSe=kI,aSe=EI,lSe=Xu,cSe=1,uSe=2;function dSe(e,t){return sSe(e)&&oSe(t)?aSe(lSe(e),t):function(n){var r=rSe(n,e);return r===void 0&&r===t?iSe(n,e):nSe(t,r,cSe|uSe)}}var hSe=dSe;function fSe(e){return function(t){return t==null?void 0:t[e]}}var pSe=fSe,mSe=ap;function gSe(e){return function(t){return mSe(t,e)}}var vSe=gSe,ySe=pSe,_Se=vSe,bSe=_5,xSe=Xu;function wSe(e){return bSe(e)?ySe(xSe(e)):_Se(e)}var SSe=wSe,CSe=tSe,kSe=hSe,ESe=u1,TSe=yr,$Se=SSe;function MSe(e){return typeof e=="function"?e:e==null?ESe:typeof e=="object"?TSe(e)?kSe(e[0],e[1]):CSe(e):$Se(e)}var a3=MSe,RSe=a3,ASe=I2e;function LSe(e,t){return e&&e.length?ASe(e,RSe(t)):[]}var DSe=LSe;const D8=vn(DSe);var PSe=_9,OSe=cp;function NSe(e,t){return e&&PSe(e,t,OSe)}var ISe=NSe,jSe=Ku;function BSe(e,t){return function(n,r){if(n==null)return n;if(!jSe(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var FSe=BSe,zSe=ISe,HSe=FSe,WSe=HSe(zSe),TI=WSe,USe=TI,VSe=Ku;function qSe(e,t){var n=-1,r=VSe(e)?Array(e.length):[];return USe(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var KSe=qSe;function GSe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var YSe=GSe,P8=d1;function XSe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=P8(e),a=t!==void 0,o=t===null,l=t===t,c=P8(t);if(!o&&!c&&!s&&e>t||s&&a&&l&&!o&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e<t||c&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}var QSe=XSe,JSe=QSe;function ZSe(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var l=JSe(i[r],s[r]);if(l){if(r>=o)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var eCe=ZSe,Q_=h1,tCe=ap,nCe=a3,rCe=KSe,iCe=YSe,sCe=sp,oCe=eCe,aCe=u1,lCe=yr;function cCe(e,t,n){t.length?t=Q_(t,function(s){return lCe(s)?function(a){return tCe(a,s.length===1?s[0]:s)}:s}):t=[aCe];var r=-1;t=Q_(t,sCe(nCe));var i=rCe(e,function(s,a,o){var l=Q_(t,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return iCe(i,function(s,a){return oCe(s,a,n)})}var uCe=cCe,dCe=JN,hCe=uCe,fCe=y5,O8=P9;fCe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&O8(e,t[0],t[1])?t=[]:n>2&&O8(t[0],t[1],t[2])&&(t=[t[0]]),hCe(e,dCe(t,1),[])});var N8=l1;N8&&N8.isDate;var J_=new Date,Z_=new Date;function Tn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=function(s,a){return t(s=new Date(+s),a==null?1:Math.floor(a)),s},i.range=function(s,a,o){var l=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return Tn(function(a){if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return J_.setTime(+s),Z_.setTime(+a),e(J_),e(Z_),Math.floor(n(J_,Z_))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}var $0=Tn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});$0.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):$0};const I8=$0;$0.range;var M0=1e3,du=6e4,R0=36e5,$I=6048e5,MI=Tn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*M0)},function(e,t){return(t-e)/M0},function(e){return e.getUTCSeconds()});const j8=MI;MI.range;var RI=Tn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*M0)},function(e,t){e.setTime(+e+t*du)},function(e,t){return(t-e)/du},function(e){return e.getMinutes()});const pCe=RI;RI.range;var AI=Tn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*M0-e.getMinutes()*du)},function(e,t){e.setTime(+e+t*R0)},function(e,t){return(t-e)/R0},function(e){return e.getHours()});const mCe=AI;AI.range;function wl(e){return Tn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*du)/$I})}var Bw=wl(0),LI=wl(1),DI=wl(2),PI=wl(3),OI=wl(4),NI=wl(5),II=wl(6);Bw.range;LI.range;DI.range;PI.range;OI.range;NI.range;II.range;var jI=Tn(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});const gCe=jI;jI.range;var l3=Tn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});l3.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Tn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};const vCe=l3;l3.range;var BI=Tn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*du)},function(e,t){return(t-e)/du},function(e){return e.getUTCMinutes()});const yCe=BI;BI.range;var FI=Tn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*R0)},function(e,t){return(t-e)/R0},function(e){return e.getUTCHours()});const _Ce=FI;FI.range;function Sl(e){return Tn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/$I})}var Fw=Sl(0),zI=Sl(1),HI=Sl(2),WI=Sl(3),UI=Sl(4),VI=Sl(5),qI=Sl(6);Fw.range;zI.range;HI.range;WI.range;UI.range;VI.range;qI.range;var KI=Tn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});const bCe=KI;KI.range;var c3=Tn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});c3.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:Tn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};const xCe=c3;c3.range;var Fl=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],wCe={millisecond:[],second:Fl.slice(0,1),minute:Fl.slice(0,2),hour:Fl.slice(0,3),day:Fl.slice(0,4),month:Fl.slice(0,5),year:Fl.slice(0,6)},SCe=function(e){return function(t){return wCe[e].forEach(function(n){n(t)}),t}},CCe=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,s=e.useUTC,a=s===void 0||s,o=SCe(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return o(l);var c=a?gN(n):pN(n);return o(c(l))}},kCe=function(e,t,n,r){var i,s,a,o,l=e.min,c=l===void 0?0:l,d=e.max,u=d===void 0?"auto":d,h=e.stacked,f=h!==void 0&&h,b=e.reverse,y=b!==void 0&&b,m=e.clamp,p=m!==void 0&&m,g=e.nice,_=g!==void 0&&g;c==="auto"?i=f===!0?(s=t.minStacked)!=null?s:0:t.min:i=c,u==="auto"?a=f===!0?(o=t.maxStacked)!=null?o:0:t.max:a=u;var S=oc().rangeRound(r==="x"?[0,n]:[n,0]).domain(y?[a,i]:[i,a]).clamp(p);return _===!0?S.nice():typeof _=="number"&&S.nice(_),ECe(S,f)},ECe=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},TCe=function(e,t,n){var r=fve().range([0,n]).domain(t.all);return r.type="point",r},$Ce=function(e,t,n,r){var i=e.round,s=i===void 0||i,a=y1().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(s);return MCe(a)},MCe=function(e){var t=e;return t.type="band",t},RCe=function(e,t,n){var r,i,s=e.format,a=s===void 0?"native":s,o=e.precision,l=o===void 0?"millisecond":o,c=e.min,d=c===void 0?"auto":c,u=e.max,h=u===void 0?"auto":u,f=e.useUTC,b=f===void 0||f,y=e.nice,m=y!==void 0&&y,p=CCe({format:a,precision:l,useUTC:b});r=d==="auto"?p(t.min):a!=="native"?p(d):d,i=h==="auto"?p(t.max):a!=="native"?p(h):h;var g=b?fye():vN();g.range([0,n]),r&&i&&g.domain([r,i]),m===!0?g.nice():typeof m!="object"&&typeof m!="number"||g.nice(m);var _=g;return _.type="time",_.useUTC=b,_},ACe=function(e,t,n,r){var i,s=e.base,a=s===void 0?10:s,o=e.min,l=o===void 0?"auto":o,c=e.max,d=c===void 0?"auto":c;if(t.all.some(function(y){return y===0}))throw new Error("a log scale domain must not include or cross zero");var u,h,f=!1;if(t.all.filter(function(y){return y!=null}).forEach(function(y){f||(i===void 0?i=Math.sign(y):Math.sign(y)!==i&&(f=!0))}),f)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=l==="auto"?t.min:l,h=d==="auto"?t.max:d;var b=nN().domain([u,h]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return b.type="log",b},LCe=function(e,t,n,r){var i,s,a=e.constant,o=a===void 0?1:a,l=e.min,c=l===void 0?"auto":l,d=e.max,u=d===void 0?"auto":d,h=e.reverse,f=h!==void 0&&h;i=c==="auto"?t.min:c,s=u==="auto"?t.max:u;var b=rN().constant(o).rangeRound(r==="x"?[0,n]:[n,0]).nice();f===!0?b.domain([s,i]):b.domain([i,s]);var y=b;return y.type="symlog",y};function u3(e,t,n,r){switch(e.type){case"linear":return kCe(e,t,n,r);case"point":return TCe(e,t,n);case"band":return $Ce(e,t,n,r);case"time":return RCe(e,t,n);case"log":return ACe(e,t,n,r);case"symlog":return LCe(e,t,n,r);default:throw new Error("invalid scale spec")}}var GI=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},YI={millisecond:[I8,I8],second:[j8,j8],minute:[pCe,yCe],hour:[mCe,_Ce],day:[Tn(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),Tn(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[Bw,Fw],sunday:[Bw,Fw],monday:[LI,zI],tuesday:[DI,HI],wednesday:[PI,WI],thursday:[OI,UI],friday:[NI,VI],saturday:[II,qI],month:[gCe,bCe],year:[vCe,xCe]},DCe=Object.keys(YI),PCe=new RegExp("^every\\s*(\\d+)?\\s*("+DCe.join("|")+")s?$","i"),XI=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(PCe);if(n){var r=n[1],i=n[2],s=YI[i][e.useUTC?1:0];if(i==="day"){var a,o,l=e.domain(),c=l[0],d=l[1],u=new Date(d);return u.setDate(u.getDate()+1),(a=(o=s.every(Number(r??1)))==null?void 0:o.range(c,u))!=null?a:[]}if(r===void 0)return e.ticks(s);var h=s.every(Number(r));if(h)return e.ticks(h)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(f=t)=="number"&&isFinite(f)&&Math.floor(f)===f)return e.ticks(t)}var f;return e.domain()};function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(this,arguments)}var QI=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,s=e.tickValues,a=e.tickSize,o=e.tickPadding,l=e.tickRotation,c=e.truncateTickAt,d=e.engine,u=d===void 0?"svg":d,h=XI(r,s),f=h2e[u],b="bandwidth"in r?GI(r):r,y={lineX:0,lineY:0},m={textX:0,textY:0},p=typeof document=="object"&&document.dir==="rtl",g=f.align.center,_=f.baseline.center;return n==="x"?(t=function(S){var k;return{x:(k=b(S))!=null?k:0,y:0}},y.lineY=a*(i==="after"?1:-1),m.textY=(a+o)*(i==="after"?1:-1),_=i==="after"?f.baseline.top:f.baseline.bottom,l===0?g=f.align.center:i==="after"&&l<0||i==="before"&&l>0?(g=f.align[p?"left":"right"],_=f.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(g=f.align[p?"right":"left"],_=f.baseline.center)):(t=function(S){var k;return{x:0,y:(k=b(S))!=null?k:0}},y.lineX=a*(i==="after"?1:-1),m.textX=(a+o)*(i==="after"?1:-1),g=i==="after"?f.align.left:f.align.right),{ticks:h.map(function(S){var k=typeof S=="string"?function(C){var T=String(C).length;return c&&c>0&&T>c?""+String(C).slice(0,c).concat("..."):""+C}(S):S;return Jr({key:S instanceof Date?""+S.valueOf():""+S,value:k},t(S),y,m)}),textAlign:g,textBaseline:_}},JI=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=w1(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return lp(e)},zw=function(e){var t,n=e.width,r=e.height,i=e.scale,s=e.axis,a=e.values,o=(t=a,(Array.isArray(t)?a:void 0)||XI(i,a)),l="bandwidth"in i?GI(i):i,c=s==="x"?o.map(function(d){var u,h;return{key:d instanceof Date?""+d.valueOf():""+d,x1:(u=l(d))!=null?u:0,x2:(h=l(d))!=null?h:0,y1:0,y2:r}}):o.map(function(d){var u,h;return{key:d instanceof Date?""+d.valueOf():""+d,x1:0,x2:n,y1:(u=l(d))!=null?u:0,y2:(h=l(d))!=null?h:0}});return c},OCe=x.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,s=e.lineY,a=e.onClick,o=e.textBaseline,l=e.textAnchor,c=e.animatedProps,d=Ut(),u=d.axis.ticks.line,h=d.axis.ticks.text,f=(t=r==null?void 0:r(n))!=null?t:n,b=x.useMemo(function(){var y={opacity:c.opacity};return a?{style:Jr({},y,{cursor:"pointer"}),onClick:function(m){return a(m,f)}}:{style:y}},[c.opacity,a,f]);return v.jsxs(xt.g,Jr({transform:c.transform},b,{children:[v.jsx("line",{x1:0,x2:i,y1:0,y2:s,style:u}),h.outlineWidth>0&&v.jsx(xt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:h,strokeWidth:2*h.outlineWidth,stroke:h.outlineColor,strokeLinejoin:"round",children:""+f}),v.jsx(xt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:s3(h),children:""+f})]}))}),NCe=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,s=e.y,a=s===void 0?0:s,o=e.length,l=e.ticksPosition,c=e.tickValues,d=e.tickSize,u=d===void 0?5:d,h=e.tickPadding,f=h===void 0?5:h,b=e.tickRotation,y=b===void 0?0:b,m=e.format,p=e.renderTick,g=p===void 0?OCe:p,_=e.truncateTickAt,S=e.legend,k=e.legendPosition,C=k===void 0?"end":k,T=e.legendOffset,w=T===void 0?0:T,E=e.onClick,$=e.ariaHidden,M=Ut(),P=M.axis.legend.text,D=x.useMemo(function(){return JI(m,n)},[m,n]),R=QI({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:u,tickPadding:f,tickRotation:y,truncateTickAt:_}),O=R.ticks,N=R.textAlign,I=R.textBaseline,j=null;if(S!==void 0){var L,A=0,F=0,H=0;t==="y"?(H=-90,A=w,C==="start"?(L="start",F=o):C==="middle"?(L="middle",F=o/2):C==="end"&&(L="end")):(F=w,C==="start"?L="start":C==="middle"?(L="middle",A=o/2):C==="end"&&(L="end",A=o)),j=v.jsxs(v.Fragment,{children:[P.outlineWidth>0&&v.jsx("text",{transform:"translate("+A+", "+F+") rotate("+H+")",textAnchor:L,style:Jr({dominantBaseline:"central"},P),strokeWidth:2*P.outlineWidth,stroke:P.outlineColor,strokeLinejoin:"round",children:S}),v.jsx("text",{transform:"translate("+A+", "+F+") rotate("+H+")",textAnchor:L,style:Jr({dominantBaseline:"central"},P),children:S})]})}var B=_r(),G=B.animate,J=B.config,W=Us({transform:"translate("+i+","+a+")",lineX2:t==="x"?o:0,lineY2:t==="x"?0:o,config:J,immediate:!G}),U=x.useCallback(function(K){return{opacity:1,transform:"translate("+K.x+","+K.y+")",textTransform:"translate("+K.textX+","+K.textY+") rotate("+y+")"}},[y]),z=x.useCallback(function(K){return{opacity:0,transform:"translate("+K.x+","+K.y+")",textTransform:"translate("+K.textX+","+K.textY+") rotate("+y+")"}},[y]),V=ml(O,{keys:function(K){return K.key},initial:U,from:z,enter:U,update:U,leave:{opacity:0},config:J,immediate:!G});return v.jsxs(xt.g,{transform:W.transform,"aria-hidden":$,children:[V(function(K,q,X,ie){return x.createElement(g,Jr({tickIndex:ie,format:D,rotate:y,textBaseline:I,textAnchor:N,truncateTickAt:_,animatedProps:K},q,E?{onClick:E}:{}))}),v.jsx(xt.line,{style:M.axis.domain.line,x1:0,x2:W.lineX2,y1:0,y2:W.lineY2}),j]})},ICe=x.memo(NCe),ZI=["top","right","bottom","left"],jCe=x.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,s={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return v.jsx(v.Fragment,{children:ZI.map(function(a){var o=s[a];if(!o)return null;var l=a==="top"||a==="bottom";return v.jsx(ICe,Jr({},o,{axis:l?"x":"y",x:a==="right"?r:0,y:a==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:a==="top"||a==="left"?"before":"after",truncateTickAt:o.truncateTickAt}),a)})})}),BCe=x.memo(function(e){var t=e.animatedProps,n=Ut();return v.jsx(xt.line,Jr({},t,n.grid.line))}),B8=x.memo(function(e){var t=e.lines,n=_r(),r=n.animate,i=n.config,s=ml(t,{keys:function(a){return a.key},initial:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},from:function(a){return{opacity:0,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},enter:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},update:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},leave:{opacity:0},config:i,immediate:!r});return v.jsx("g",{children:s(function(a,o){return x.createElement(BCe,Jr({},o,{key:o.key,animatedProps:a}))})})}),FCe=x.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,s=e.xValues,a=e.yValues,o=x.useMemo(function(){return!!r&&zw({width:t,height:n,scale:r,axis:"x",values:s})},[r,s,t,n]),l=x.useMemo(function(){return!!i&&zw({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return v.jsxs(v.Fragment,{children:[o&&v.jsx(B8,{lines:o}),l&&v.jsx(B8,{lines:l})]})}),zCe=function(e,t){var n,r=t.axis,i=t.scale,s=t.x,a=s===void 0?0:s,o=t.y,l=o===void 0?0:o,c=t.length,d=t.ticksPosition,u=t.tickValues,h=t.tickSize,f=h===void 0?5:h,b=t.tickPadding,y=b===void 0?5:b,m=t.tickRotation,p=m===void 0?0:m,g=t.format,_=t.legend,S=t.legendPosition,k=S===void 0?"end":S,C=t.legendOffset,T=C===void 0?0:C,w=t.theme,E=QI({axis:r,scale:i,ticksPosition:d,tickValues:u,tickSize:f,tickPadding:y,tickRotation:p,engine:"canvas"}),$=E.ticks,M=E.textAlign,P=E.textBaseline;e.save(),e.translate(a,l),e.textAlign=M,e.textBaseline=P;var D=w.axis.ticks.text;e.font=(D.fontWeight?D.fontWeight+" ":"")+D.fontSize+"px "+D.fontFamily,((n=w.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(w.axis.domain.line.strokeWidth),e.lineCap="square",w.axis.domain.line.stroke&&(e.strokeStyle=w.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var R=typeof g=="function"?g:function(L){return""+L};if($.forEach(function(L){var A;((A=w.axis.ticks.line.strokeWidth)!=null?A:0)>0&&(e.lineWidth=Number(w.axis.ticks.line.strokeWidth),e.lineCap="square",w.axis.ticks.line.stroke&&(e.strokeStyle=w.axis.ticks.line.stroke),e.beginPath(),e.moveTo(L.x,L.y),e.lineTo(L.x+L.lineX,L.y+L.lineY),e.stroke());var F=R(L.value);e.save(),e.translate(L.x+L.textX,L.y+L.textY),e.rotate(Qr(p)),D.outlineWidth>0&&(e.strokeStyle=D.outlineColor,e.lineWidth=2*D.outlineWidth,e.lineJoin="round",e.strokeText(""+F,0,0)),w.axis.ticks.text.fill&&(e.fillStyle=D.fill),e.fillText(""+F,0,0),e.restore()}),_!==void 0){var O=0,N=0,I=0,j="center";r==="y"?(I=-90,O=T,k==="start"?(j="start",N=c):k==="middle"?(j="center",N=c/2):k==="end"&&(j="end")):(N=T,k==="start"?j="start":k==="middle"?(j="center",O=c/2):k==="end"&&(j="end",O=c)),e.translate(O,N),e.rotate(Qr(I)),e.font=(w.axis.legend.text.fontWeight?w.axis.legend.text.fontWeight+" ":"")+w.axis.legend.text.fontSize+"px "+w.axis.legend.text.fontFamily,w.axis.legend.text.fill&&(e.fillStyle=w.axis.legend.text.fill),e.textAlign=j,e.textBaseline="middle",e.fillText(_,0,0)}e.restore()},HCe=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,s=t.height,a=t.top,o=t.right,l=t.bottom,c=t.left,d=t.theme,u={top:a,right:o,bottom:l,left:c};ZI.forEach(function(h){var f=u[h];if(!f)return null;var b=h==="top"||h==="bottom",y=h==="top"||h==="left"?"before":"after",m=b?n:r,p=JI(f.format,m);zCe(e,Jr({},f,{axis:b?"x":"y",x:h==="right"?i:0,y:h==="bottom"?s:0,scale:m,format:p,length:b?i:s,ticksPosition:y,theme:d}))})},F8=function(e,t){var n=t.width,r=t.height,i=t.scale,s=t.axis,a=t.values;zw({width:n,height:r,scale:i,axis:s,values:a}).forEach(function(o){e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.stroke()})},WCe=TI;function UCe(e,t){var n=[];return WCe(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}var VCe=UCe,qCe=nI,KCe=VCe,GCe=a3,YCe=yr;function XCe(e,t){var n=YCe(e)?qCe:KCe;return n(e,GCe(t))}var QCe=XCe;const JCe=vn(QCe);var ZCe=ta,e5e=Ti,t5e="[object Number]";function n5e(e){return typeof e=="number"||e5e(e)&&ZCe(e)==t5e}var r5e=n5e;const z8=vn(r5e);function i5e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var s5e=i5e,o5e=Gu,a5e=cp;function l5e(e,t){return e&&o5e(t,a5e(t),e)}var c5e=l5e,u5e=Gu,d5e=op;function h5e(e,t){return e&&u5e(t,d5e(t),e)}var f5e=h5e,p5e=Gu,m5e=e3;function g5e(e,t){return p5e(e,m5e(e),t)}var v5e=g5e,y5e=J5,_5e=d5,b5e=e3,x5e=rI,w5e=Object.getOwnPropertySymbols,S5e=w5e?function(e){for(var t=[];e;)y5e(t,b5e(e)),e=_5e(e);return t}:x5e,ej=S5e,C5e=Gu,k5e=ej;function E5e(e,t){return C5e(e,k5e(e),t)}var T5e=E5e,$5e=tI,M5e=ej,R5e=op;function A5e(e){return $5e(e,R5e,M5e)}var tj=A5e,L5e=Object.prototype,D5e=L5e.hasOwnProperty;function P5e(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&D5e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var O5e=P5e,N5e=u5;function I5e(e,t){var n=t?N5e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var j5e=I5e,B5e=/\w*$/;function F5e(e){var t=new e.constructor(e.source,B5e.exec(e));return t.lastIndex=e.lastIndex,t}var z5e=F5e,H8=Wu,W8=H8?H8.prototype:void 0,U8=W8?W8.valueOf:void 0;function H5e(e){return U8?Object(U8.call(e)):{}}var W5e=H5e,U5e=u5,V5e=j5e,q5e=z5e,K5e=W5e,G5e=w9,Y5e="[object Boolean]",X5e="[object Date]",Q5e="[object Map]",J5e="[object Number]",Z5e="[object RegExp]",e3e="[object Set]",t3e="[object String]",n3e="[object Symbol]",r3e="[object ArrayBuffer]",i3e="[object DataView]",s3e="[object Float32Array]",o3e="[object Float64Array]",a3e="[object Int8Array]",l3e="[object Int16Array]",c3e="[object Int32Array]",u3e="[object Uint8Array]",d3e="[object Uint8ClampedArray]",h3e="[object Uint16Array]",f3e="[object Uint32Array]";function p3e(e,t,n){var r=e.constructor;switch(t){case r3e:return U5e(e);case Y5e:case X5e:return new r(+e);case i3e:return V5e(e,n);case s3e:case o3e:case a3e:case l3e:case c3e:case u3e:case d3e:case h3e:case f3e:return G5e(e,n);case Q5e:return new r;case J5e:case t3e:return new r(e);case Z5e:return q5e(e);case e3e:return new r;case n3e:return K5e(e)}}var m3e=p3e,g3e=Z1,v3e=Ti,y3e="[object Map]";function _3e(e){return v3e(e)&&g3e(e)==y3e}var b3e=_3e,x3e=b3e,w3e=sp,V8=l1,q8=V8&&V8.isMap,S3e=q8?w3e(q8):x3e,C3e=S3e,k3e=Z1,E3e=Ti,T3e="[object Set]";function $3e(e){return E3e(e)&&k3e(e)==T3e}var M3e=$3e,R3e=M3e,A3e=sp,K8=l1,G8=K8&&K8.isSet,L3e=G8?A3e(G8):R3e,D3e=L3e,P3e=s1,O3e=s5e,N3e=v5,I3e=c5e,j3e=f5e,B3e=b9,F3e=S9,z3e=v5e,H3e=T5e,W3e=iI,U3e=tj,V3e=Z1,q3e=O5e,K3e=m3e,G3e=k9,Y3e=yr,X3e=a1,Q3e=C3e,J3e=ss,Z3e=D3e,eke=cp,tke=op,nke=1,rke=2,ike=4,nj="[object Arguments]",ske="[object Array]",oke="[object Boolean]",ake="[object Date]",lke="[object Error]",rj="[object Function]",cke="[object GeneratorFunction]",uke="[object Map]",dke="[object Number]",ij="[object Object]",hke="[object RegExp]",fke="[object Set]",pke="[object String]",mke="[object Symbol]",gke="[object WeakMap]",vke="[object ArrayBuffer]",yke="[object DataView]",_ke="[object Float32Array]",bke="[object Float64Array]",xke="[object Int8Array]",wke="[object Int16Array]",Ske="[object Int32Array]",Cke="[object Uint8Array]",kke="[object Uint8ClampedArray]",Eke="[object Uint16Array]",Tke="[object Uint32Array]",$t={};$t[nj]=$t[ske]=$t[vke]=$t[yke]=$t[oke]=$t[ake]=$t[_ke]=$t[bke]=$t[xke]=$t[wke]=$t[Ske]=$t[uke]=$t[dke]=$t[ij]=$t[hke]=$t[fke]=$t[pke]=$t[mke]=$t[Cke]=$t[kke]=$t[Eke]=$t[Tke]=!0;$t[lke]=$t[rj]=$t[gke]=!1;function Qm(e,t,n,r,i,s){var a,o=t&nke,l=t&rke,c=t&ike;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!J3e(e))return e;var d=Y3e(e);if(d){if(a=q3e(e),!o)return F3e(e,a)}else{var u=V3e(e),h=u==rj||u==cke;if(X3e(e))return B3e(e,o);if(u==ij||u==nj||h&&!i){if(a=l||h?{}:G3e(e),!o)return l?H3e(e,j3e(a,e)):z3e(e,I3e(a,e))}else{if(!$t[u])return i?e:{};a=K3e(e,u,o)}}s||(s=new P3e);var f=s.get(e);if(f)return f;s.set(e,a),Z3e(e)?e.forEach(function(m){a.add(Qm(m,t,n,m,e,s))}):Q3e(e)&&e.forEach(function(m,p){a.set(p,Qm(m,t,n,p,e,s))});var b=c?l?U3e:W3e:l?tke:eke,y=d?void 0:b(e);return O3e(y||e,function(m,p){y&&(p=m,m=e[p]),N3e(a,p,Qm(m,t,n,p,e,s))}),a}var $ke=Qm;function Mke(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}var Rke=Mke,Ake=ap,Lke=Rke;function Dke(e,t){return t.length<2?e:Ake(e,Lke(t,0,-1))}var Pke=Dke,Oke=Yu,Nke=K9,Ike=Pke,jke=Xu;function Bke(e,t){return t=Oke(t,e),e=Ike(e,t),e==null||delete e[jke(Nke(t))]}var Fke=Bke,zke=p5;function Hke(e){return zke(e)?void 0:e}var Wke=Hke,Uke=h1,Vke=$ke,qke=Fke,Kke=Yu,Gke=Gu,Yke=Wke,Xke=ZN,Qke=tj,Jke=1,Zke=2,eEe=4,tEe=Xke(function(e,t){var n={};if(e==null)return n;var r=!1;t=Uke(t,function(s){return s=Kke(s,e),r||(r=s.length>1),s}),Gke(e,Qke(e),n),r&&(n=Vke(n,Jke|Zke|eEe,Yke));for(var i=t.length;i--;)qke(n,t[i]);return n}),nEe=tEe;const sj=vn(nEe);function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ts.apply(this,arguments)}var Hw={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},rEe=function(e){var t=typeof e;return x.isValidElement(e)||t==="string"||t==="function"||t==="object"},iEe=function(e){var t=typeof e;return t==="string"||t==="function"},cf=function(e){return e.type==="circle"},Ww=function(e){return e.type==="dot"},uf=function(e){return e.type==="rect"},sEe=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(s,a){var o=a.offset||0;return[].concat(s,JCe(t,a.match).map(function(l){var c=r(l),d=i(l);return(cf(a)||uf(a))&&(d.size=d.size+2*o,d.width=d.width+2*o,d.height=d.height+2*o),ts({},sj(a,["match","offset"]),c,d,{size:a.size||d.size,datum:l})}))},[])},oEe=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return d2e(ny(i))},oj=function(e){var t,n,r=e.x,i=e.y,s=e.noteX,a=e.noteY,o=e.noteWidth,l=o===void 0?Hw.noteWidth:o,c=e.noteTextOffset,d=c===void 0?Hw.noteTextOffset:c;if(z8(s))t=r+s;else{if(s.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=s.abs}if(z8(a))n=i+a;else{if(a.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=a.abs}var u=r,h=i,f=oEe(r,i,t,n);if(cf(e)){var b=Ia(Qr(f),e.size/2);u+=b.x,h+=b.y}if(uf(e)){var y=Math.round((f+90)/45)%8;y===0&&(h-=e.height/2),y===1&&(u+=e.width/2,h-=e.height/2),y===2&&(u+=e.width/2),y===3&&(u+=e.width/2,h+=e.height/2),y===4&&(h+=e.height/2),y===5&&(u-=e.width/2,h+=e.height/2),y===6&&(u-=e.width/2),y===7&&(u-=e.width/2,h-=e.height/2)}var m=t,p=t;return(f+90)%360>180?(m-=l,p-=l):p+=l,{points:[[u,h],[t,n],[p,n]],text:[m,n-d],angle:f+90}},aj=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return x.useMemo(function(){return sEe({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},aEe=function(e){var t=e.annotations;return x.useMemo(function(){return t.map(function(n){return ts({},n,{computed:oj(ts({},n))})})},[t])},lEe=function(e){return x.useMemo(function(){return oj(e)},[e])},cEe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Ut(),a=_r(),o=a.animate,l=a.config,c=Us({x:n,y:r,config:l,immediate:!o});return typeof i=="function"?x.createElement(i,{x:n,y:r,datum:t}):v.jsxs(v.Fragment,{children:[s.annotations.text.outlineWidth>0&&v.jsx(xt.text,{x:c.x,y:c.y,style:ts({},s.annotations.text,{strokeLinejoin:"round",strokeWidth:2*s.annotations.text.outlineWidth,stroke:s.annotations.text.outlineColor}),children:i}),v.jsx(xt.text,{x:c.x,y:c.y,style:sj(s.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},Y8=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Ut(),s=x.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,d){return c+" L"+d[0]+","+d[1]},"M"+l[0]+","+l[1])},[t]),a=Jwe(s);if(r&&i.annotations.link.outlineWidth<=0)return null;var o=ts({},i.annotations.link);return r&&(o.strokeLinecap="square",o.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,o.stroke=i.annotations.link.outlineColor,o.opacity=i.annotations.link.outlineOpacity),v.jsx(xt.path,{fill:"none",d:a,style:o})},uEe=function(e){var t=e.x,n=e.y,r=e.size,i=Ut(),s=_r(),a=s.animate,o=s.config,l=Us({x:t,y:n,radius:r/2,config:o,immediate:!a});return v.jsxs(v.Fragment,{children:[i.annotations.outline.outlineWidth>0&&v.jsx(xt.circle,{cx:l.x,cy:l.y,r:l.radius,style:ts({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),v.jsx(xt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},dEe=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?Hw.dotSize:r,s=Ut(),a=_r(),o=a.animate,l=a.config,c=Us({x:t,y:n,radius:i/2,config:l,immediate:!o});return v.jsxs(v.Fragment,{children:[s.annotations.outline.outlineWidth>0&&v.jsx(xt.circle,{cx:c.x,cy:c.y,r:c.radius,style:ts({},s.annotations.outline,{fill:"none",strokeWidth:2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),v.jsx(xt.circle,{cx:c.x,cy:c.y,r:c.radius,style:s.annotations.symbol})]})},hEe=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,s=e.borderRadius,a=s===void 0?6:s,o=Ut(),l=_r(),c=l.animate,d=l.config,u=Us({x:t-r/2,y:n-i/2,width:r,height:i,config:d,immediate:!c});return v.jsxs(v.Fragment,{children:[o.annotations.outline.outlineWidth>0&&v.jsx(xt.rect,{x:u.x,y:u.y,rx:a,ry:a,width:u.width,height:u.height,style:ts({},o.annotations.outline,{fill:"none",strokeWidth:o.annotations.outline.strokeWidth+2*o.annotations.outline.outlineWidth,stroke:o.annotations.outline.outlineColor,opacity:o.annotations.outline.outlineOpacity})}),v.jsx(xt.rect,{x:u.x,y:u.y,rx:a,ry:a,width:u.width,height:u.height,style:o.annotations.outline})]})},fEe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=lEe(e);if(!rEe(i))throw new Error("note should be a valid react element");return v.jsxs(v.Fragment,{children:[v.jsx(Y8,{points:s.points,isOutline:!0}),cf(e)&&v.jsx(uEe,{x:n,y:r,size:e.size}),Ww(e)&&v.jsx(dEe,{x:n,y:r,size:e.size}),uf(e)&&v.jsx(hEe,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),v.jsx(Y8,{points:s.points}),v.jsx(cEe,{datum:t,x:s.text[0],y:s.text[1],note:i})]})},X8=function(e,t){t.forEach(function(n,r){var i=n[0],s=n[1];r===0?e.moveTo(i,s):e.lineTo(i,s)})},pEe=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!iEe(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),X8(e,i.computed.points),e.stroke(),e.lineCap="butt"),cf(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Ww(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),uf(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),X8(e,i.computed.points),e.stroke(),cf(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Ww(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),uf(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A0.apply(this,arguments)}function Q8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mEe(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(i,s){if(i){if(typeof i=="string")return Q8(i,s);var a=Object.prototype.toString.call(i).slice(8,-1);return a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set"?Array.from(i):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Q8(i,s):void 0}}(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var lj={nivo:["#e8c1a0","#f47560","#f1e15b","#e8a838","#61cdbb","#97e3d5"],category10:_N,accent:bN,dark2:xN,paired:wN,pastel1:SN,pastel2:CN,set1:kN,set2:EN,set3:U5,tableau10:gye},gEe=Object.keys(lj),cj={brown_blueGreen:S1,purpleRed_green:C1,pink_yellowGreen:k1,purple_orange:E1,red_blue:T1,red_grey:$1,red_yellow_blue:M1,red_yellow_green:R1,spectral:A1},vEe=Object.keys(cj),yEe={brown_blueGreen:vye,purpleRed_green:yye,pink_yellowGreen:_ye,purple_orange:bye,red_blue:xye,red_grey:wye,red_yellow_blue:Sye,red_yellow_green:TN,spectral:Cye},uj={blues:U1,greens:V1,greys:q1,oranges:Y1,purples:K1,reds:G1,blue_green:L1,blue_purple:D1,green_blue:P1,orange_red:O1,purple_blue_green:N1,purple_blue:I1,purple_red:j1,red_purple:B1,yellow_green_blue:F1,yellow_green:z1,yellow_orange_brown:H1,yellow_orange_red:W1},_Ee=Object.keys(uj),bEe={blues:Oye,greens:Nye,greys:Iye,oranges:Fye,purples:jye,reds:Bye,turbo:Gye,viridis:AN,inferno:Xye,magma:Yye,plasma:Qye,cividis:zye,warm:Wye,cool:RN,cubehelixDefault:Hye,blue_green:kye,blue_purple:Eye,green_blue:Tye,orange_red:$ye,purple_blue_green:Mye,purple_blue:Rye,purple_red:Aye,red_purple:Lye,yellow_green_blue:Dye,yellow_green:$N,yellow_orange_brown:Pye,yellow_orange_red:MN},eb=A0({},lj,cj,uj),xEe=function(e){return gEe.includes(e)},wEe=function(e){return vEe.includes(e)},SEe=function(e){return _Ee.includes(e)},CEe={rainbow:Uye,sinebow:Kye};A0({},yEe,bEe,CEe);var kEe=function(e,t){if(typeof e=="function")return e;if(m5(e)){if(function(l){return l.theme!==void 0}(e)){if(t===void 0)throw new Error("Unable to use color from theme as no theme was provided");var n=js(t,e.theme);if(n===void 0)throw new Error("Color from theme is undefined at path: '"+e.theme+"'");return function(){return n}}if(function(l){return l.from!==void 0}(e)){var r=function(l){return js(l,e.from)};if(Array.isArray(e.modifiers)){for(var i,s=[],a=function(){var l=i.value,c=l[0],d=l[1];if(c==="brighter")s.push(function(u){return u.brighter(d)});else if(c==="darker")s.push(function(u){return u.darker(d)});else{if(c!=="opacity")throw new Error("Invalid color modifier: '"+c+"', must be one of: 'brighter', 'darker', 'opacity'");s.push(function(u){return u.opacity=d,u})}},o=mEe(e.modifiers);!(i=o()).done;)a();return s.length===0?r:function(l){return s.reduce(function(c,d){return d(c)},au(r(l))).toString()}}return r}throw new Error("Invalid color spec, you should either specify 'theme' or 'from' when using a config object")}return function(){return e}},hu=function(e,t){return x.useMemo(function(){return kEe(e,t)},[e,t])};Z.oneOfType([Z.string,Z.func,Z.shape({theme:Z.string.isRequired}),Z.shape({from:Z.string.isRequired,modifiers:Z.arrayOf(Z.array)})]);var EEe=function(e,t){if(typeof e=="function")return e;var n=typeof t=="function"?t:function(u){return js(u,t)};if(Array.isArray(e)){var r=_a(e),i=function(u){return r(n(u))};return i.scale=r,i}if(m5(e)){if(function(u){return u.datum!==void 0}(e))return function(u){return js(u,e.datum)};if(function(u){return u.scheme!==void 0}(e)){if(xEe(e.scheme)){var s=_a(eb[e.scheme]),a=function(u){return s(n(u))};return a.scale=s,a}if(wEe(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>11))throw new Error("Invalid size '"+e.size+"' for diverging color scheme '"+e.scheme+"', must be between 3~11");var o=_a(eb[e.scheme][e.size||11]),l=function(u){return o(n(u))};return l.scale=o,l}if(SEe(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>9))throw new Error("Invalid size '"+e.size+"' for sequential color scheme '"+e.scheme+"', must be between 3~9");var c=_a(eb[e.scheme][e.size||9]),d=function(u){return c(n(u))};return d.scale=c,d}}throw new Error("Invalid colors, when using an object, you should either pass a 'datum' or a 'scheme' property")}return function(){return e}},dj=function(e,t){return x.useMemo(function(){return EEe(e,t)},[e,t])},TEe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return v.jsx("circle",{r:r/2,cx:t+r/2,cy:n+r/2,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})},$Ee=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return v.jsx("g",{transform:"translate("+t+","+n+")",children:v.jsx("path",{d:`
                    M`+r/2+` 0
                    L`+.8*r+" "+r/2+`
                    L`+r/2+" "+r+`
                    L`+.2*r+" "+r/2+`
                    L`+r/2+` 0
                `,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})},MEe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return v.jsx("rect",{x:t,y:n,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,width:r,height:r,style:{pointerEvents:"none"}})},REe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return v.jsx("g",{transform:"translate("+t+","+n+")",children:v.jsx("path",{d:`
                M`+r/2+` 0
                L`+r+" "+r+`
                L0 `+r+`
                L`+r/2+` 0
            `,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})};function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xa.apply(this,arguments)}var AEe={top:0,right:0,bottom:0,left:0},d3=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,s=e.itemCount,a=e.itemWidth,o=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var l=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:xa({},AEe,i),c=l.left+l.right,d=l.top+l.bottom,u=a+c,h=o+d,f=(s-1)*r;return n==="row"?u=a*s+f+c:n==="column"&&(h=o*s+f+d),{width:u,height:h,padding:l}},hj=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,s=e.containerHeight,a=e.width,o=e.height,l=n,c=r;switch(t){case"top":l+=(i-a)/2;break;case"top-right":l+=i-a;break;case"right":l+=i-a,c+=(s-o)/2;break;case"bottom-right":l+=i-a,c+=s-o;break;case"bottom":l+=(i-a)/2,c+=s-o;break;case"bottom-left":c+=s-o;break;case"left":c+=(s-o)/2;break;case"center":l+=(i-a)/2,c+=(s-o)/2}return{x:l,y:c}},fj=function(e){var t,n,r,i,s,a,o=e.direction,l=e.justify,c=e.symbolSize,d=e.symbolSpacing,u=e.width,h=e.height;switch(o){case"left-to-right":t=0,n=(h-c)/2,i=h/2,a="central",l?(r=u,s="end"):(r=c+d,s="start");break;case"right-to-left":t=u-c,n=(h-c)/2,i=h/2,a="central",l?(r=0,s="start"):(r=u-c-d,s="end");break;case"top-to-bottom":t=(u-c)/2,n=0,r=u/2,s="middle",l?(i=h,a="alphabetic"):(i=c+d,a="text-before-edge");break;case"bottom-to-top":t=(u-c)/2,n=h-c,r=u/2,s="middle",l?(i=0,a="text-before-edge"):(i=h-c-d,a="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:s,labelAlignment:a}},LEe={circle:TEe,diamond:$Ee,square:MEe,triangle:REe},DEe=function(e){var t,n,r,i,s,a,o,l,c,d,u,h=e.x,f=e.y,b=e.width,y=e.height,m=e.data,p=e.direction,g=p===void 0?"left-to-right":p,_=e.justify,S=_!==void 0&&_,k=e.textColor,C=e.background,T=C===void 0?"transparent":C,w=e.opacity,E=w===void 0?1:w,$=e.symbolShape,M=$===void 0?"square":$,P=e.symbolSize,D=P===void 0?16:P,R=e.symbolSpacing,O=R===void 0?8:R,N=e.symbolBorderWidth,I=N===void 0?0:N,j=e.symbolBorderColor,L=j===void 0?"transparent":j,A=e.onClick,F=e.onMouseEnter,H=e.onMouseLeave,B=e.toggleSerie,G=e.effects,J=x.useState({}),W=J[0],U=J[1],z=Ut(),V=x.useCallback(function(ge){if(G){var xe=G.filter(function(oe){return oe.on==="hover"}).reduce(function(oe,se){return xa({},oe,se.style)},{});U(xe)}F==null||F(m,ge)},[F,m,G]),K=x.useCallback(function(ge){if(G){var xe=G.filter(function(oe){return oe.on!=="hover"}).reduce(function(oe,se){return xa({},oe,se.style)},{});U(xe)}H==null||H(m,ge)},[H,m,G]),q=fj({direction:g,justify:S,symbolSize:(t=W.symbolSize)!=null?t:D,symbolSpacing:O,width:b,height:y}),X=q.symbolX,ie=q.symbolY,re=q.labelX,ce=q.labelY,ye=q.labelAnchor,ae=q.labelAlignment,Me=[A,F,H,B].some(function(ge){return ge!==void 0}),Pe=typeof M=="function"?M:LEe[M];return v.jsxs("g",{transform:"translate("+h+","+f+")",style:{opacity:(n=W.itemOpacity)!=null?n:E},children:[v.jsx("rect",{width:b,height:y,fill:(r=W.itemBackground)!=null?r:T,style:{cursor:Me?"pointer":"auto"},onClick:function(ge){A==null||A(m,ge),B==null||B(m.id)},onMouseEnter:V,onMouseLeave:K}),x.createElement(Pe,xa({id:m.id,x:X,y:ie,size:(i=W.symbolSize)!=null?i:D,fill:(s=(a=m.fill)!=null?a:m.color)!=null?s:"black",borderWidth:(o=W.symbolBorderWidth)!=null?o:I,borderColor:(l=W.symbolBorderColor)!=null?l:L},m.hidden?z.legends.hidden.symbol:void 0)),v.jsx("text",{textAnchor:ye,style:xa({},s3(z.legends.text),{fill:(c=(d=(u=W.itemTextColor)!=null?u:k)!=null?d:z.legends.text.fill)!=null?c:"black",dominantBaseline:ae,pointerEvents:"none",userSelect:"none"},m.hidden?z.legends.hidden.text:void 0),x:re,y:ce,children:m.label})]})},PEe=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,s=e.padding,a=s===void 0?0:s,o=e.justify,l=e.effects,c=e.itemWidth,d=e.itemHeight,u=e.itemDirection,h=u===void 0?"left-to-right":u,f=e.itemsSpacing,b=f===void 0?0:f,y=e.itemTextColor,m=e.itemBackground,p=m===void 0?"transparent":m,g=e.itemOpacity,_=g===void 0?1:g,S=e.symbolShape,k=e.symbolSize,C=e.symbolSpacing,T=e.symbolBorderWidth,w=e.symbolBorderColor,E=e.onClick,$=e.onMouseEnter,M=e.onMouseLeave,P=e.toggleSerie,D=d3({itemCount:t.length,itemWidth:c,itemHeight:d,itemsSpacing:b,direction:i,padding:a}).padding,R=i==="row"?c+b:0,O=i==="column"?d+b:0;return v.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(N,I){return v.jsx(DEe,{data:N,x:I*R+D.left,y:I*O+D.top,width:c,height:d,direction:h,justify:o,effects:l,textColor:y,background:p,opacity:_,symbolShape:S,symbolSize:k,symbolSpacing:C,symbolBorderWidth:T,symbolBorderColor:w,onClick:E,onMouseEnter:$,onMouseLeave:M,toggleSerie:P},I)})})},pj=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,s=i===void 0?0:i,a=e.translateY,o=a===void 0?0:a,l=e.anchor,c=e.direction,d=e.padding,u=d===void 0?0:d,h=e.justify,f=e.itemsSpacing,b=f===void 0?0:f,y=e.itemWidth,m=e.itemHeight,p=e.itemDirection,g=e.itemTextColor,_=e.itemBackground,S=e.itemOpacity,k=e.symbolShape,C=e.symbolSize,T=e.symbolSpacing,w=e.symbolBorderWidth,E=e.symbolBorderColor,$=e.onClick,M=e.onMouseEnter,P=e.onMouseLeave,D=e.toggleSerie,R=e.effects,O=d3({itemCount:t.length,itemsSpacing:b,itemWidth:y,itemHeight:m,direction:c,padding:u}),N=O.width,I=O.height,j=hj({anchor:l,translateX:s,translateY:o,containerWidth:n,containerHeight:r,width:N,height:I}),L=j.x,A=j.y;return v.jsx(PEe,{data:t,x:L,y:A,direction:c,padding:u,justify:h,effects:R,itemsSpacing:b,itemWidth:y,itemHeight:m,itemDirection:p,itemTextColor:g,itemBackground:_,itemOpacity:S,symbolShape:k,symbolSize:C,symbolSpacing:T,symbolBorderWidth:w,symbolBorderColor:E,onClick:$,onMouseEnter:M,onMouseLeave:P,toggleSerie:typeof D=="boolean"?void 0:D})},OEe={start:"left",middle:"center",end:"right"},NEe=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,s=t.translateX,a=s===void 0?0:s,o=t.translateY,l=o===void 0?0:o,c=t.anchor,d=t.direction,u=t.padding,h=u===void 0?0:u,f=t.justify,b=f!==void 0&&f,y=t.itemsSpacing,m=y===void 0?0:y,p=t.itemWidth,g=t.itemHeight,_=t.itemDirection,S=_===void 0?"left-to-right":_,k=t.itemTextColor,C=t.symbolSize,T=C===void 0?16:C,w=t.symbolSpacing,E=w===void 0?8:w,$=t.theme,M=d3({itemCount:n.length,itemWidth:p,itemHeight:g,itemsSpacing:m,direction:d,padding:h}),P=M.width,D=M.height,R=M.padding,O=hj({anchor:c,translateX:a,translateY:l,containerWidth:r,containerHeight:i,width:P,height:D}),N=O.x,I=O.y,j=d==="row"?p+m:0,L=d==="column"?g+m:0;e.save(),e.translate(N,I),e.font=$.legends.text.fontSize+"px "+($.legends.text.fontFamily||"sans-serif"),n.forEach(function(A,F){var H,B,G=F*j+R.left,J=F*L+R.top,W=fj({direction:S,justify:b,symbolSize:T,symbolSpacing:E,width:p,height:g}),U=W.symbolX,z=W.symbolY,V=W.labelX,K=W.labelY,q=W.labelAnchor,X=W.labelAlignment;e.fillStyle=(H=A.color)!=null?H:"black",e.fillRect(G+U,J+z,T,T),e.textAlign=OEe[q],X==="central"&&(e.textBaseline="middle"),e.fillStyle=(B=k??$.legends.text.fill)!=null?B:"black",e.fillText(String(A.label),G+V,J+K)}),e.restore()};function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(this,arguments)}function Zu(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var J8,IEe=function(e){var t=e.bars,n=e.annotations,r=aj({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var s=i.height,a=i.width;return{width:a,height:s,size:Math.max(a,s)}}});return v.jsx(v.Fragment,{children:r.map(function(i,s){return v.jsx(fEe,bt({},i),s)})})},jEe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return v.jsx(v.Fragment,{children:r.map(function(s,a){var o,l=s[0],c=s[1];return v.jsx(pj,bt({},l,{containerWidth:t,containerHeight:n,data:(o=l.data)!=null?o:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),a)})})},BEe=["data"],FEe=function(e){var t,n=e.bar,r=n.data,i=Zu(n,BEe),s=e.style,a=s.borderColor,o=s.color,l=s.height,c=s.labelColor,d=s.labelOpacity,u=s.labelX,h=s.labelY,f=s.transform,b=s.width,y=e.borderRadius,m=e.borderWidth,p=e.label,g=e.shouldRenderLabel,_=e.isInteractive,S=e.onClick,k=e.onMouseEnter,C=e.onMouseLeave,T=e.tooltip,w=e.isFocusable,E=e.ariaLabel,$=e.ariaLabelledBy,M=e.ariaDescribedBy,P=Ut(),D=o5(),R=D.showTooltipFromEvent,O=D.showTooltipAt,N=D.hideTooltip,I=x.useMemo(function(){return function(){return x.createElement(T,bt({},i,r))}},[T,i,r]),j=x.useCallback(function(G){S==null||S(bt({color:i.color},r),G)},[i,r,S]),L=x.useCallback(function(G){return R(I(),G)},[R,I]),A=x.useCallback(function(G){k==null||k(r,G),R(I(),G)},[r,k,R,I]),F=x.useCallback(function(G){C==null||C(r,G),N()},[r,N,C]),H=x.useCallback(function(){O(I(),[i.absX+i.width/2,i.absY])},[O,I,i]),B=x.useCallback(function(){N()},[N]);return v.jsxs(xt.g,{transform:f,children:[v.jsx(xt.rect,{width:qo(b,function(G){return Math.max(G,0)}),height:qo(l,function(G){return Math.max(G,0)}),rx:y,ry:y,fill:(t=r.fill)!=null?t:o,strokeWidth:m,stroke:a,focusable:w,tabIndex:w?0:void 0,"aria-label":E?E(r):void 0,"aria-labelledby":$?$(r):void 0,"aria-describedby":M?M(r):void 0,onMouseEnter:_?A:void 0,onMouseMove:_?L:void 0,onMouseLeave:_?F:void 0,onClick:_?j:void 0,onFocus:_&&w?H:void 0,onBlur:_&&w?B:void 0}),g&&v.jsx(xt.text,{x:u,y:h,textAnchor:"middle",dominantBaseline:"central",fillOpacity:d,style:bt({},P.labels.text,{pointerEvents:"none",fill:c}),children:p})]})},zEe=["color","label"],HEe=function(e){var t=e.color,n=e.label,r=Zu(e,zEe);return v.jsx(u9,{id:n,value:r.formattedValue,enableChip:!0,color:t})},St={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:HEe,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},jt=bt({},St,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:FEe,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),Rn=bt({},St,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(J8=window.devicePixelRatio)!=null?J8:1}),mj=function(e,t,n,r,i,s){return u3(r,{all:e.map(t),min:0,max:0},i,s).padding(n)},gj=function(e,t){return e.map(function(n){return bt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},ry=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},iy=function(e){return[e,Number(e)]},WEe=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],h3=function(e,t){return e>t},vj=function(e,t){return e<t},yj=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},UEe=function(e){return h3(e,0)?0:e},VEe=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getColor,o=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,d=c===void 0?0:c,u=e.keys,h=e.xScale,f=e.yScale,b=e.margin,y=n?vj:h3,m=i.map(ry),p=[];return u.forEach(function(g,_){return yj(0,h.domain().length).forEach(function(S){var k,C,T,w=iy(i[S][g]),E=w[0],$=w[1],M=o(i[S]),P=((k=h(M))!=null?k:0)+t*_+d*_,D=y(C=$,0)?(T=f(C))!=null?T:0:r,R=function(N,I){var j;return y(N,0)?r-I:((j=f(N))!=null?j:0)-r}($,D),O={id:g,value:E===null?E:$,formattedValue:s($),hidden:!1,index:S,indexValue:M,data:m[S]};p.push({key:g+"."+O.indexValue,index:p.length,data:O,x:P,y:D,absX:b.left+P,absY:b.top+D,width:t,height:R,color:a(O),label:l(O)})})}),p},qEe=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getIndex,o=e.getColor,l=e.getTooltipLabel,c=e.keys,d=e.innerPadding,u=d===void 0?0:d,h=e.xScale,f=e.yScale,b=e.margin,y=n?vj:h3,m=i.map(ry),p=[];return c.forEach(function(g,_){return yj(0,f.domain().length).forEach(function(S){var k,C,T,w=iy(i[S][g]),E=w[0],$=w[1],M=a(i[S]),P=y(C=$,0)?r:(T=h(C))!=null?T:0,D=((k=f(M))!=null?k:0)+t*_+u*_,R=function(N,I){var j;return y(N,0)?((j=h(N))!=null?j:0)-r:r-I}($,P),O={id:g,value:E===null?E:$,formattedValue:s($),hidden:!1,index:S,indexValue:M,data:m[S]};p.push({key:g+"."+O.indexValue,index:p.length,data:O,x:P,y:D,absX:b.left+P,absY:b.top+D,width:R,height:t,color:o(O),label:l(O)})})}),p},KEe=function(e){var t,n,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,c=e.padding,d=c===void 0?0:c,u=e.innerPadding,h=u===void 0?0:u,f=e.valueScale,b=e.indexScale,y=e.hiddenIds,m=y===void 0?[]:y,p=Zu(e,WEe),g=p.keys.filter(function(A){return!m.includes(A)}),_=gj(p.data,g),S=r==="vertical"?["y","x",o]:["x","y",l],k=S[0],C=S[1],T=S[2],w=mj(_,p.getIndex,d,b,T,C),E=bt({max:s,min:i,reverse:a},f),$=E.min==="auto"?UEe:function(A){return A},M=_.reduce(function(A,F){return[].concat(A,g.map(function(H){return F[H]}))},[]).filter(Boolean),P=$(Math.min.apply(Math,M)),D=(n=Math.max.apply(Math,M),isFinite(n)?n:0),R=u3(E,{all:M,min:P,max:D},k==="x"?o:l,k),O=r==="vertical"?[w,R]:[R,w],N=O[0],I=O[1],j=(w.bandwidth()-h*(g.length-1))/g.length,L=[bt({},p,{data:_,keys:g,innerPadding:h,xScale:N,yScale:I}),j,E.reverse,(t=R(0))!=null?t:0];return{xScale:N,yScale:I,bars:j>0?r==="vertical"?VEe.apply(void 0,L):qEe.apply(void 0,L):[]}},GEe=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],YEe=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},XEe=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,d=e.yScale,u=e.margin,h=[];return l.forEach(function(f){return c.domain().forEach(function(b,y){var m,p,g=f[y],_=(m=c(s(g.data)))!=null?m:0,S=((p=function($){return d($[n?0:1])}(g))!=null?p:0)+.5*o,k=function($,M){var P;return((P=d($[n?1:0]))!=null?P:0)-M}(g,S)-o,C=iy(g.data[f.key]),T=C[0],w=C[1],E={id:f.key,value:T===null?T:w,formattedValue:r(w),hidden:!1,index:y,indexValue:b,data:ry(g.data)};h.push({key:f.key+"."+b,index:h.length,data:E,x:_,y:S,absX:u.left+_,absY:u.top+S,width:t,height:k,color:i(E),label:a(E)})})}),h},QEe=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,d=e.yScale,u=e.margin,h=[];return l.forEach(function(f){return d.domain().forEach(function(b,y){var m,p,g=f[y],_=(m=d(s(g.data)))!=null?m:0,S=((p=function($){return c($[n?1:0])}(g))!=null?p:0)+.5*o,k=function($,M){var P;return((P=c($[n?0:1]))!=null?P:0)-M}(g,S)-o,C=iy(g.data[f.key]),T=C[0],w=C[1],E={id:f.key,value:T===null?T:w,formattedValue:r(w),hidden:!1,index:y,indexValue:b,data:ry(g.data)};h.push({key:f.key+"."+b,index:h.length,data:E,x:S,y:_,absX:u.left+S,absY:u.top+_,width:k,height:t,color:i(E),label:a(E)})})}),h},JEe=function(e){var t,n=e.data,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,c=e.padding,d=c===void 0?0:c,u=e.valueScale,h=e.indexScale,f=e.hiddenIds,b=f===void 0?[]:f,y=Zu(e,GEe),m=y.keys.filter(function(j){return!b.includes(j)}),p=vbe().keys(m).offset(ybe)(gj(n,m)),g=r==="vertical"?["y","x",o]:["x","y",l],_=g[0],S=g[1],k=g[2],C=mj(n,y.getIndex,d,h,k,S),T=bt({max:s,min:i,reverse:a},u),w=(t=YEe(p),u.type==="log"?t.filter(function(j){return j!==0}):t),E=Math.min.apply(Math,w),$=Math.max.apply(Math,w),M=u3(T,{all:w,min:E,max:$},_==="x"?o:l,_),P=r==="vertical"?[C,M]:[M,C],D=P[0],R=P[1],O=y.innerPadding>0?y.innerPadding:0,N=C.bandwidth(),I=[bt({},y,{innerPadding:O,stackedData:p,xScale:D,yScale:R}),N,T.reverse];return{xScale:D,yScale:R,bars:N>0?r==="vertical"?XEe.apply(void 0,I):QEe.apply(void 0,I):[]}},ZEe=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,s=e.layout,a=e.legendLabel,o=e.reverse,l=SI(a??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,d,u){var h=D8(c.map(function(f){var b,y;return{id:(b=f.data.indexValue)!=null?b:"",label:u(f.data),hidden:f.data.hidden,color:(y=f.color)!=null?y:"#000"}}),function(f){return f.id});return d==="horizontal"&&h.reverse(),h}(t,s,l):function(c,d,u,h,f,b){var y=D8(c.map(function(m){var p;return{id:m.data.id,label:b(m.data),hidden:m.data.hidden,color:(p=m.color)!=null?p:"#000"}}),function(m){return m.id});return(d==="vertical"&&h==="stacked"&&u==="column"&&f!==!0||d==="horizontal"&&h==="stacked"&&f===!0)&&y.reverse(),y}(t,s,n,i,o,l)},Z8=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},e4e=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},t4e=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},n4e=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},_j=function(e){var t=e.indexBy,n=t===void 0?St.indexBy:t,r=e.keys,i=r===void 0?St.keys:r,s=e.label,a=s===void 0?St.label:s,o=e.tooltipLabel,l=o===void 0?St.tooltipLabel:o,c=e.valueFormat,d=e.colors,u=d===void 0?St.colors:d,h=e.colorBy,f=h===void 0?St.colorBy:h,b=e.borderColor,y=b===void 0?St.borderColor:b,m=e.labelTextColor,p=m===void 0?St.labelTextColor:m,g=e.groupMode,_=g===void 0?St.groupMode:g,S=e.layout,k=S===void 0?St.layout:S,C=e.reverse,T=C===void 0?St.reverse:C,w=e.data,E=e.minValue,$=E===void 0?St.minValue:E,M=e.maxValue,P=M===void 0?St.maxValue:M,D=e.margin,R=e.width,O=e.height,N=e.padding,I=N===void 0?St.padding:N,j=e.innerPadding,L=j===void 0?St.innerPadding:j,A=e.valueScale,F=A===void 0?St.valueScale:A,H=e.indexScale,B=H===void 0?St.indexScale:H,G=e.initialHiddenIds,J=G===void 0?St.initialHiddenIds:G,W=e.enableLabel,U=W===void 0?St.enableLabel:W,z=e.labelSkipWidth,V=z===void 0?St.labelSkipWidth:z,K=e.labelSkipHeight,q=K===void 0?St.labelSkipHeight:K,X=e.legends,ie=X===void 0?St.legends:X,re=e.legendLabel,ce=e.totalsOffset,ye=ce===void 0?St.totalsOffset:ce,ae=x.useState(J??[]),Me=ae[0],Pe=ae[1],ge=x.useCallback(function(Ie){Pe(function(Ke){return Ke.indexOf(Ie)>-1?Ke.filter(function(rt){return rt!==Ie}):[].concat(Ke,[Ie])})},[]),xe=ja(n),oe=ja(a),se=ja(l),fe=ey(c),Q=Ut(),ne=dj(u,f),he=hu(y,Q),ve=hu(p,Q),Ce=(_==="grouped"?KEe:JEe)({layout:k,reverse:T,data:w,getIndex:xe,keys:i,minValue:$,maxValue:P,width:R,height:O,getColor:ne,padding:I,innerPadding:L,valueScale:F,indexScale:B,hiddenIds:Me,formatValue:fe,getTooltipLabel:se,margin:D}),Te=Ce.bars,we=Ce.xScale,be=Ce.yScale,mt=x.useMemo(function(){return Te.filter(function(Ie){return Ie.data.value!==null}).map(function(Ie,Ke){return bt({},Ie,{index:Ke})})},[Te]),Je=x.useCallback(function(Ie){var Ke=Ie.width,rt=Ie.height;return!!U&&!(V>0&&Ke<V)&&!(q>0&&rt<q)},[U,V,q]),qe=x.useMemo(function(){return i.map(function(Ie){var Ke=Te.find(function(rt){return rt.data.id===Ie});return bt({},Ke,{data:bt({id:Ie},Ke==null?void 0:Ke.data,{hidden:Me.includes(Ie)})})})},[Me,i,Te]),ct=x.useMemo(function(){return ie.map(function(Ie){return[Ie,ZEe({bars:Ie.dataFrom==="keys"?qe:Te,direction:Ie.direction,from:Ie.dataFrom,groupMode:_,layout:k,legendLabel:re,reverse:T})]})},[ie,qe,Te,_,k,re,T]),nt=x.useMemo(function(){return function(Ie,Ke,rt,Xe,ut,gt,bn){Xe===void 0&&(Xe=St.layout),ut===void 0&&(ut=St.groupMode);var Pt=[];if(Ie.length===0)return Pt;var Ot=new Map,Jt=Ie[0].width,nn=Ie[0].height;if(ut==="stacked"){var Vt=new Map;Ie.forEach(function(dt){var Ze=dt.data,Be=Ze.indexValue,vt=Ze.value;Z8(Ot,Be,Number(vt)),e4e(Vt,Be,Number(vt))}),Vt.forEach(function(dt,Ze){var Be,vt,hn,on=Ot.get(Ze)||0;Xe==="vertical"?(Be=Ke(Ze),vt=rt(dt),hn=rt(dt/2)):(Be=Ke(dt),vt=rt(Ze),hn=Ke(dt/2)),Be+=Xe==="vertical"?Jt/2:gt,vt+=Xe==="vertical"?-gt:nn/2,Pt.push({key:"total_"+Ze,x:Be,y:vt,value:on,formattedValue:bn(on),animationOffset:hn})})}else if(ut==="grouped"){var Pn=new Map,xn=new Map;Ie.forEach(function(dt){var Ze=dt.data,Be=Ze.indexValue,vt=Ze.value;Z8(Ot,Be,Number(vt)),t4e(Pn,Be,Number(vt)),n4e(xn,Be)}),Pn.forEach(function(dt,Ze){var Be,vt,hn,on=Ot.get(Ze)||0,br=xn.get(Ze);Xe==="vertical"?(Be=Ke(Ze),vt=rt(dt),hn=rt(dt/2)):(Be=Ke(dt),vt=rt(Ze),hn=Ke(dt/2)),Be+=Xe==="vertical"?br*Jt/2:gt,vt+=Xe==="vertical"?-gt:br*nn/2,Pt.push({key:"total_"+Ze,x:Be,y:vt,value:on,formattedValue:bn(on),animationOffset:hn})})}return Pt}(Te,we,be,k,_,ye,fe)},[Te,we,be,k,_,ye,fe]);return{bars:Te,barsWithValue:mt,xScale:we,yScale:be,getIndex:xe,getLabel:oe,getTooltipLabel:se,formatValue:fe,getColor:ne,getBorderColor:he,getLabelColor:ve,shouldRenderBarLabel:Je,hiddenIds:Me,toggleSerie:ge,legendsWithData:ct,barTotals:nt}},r4e=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,s=i===void 0?jt.layout:i,a=Ut();return ml(t,{keys:function(o){return o.key},from:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},enter:function(o){return{x:o.x,y:o.y,labelOpacity:1}},update:function(o){return{x:o.x,y:o.y,labelOpacity:1}},leave:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(o,l){return v.jsx(xt.text,{x:o.x,y:o.y,fillOpacity:o.labelOpacity,style:bt({},a.labels.text,{pointerEvents:"none",fill:a.text.fill}),fontWeight:"bold",fontSize:a.labels.text.fontSize,fontFamily:a.labels.text.fontFamily,textAnchor:s==="vertical"?"middle":"start",alignmentBaseline:s==="vertical"?"alphabetic":"middle",children:l.formattedValue},l.key)})},i4e=["isInteractive","animate","motionConfig","theme","renderWrapper"],s4e=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,c=e.reverse,d=e.minValue,u=e.maxValue,h=e.valueScale,f=e.indexScale,b=e.padding,y=e.innerPadding,m=e.axisTop,p=e.axisRight,g=e.axisBottom,_=g===void 0?jt.axisBottom:g,S=e.axisLeft,k=S===void 0?jt.axisLeft:S,C=e.enableGridX,T=C===void 0?jt.enableGridX:C,w=e.enableGridY,E=w===void 0?jt.enableGridY:w,$=e.gridXValues,M=e.gridYValues,P=e.layers,D=P===void 0?jt.layers:P,R=e.barComponent,O=R===void 0?jt.barComponent:R,N=e.enableLabel,I=N===void 0?jt.enableLabel:N,j=e.label,L=e.labelSkipWidth,A=L===void 0?jt.labelSkipWidth:L,F=e.labelSkipHeight,H=F===void 0?jt.labelSkipHeight:F,B=e.labelTextColor,G=e.markers,J=G===void 0?jt.markers:G,W=e.colorBy,U=e.colors,z=e.defs,V=z===void 0?jt.defs:z,K=e.fill,q=K===void 0?jt.fill:K,X=e.borderRadius,ie=X===void 0?jt.borderRadius:X,re=e.borderWidth,ce=re===void 0?jt.borderWidth:re,ye=e.borderColor,ae=e.annotations,Me=ae===void 0?jt.annotations:ae,Pe=e.legendLabel,ge=e.tooltipLabel,xe=e.valueFormat,oe=e.isInteractive,se=oe===void 0?jt.isInteractive:oe,fe=e.tooltip,Q=fe===void 0?jt.tooltip:fe,ne=e.onClick,he=e.onMouseEnter,ve=e.onMouseLeave,Ce=e.legends,Te=e.role,we=Te===void 0?jt.role:Te,be=e.ariaLabel,mt=e.ariaLabelledBy,Je=e.ariaDescribedBy,qe=e.isFocusable,ct=qe===void 0?jt.isFocusable:qe,nt=e.barAriaLabel,Ie=e.barAriaLabelledBy,Ke=e.barAriaDescribedBy,rt=e.initialHiddenIds,Xe=e.enableTotals,ut=Xe===void 0?jt.enableTotals:Xe,gt=e.totalsOffset,bn=gt===void 0?jt.totalsOffset:gt,Pt=_r(),Ot=Pt.animate,Jt=Pt.config,nn=i3(s,a,i),Vt=nn.outerWidth,Pn=nn.outerHeight,xn=nn.margin,dt=nn.innerWidth,Ze=nn.innerHeight,Be=_j({indexBy:n,label:j,tooltipLabel:ge,valueFormat:xe,colors:U,colorBy:W,borderColor:ye,labelTextColor:B,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:d,maxValue:u,margin:xn,width:dt,height:Ze,padding:b,innerPadding:y,valueScale:h,indexScale:f,enableLabel:I,labelSkipWidth:A,labelSkipHeight:H,legends:Ce,legendLabel:Pe,initialHiddenIds:rt,totalsOffset:bn}),vt=Be.bars,hn=Be.barsWithValue,on=Be.xScale,br=Be.yScale,El=Be.getLabel,Le=Be.getTooltipLabel,De=Be.getBorderColor,st=Be.getLabelColor,Et=Be.shouldRenderBarLabel,ht=Be.toggleSerie,Kt=Be.legendsWithData,wt=Be.barTotals,Gt=ml(hn,{keys:function(ke){return ke.key},from:function(ke){return bt({borderColor:De(ke),color:ke.color,height:0,labelColor:st(ke),labelOpacity:0,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},enter:function(ke){return{borderColor:De(ke),color:ke.color,height:ke.height,labelColor:st(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},update:function(ke){return{borderColor:De(ke),color:ke.color,height:ke.height,labelColor:st(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},leave:function(ke){return bt({borderColor:De(ke),color:ke.color,height:0,labelColor:st(ke),labelOpacity:0,labelX:ke.width/2,labelY:0,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{labelX:0,labelY:ke.height/2,height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},config:Jt,immediate:!Ot,initial:Ot?void 0:null}),ra=x.useMemo(function(){return{borderRadius:ie,borderWidth:ce,enableLabel:I,isInteractive:se,labelSkipWidth:A,labelSkipHeight:H,onClick:ne,onMouseEnter:he,onMouseLeave:ve,getTooltipLabel:Le,tooltip:Q,isFocusable:ct,ariaLabel:nt,ariaLabelledBy:Ie,ariaDescribedBy:Ke}},[ie,ce,I,Le,se,H,A,ne,he,ve,Q,ct,nt,Ie,Ke]),Tl=CI(V,vt,q,{dataKey:"data",targetKey:"data.fill"}),Un={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};D.includes("annotations")&&(Un.annotations=v.jsx(IEe,{bars:vt,annotations:Me},"annotations")),D.includes("axes")&&(Un.axes=v.jsx(jCe,{xScale:on,yScale:br,width:dt,height:Ze,top:m,right:p,bottom:_,left:k},"axes")),D.includes("bars")&&(Un.bars=v.jsx(x.Fragment,{children:Gt(function(ke,ls){return x.createElement(O,bt({},ra,{bar:ls,style:ke,shouldRenderLabel:Et(ls),label:El(ls.data)}))})},"bars")),D.includes("grid")&&(Un.grid=v.jsx(FCe,{width:dt,height:Ze,xScale:T?on:null,yScale:E?br:null,xValues:$,yValues:M},"grid")),D.includes("legends")&&(Un.legends=v.jsx(jEe,{width:dt,height:Ze,legends:Kt,toggleSerie:ht},"legends")),D.includes("markers")&&(Un.markers=v.jsx(v2e,{markers:J,width:dt,height:Ze,xScale:on,yScale:br},"markers")),D.includes("totals")&&ut&&(Un.totals=v.jsx(r4e,{data:wt,springConfig:Jt,animate:Ot,layout:l},"totals"));var nd=x.useMemo(function(){return bt({},ra,{margin:xn,width:s,height:a,innerWidth:dt,innerHeight:Ze,bars:vt,legendData:Kt,enableLabel:I,xScale:on,yScale:br,tooltip:Q,getTooltipLabel:Le,onClick:ne,onMouseEnter:he,onMouseLeave:ve})},[ra,xn,s,a,dt,Ze,vt,Kt,I,on,br,Q,Le,ne,he,ve]);return v.jsx(o3,{width:Vt,height:Pn,margin:xn,defs:Tl,role:we,ariaLabel:be,ariaLabelledBy:mt,ariaDescribedBy:Je,isFocusable:ct,children:D.map(function(ke,ls){var Mn;return typeof ke=="function"?v.jsx(x.Fragment,{children:x.createElement(ke,nd)},ls):(Mn=Un==null?void 0:Un[ke])!=null?Mn:null})})},o4e=function(e){var t=e.isInteractive,n=t===void 0?jt.isInteractive:t,r=e.animate,i=r===void 0?jt.animate:r,s=e.motionConfig,a=s===void 0?jt.motionConfig:s,o=e.theme,l=e.renderWrapper,c=Zu(e,i4e);return v.jsx(ty,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:v.jsx(s4e,bt({isInteractive:n},c))})},a4e=["isInteractive","renderWrapper","theme"],tb=function(e,t,n,r){return e.find(function(i){return y2e(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},l4e=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,c=e.reverse,d=e.minValue,u=e.maxValue,h=e.valueScale,f=e.indexScale,b=e.padding,y=e.innerPadding,m=e.axisTop,p=e.axisRight,g=e.axisBottom,_=g===void 0?Rn.axisBottom:g,S=e.axisLeft,k=S===void 0?Rn.axisLeft:S,C=e.enableGridX,T=C===void 0?Rn.enableGridX:C,w=e.enableGridY,E=w===void 0?Rn.enableGridY:w,$=e.gridXValues,M=e.gridYValues,P=e.layers,D=P===void 0?Rn.layers:P,R=e.renderBar,O=R===void 0?function(Le,De){var st=De.bar,Et=st.color,ht=st.height,Kt=st.width,wt=st.x,Gt=st.y,ra=De.borderColor,Tl=De.borderRadius,Un=De.borderWidth,nd=De.label,ke=De.labelColor,ls=De.shouldRenderLabel;if(Le.fillStyle=Et,Un>0&&(Le.strokeStyle=ra,Le.lineWidth=Un),Le.beginPath(),Tl>0){var Mn=Math.min(Tl,ht);Le.moveTo(wt+Mn,Gt),Le.lineTo(wt+Kt-Mn,Gt),Le.quadraticCurveTo(wt+Kt,Gt,wt+Kt,Gt+Mn),Le.lineTo(wt+Kt,Gt+ht-Mn),Le.quadraticCurveTo(wt+Kt,Gt+ht,wt+Kt-Mn,Gt+ht),Le.lineTo(wt+Mn,Gt+ht),Le.quadraticCurveTo(wt,Gt+ht,wt,Gt+ht-Mn),Le.lineTo(wt,Gt+Mn),Le.quadraticCurveTo(wt,Gt,wt+Mn,Gt),Le.closePath()}else Le.rect(wt,Gt,Kt,ht);Le.fill(),Un>0&&Le.stroke(),ls&&(Le.textBaseline="middle",Le.textAlign="center",Le.fillStyle=ke,Le.fillText(nd,wt+Kt/2,Gt+ht/2))}:R,N=e.enableLabel,I=N===void 0?Rn.enableLabel:N,j=e.label,L=e.labelSkipWidth,A=L===void 0?Rn.labelSkipWidth:L,F=e.labelSkipHeight,H=F===void 0?Rn.labelSkipHeight:F,B=e.labelTextColor,G=e.colorBy,J=e.colors,W=e.borderRadius,U=W===void 0?Rn.borderRadius:W,z=e.borderWidth,V=z===void 0?Rn.borderWidth:z,K=e.borderColor,q=e.annotations,X=q===void 0?Rn.annotations:q,ie=e.legendLabel,re=e.tooltipLabel,ce=e.valueFormat,ye=e.isInteractive,ae=ye===void 0?Rn.isInteractive:ye,Me=e.tooltip,Pe=Me===void 0?Rn.tooltip:Me,ge=e.onClick,xe=e.onMouseEnter,oe=e.onMouseLeave,se=e.legends,fe=e.pixelRatio,Q=fe===void 0?Rn.pixelRatio:fe,ne=e.canvasRef,he=e.enableTotals,ve=he===void 0?Rn.enableTotals:he,Ce=e.totalsOffset,Te=Ce===void 0?Rn.totalsOffset:Ce,we=x.useRef(null),be=Ut(),mt=i3(s,a,i),Je=mt.margin,qe=mt.innerWidth,ct=mt.innerHeight,nt=mt.outerWidth,Ie=mt.outerHeight,Ke=_j({indexBy:n,label:j,tooltipLabel:re,valueFormat:ce,colors:J,colorBy:G,borderColor:K,labelTextColor:B,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:d,maxValue:u,margin:Je,width:qe,height:ct,padding:b,innerPadding:y,valueScale:h,indexScale:f,enableLabel:I,labelSkipWidth:A,labelSkipHeight:H,legends:se,legendLabel:ie,totalsOffset:Te}),rt=Ke.bars,Xe=Ke.barsWithValue,ut=Ke.xScale,gt=Ke.yScale,bn=Ke.getLabel,Pt=Ke.getTooltipLabel,Ot=Ke.getBorderColor,Jt=Ke.getLabelColor,nn=Ke.shouldRenderBarLabel,Vt=Ke.legendsWithData,Pn=Ke.barTotals,xn=o5(),dt=xn.showTooltipFromEvent,Ze=xn.hideTooltip,Be=aEe({annotations:aj({data:rt,annotations:X,getPosition:function(Le){return{x:Le.x,y:Le.y}},getDimensions:function(Le){var De=Le.width,st=Le.height;return{width:De,height:st,size:Math.max(De,st)}}})}),vt=x.useMemo(function(){return{borderRadius:U,borderWidth:V,isInteractive:ae,isFocusable:!1,labelSkipWidth:A,labelSkipHeight:H,margin:Je,width:s,height:a,innerWidth:qe,innerHeight:ct,bars:rt,legendData:Vt,enableLabel:I,xScale:ut,yScale:gt,tooltip:Pe,getTooltipLabel:Pt,onClick:ge,onMouseEnter:xe,onMouseLeave:oe}},[U,V,ae,A,H,Je,s,a,qe,ct,rt,Vt,I,ut,gt,Pe,Pt,ge,xe,oe]),hn=ey(ce);x.useEffect(function(){var Le,De=(Le=we.current)==null?void 0:Le.getContext("2d");we.current&&De&&(we.current.width=nt*Q,we.current.height=Ie*Q,De.scale(Q,Q),De.fillStyle=be.background,De.fillRect(0,0,nt,Ie),De.translate(Je.left,Je.top),D.forEach(function(st){st==="grid"?typeof be.grid.line.strokeWidth=="number"&&be.grid.line.strokeWidth>0&&(De.lineWidth=be.grid.line.strokeWidth,De.strokeStyle=be.grid.line.stroke,T&&F8(De,{width:qe,height:ct,scale:ut,axis:"x",values:$}),E&&F8(De,{width:qe,height:ct,scale:gt,axis:"y",values:M})):st==="axes"?HCe(De,{xScale:ut,yScale:gt,width:qe,height:ct,top:m,right:p,bottom:_,left:k,theme:be}):st==="bars"?Xe.forEach(function(Et){O(De,{bar:Et,borderColor:Ot(Et),borderRadius:U,borderWidth:V,label:bn(Et.data),labelColor:Jt(Et),shouldRenderLabel:nn(Et)})}):st==="legends"?Vt.forEach(function(Et){var ht=Et[0],Kt=Et[1];NEe(De,bt({},ht,{data:Kt,containerWidth:qe,containerHeight:ct,theme:be}))}):st==="annotations"?pEe(De,{annotations:Be,theme:be}):st==="totals"&&ve?function(Et,ht,Kt,wt){wt===void 0&&(wt=Rn.layout),Et.fillStyle=Kt.text.fill,Et.font="bold "+Kt.labels.text.fontSize+"px "+Kt.labels.text.fontFamily,Et.textBaseline=wt==="vertical"?"alphabetic":"middle",Et.textAlign=wt==="vertical"?"center":"start",ht.forEach(function(Gt){Et.fillText(Gt.formattedValue,Gt.x,Gt.y)})}(De,Pn,be,l):typeof st=="function"&&st(De,vt)}),De.save())},[_,k,p,m,Xe,U,V,Be,T,E,Ot,bn,Jt,$,M,o,a,ct,qe,vt,D,l,Vt,Je.left,Je.top,Ie,nt,Q,O,ut,gt,c,nn,be,s,Pn,ve,hn]);var on=x.useCallback(function(Le){if(rt&&we.current){var De=Y_(we.current,Le),st=De[0],Et=De[1],ht=tb(rt,Je,st,Et);ht!==void 0?(dt(x.createElement(Pe,bt({},ht.data,{color:ht.color,label:ht.label,value:Number(ht.data.value)})),Le),Le.type==="mouseenter"&&(xe==null||xe(ht.data,Le))):Ze()}},[Ze,Je,xe,rt,dt,Pe]),br=x.useCallback(function(Le){if(rt&&we.current){Ze();var De=Y_(we.current,Le),st=De[0],Et=De[1],ht=tb(rt,Je,st,Et);ht&&(oe==null||oe(ht.data,Le))}},[Ze,Je,oe,rt]),El=x.useCallback(function(Le){if(rt&&we.current){var De=Y_(we.current,Le),st=De[0],Et=De[1],ht=tb(rt,Je,st,Et);ht!==void 0&&(ge==null||ge(bt({},ht.data,{color:ht.color}),Le))}},[Je,ge,rt]);return v.jsx("canvas",{ref:function(Le){we.current=Le,ne&&"current"in ne&&(ne.current=Le)},width:nt*Q,height:Ie*Q,style:{width:nt,height:Ie,cursor:ae?"auto":"normal"},onMouseEnter:ae?on:void 0,onMouseMove:ae?on:void 0,onMouseLeave:ae?br:void 0,onClick:ae?El:void 0})},c4e=x.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,s=Zu(e,a4e);return v.jsx(ty,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:v.jsx(l4e,bt({},s,{canvasRef:t}))})});x.forwardRef(function(e,t){return v.jsx(pI,{children:function(n){var r=n.width,i=n.height;return v.jsx(c4e,bt({width:r,height:i},e,{ref:t}))}})});const gh=window.document.documentElement,bj=window.txConsts.customThemes.map(e=>e.name),u4e=window.txConsts.customThemes.map(e=>`theme-${e.name}`),f3=["dark","light"],xj=bj.find(e=>gh.classList.contains(`theme-${e}`))??f3.find(e=>gh.classList.contains(e))??window.txConsts.defaultTheme,wj=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},Sj=e=>{if(f3.includes(e))return{isInvalid:!1,isDefault:!0,isDarkScheme:e==="dark",lightDarkClass:e,customClass:void 0};if(bj.includes(e)){const t=window.txConsts.customThemes.find(n=>n.name===e);if(t){const n=t.isDark;return{isInvalid:!1,isDefault:!1,isDarkScheme:n,lightDarkClass:n?"dark":"light",customClass:`theme-${e}`}}}return console.warn(`Could not find theme'${e}', defaulting to dark.`),{isInvalid:!0,isDefault:!1,isDarkScheme:!0,lightDarkClass:"dark",customClass:void 0}},p3=Ge(xj),d4e=Ge(e=>{const t=e(p3);return Sj(t).isDarkScheme});wj(xj);const Uw=(e,t)=>{var l,c;const{isInvalid:n,isDefault:r,isDarkScheme:i,lightDarkClass:s,customClass:a}=Sj(t);if(n)throw new Error(`invalid theme ${t}`);gh.classList.remove(...f3,...u4e),gh.classList.add(s),a&&gh.classList.add(a);const o=(c=(l=document.getElementById("legacyPageIframe"))==null?void 0:l.contentDocument)==null?void 0:c.body;o&&(i?o.classList.add("theme--dark"):o.classList.remove("theme--dark")),wj(t),console.log(`Changed theme from '${e}' to '${t}'.`)},Cj=()=>{const[e,t]=fr(p3);return{theme:e,setTheme:r=>{r!==e&&(Uw(e,r),t(r))}}},h4e=()=>{const e=et(p3);return()=>e(t=>t==="dark"?(Uw(t,"light"),"light"):t==="light"?(Uw(t,"dark"),"dark"):(console.log("invalid theme",t),t))},m3=()=>lt(d4e);var kj=typeof global=="object"&&global&&global.Object===Object&&global,f4e=typeof self=="object"&&self&&self.Object===Object&&self,os=kj||f4e||Function("return this")(),fu=os.Symbol,Ej=Object.prototype,p4e=Ej.hasOwnProperty,m4e=Ej.toString,Ad=fu?fu.toStringTag:void 0;function g4e(e){var t=p4e.call(e,Ad),n=e[Ad];try{e[Ad]=void 0;var r=!0}catch{}var i=m4e.call(e);return r&&(t?e[Ad]=n:delete e[Ad]),i}var v4e=Object.prototype,y4e=v4e.toString;function _4e(e){return y4e.call(e)}var b4e="[object Null]",x4e="[object Undefined]",e$=fu?fu.toStringTag:void 0;function up(e){return e==null?e===void 0?x4e:b4e:e$&&e$ in Object(e)?g4e(e):_4e(e)}function dp(e){return e!=null&&typeof e=="object"}var g3=Array.isArray;function hp(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var w4e="[object AsyncFunction]",S4e="[object Function]",C4e="[object GeneratorFunction]",k4e="[object Proxy]";function Tj(e){if(!hp(e))return!1;var t=up(e);return t==S4e||t==C4e||t==w4e||t==k4e}var nb=os["__core-js_shared__"],t$=function(){var e=/[^.]+$/.exec(nb&&nb.keys&&nb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function E4e(e){return!!t$&&t$ in e}var T4e=Function.prototype,$4e=T4e.toString;function Cl(e){if(e!=null){try{return $4e.call(e)}catch{}try{return e+""}catch{}}return""}var M4e=/[\\^$.*+?()[\]{}|]/g,R4e=/^\[object .+?Constructor\]$/,A4e=Function.prototype,L4e=Object.prototype,D4e=A4e.toString,P4e=L4e.hasOwnProperty,O4e=RegExp("^"+D4e.call(P4e).replace(M4e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function N4e(e){if(!hp(e)||E4e(e))return!1;var t=Tj(e)?O4e:R4e;return t.test(Cl(e))}function I4e(e,t){return e==null?void 0:e[t]}function kl(e,t){var n=I4e(e,t);return N4e(n)?n:void 0}var Vw=kl(os,"WeakMap"),n$=Object.create,j4e=function(){function e(){}return function(t){if(!hp(t))return{};if(n$)return n$(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function B4e(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var r$=function(){try{var e=kl(Object,"defineProperty");return e({},"",{}),e}catch{}}();function F4e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var z4e=9007199254740991,H4e=/^(?:0|[1-9]\d*)$/;function W4e(e,t){var n=typeof e;return t=t??z4e,!!t&&(n=="number"||n!="symbol"&&H4e.test(e))&&e>-1&&e%1==0&&e<t}function $j(e,t,n){t=="__proto__"&&r$?r$(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Mj(e,t){return e===t||e!==e&&t!==t}var U4e=Object.prototype,V4e=U4e.hasOwnProperty;function Rj(e,t,n){var r=e[t];(!(V4e.call(e,t)&&Mj(r,n))||n===void 0&&!(t in e))&&$j(e,t,n)}function sy(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?$j(n,o,l):Rj(n,o,l)}return n}var q4e=9007199254740991;function Aj(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=q4e}function Lj(e){return e!=null&&Aj(e.length)&&!Tj(e)}var K4e=Object.prototype;function v3(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||K4e;return e===n}function G4e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Y4e="[object Arguments]";function i$(e){return dp(e)&&up(e)==Y4e}var Dj=Object.prototype,X4e=Dj.hasOwnProperty,Q4e=Dj.propertyIsEnumerable,J4e=i$(function(){return arguments}())?i$:function(e){return dp(e)&&X4e.call(e,"callee")&&!Q4e.call(e,"callee")};function Z4e(){return!1}var Pj=typeof exports=="object"&&exports&&!exports.nodeType&&exports,s$=Pj&&typeof module=="object"&&module&&!module.nodeType&&module,e6e=s$&&s$.exports===Pj,o$=e6e?os.Buffer:void 0,t6e=o$?o$.isBuffer:void 0,Oj=t6e||Z4e,n6e="[object Arguments]",r6e="[object Array]",i6e="[object Boolean]",s6e="[object Date]",o6e="[object Error]",a6e="[object Function]",l6e="[object Map]",c6e="[object Number]",u6e="[object Object]",d6e="[object RegExp]",h6e="[object Set]",f6e="[object String]",p6e="[object WeakMap]",m6e="[object ArrayBuffer]",g6e="[object DataView]",v6e="[object Float32Array]",y6e="[object Float64Array]",_6e="[object Int8Array]",b6e="[object Int16Array]",x6e="[object Int32Array]",w6e="[object Uint8Array]",S6e="[object Uint8ClampedArray]",C6e="[object Uint16Array]",k6e="[object Uint32Array]",Ft={};Ft[v6e]=Ft[y6e]=Ft[_6e]=Ft[b6e]=Ft[x6e]=Ft[w6e]=Ft[S6e]=Ft[C6e]=Ft[k6e]=!0;Ft[n6e]=Ft[r6e]=Ft[m6e]=Ft[i6e]=Ft[g6e]=Ft[s6e]=Ft[o6e]=Ft[a6e]=Ft[l6e]=Ft[c6e]=Ft[u6e]=Ft[d6e]=Ft[h6e]=Ft[f6e]=Ft[p6e]=!1;function E6e(e){return dp(e)&&Aj(e.length)&&!!Ft[up(e)]}function y3(e){return function(t){return e(t)}}var Nj=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vh=Nj&&typeof module=="object"&&module&&!module.nodeType&&module,T6e=vh&&vh.exports===Nj,rb=T6e&&kj.process,pu=function(){try{var e=vh&&vh.require&&vh.require("util").types;return e||rb&&rb.binding&&rb.binding("util")}catch{}}(),a$=pu&&pu.isTypedArray,$6e=a$?y3(a$):E6e,M6e=Object.prototype,R6e=M6e.hasOwnProperty;function Ij(e,t){var n=g3(e),r=!n&&J4e(e),i=!n&&!r&&Oj(e),s=!n&&!r&&!i&&$6e(e),a=n||r||i||s,o=a?G4e(e.length,String):[],l=o.length;for(var c in e)(t||R6e.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||W4e(c,l)))&&o.push(c);return o}function jj(e,t){return function(n){return e(t(n))}}var A6e=jj(Object.keys,Object),L6e=Object.prototype,D6e=L6e.hasOwnProperty;function P6e(e){if(!v3(e))return A6e(e);var t=[];for(var n in Object(e))D6e.call(e,n)&&n!="constructor"&&t.push(n);return t}function _3(e){return Lj(e)?Ij(e):P6e(e)}function O6e(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var N6e=Object.prototype,I6e=N6e.hasOwnProperty;function j6e(e){if(!hp(e))return O6e(e);var t=v3(e),n=[];for(var r in e)r=="constructor"&&(t||!I6e.call(e,r))||n.push(r);return n}function b3(e){return Lj(e)?Ij(e,!0):j6e(e)}var df=kl(Object,"create");function B6e(){this.__data__=df?df(null):{},this.size=0}function F6e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var z6e="__lodash_hash_undefined__",H6e=Object.prototype,W6e=H6e.hasOwnProperty;function U6e(e){var t=this.__data__;if(df){var n=t[e];return n===z6e?void 0:n}return W6e.call(t,e)?t[e]:void 0}var V6e=Object.prototype,q6e=V6e.hasOwnProperty;function K6e(e){var t=this.__data__;return df?t[e]!==void 0:q6e.call(t,e)}var G6e="__lodash_hash_undefined__";function Y6e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=df&&t===void 0?G6e:t,this}function el(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}el.prototype.clear=B6e;el.prototype.delete=F6e;el.prototype.get=U6e;el.prototype.has=K6e;el.prototype.set=Y6e;function X6e(){this.__data__=[],this.size=0}function oy(e,t){for(var n=e.length;n--;)if(Mj(e[n][0],t))return n;return-1}var Q6e=Array.prototype,J6e=Q6e.splice;function Z6e(e){var t=this.__data__,n=oy(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():J6e.call(t,n,1),--this.size,!0}function eTe(e){var t=this.__data__,n=oy(t,e);return n<0?void 0:t[n][1]}function tTe(e){return oy(this.__data__,e)>-1}function nTe(e,t){var n=this.__data__,r=oy(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function qs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qs.prototype.clear=X6e;qs.prototype.delete=Z6e;qs.prototype.get=eTe;qs.prototype.has=tTe;qs.prototype.set=nTe;var hf=kl(os,"Map");function rTe(){this.size=0,this.__data__={hash:new el,map:new(hf||qs),string:new el}}function iTe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ay(e,t){var n=e.__data__;return iTe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function sTe(e){var t=ay(this,e).delete(e);return this.size-=t?1:0,t}function oTe(e){return ay(this,e).get(e)}function aTe(e){return ay(this,e).has(e)}function lTe(e,t){var n=ay(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ed(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ed.prototype.clear=rTe;ed.prototype.delete=sTe;ed.prototype.get=oTe;ed.prototype.has=aTe;ed.prototype.set=lTe;function Bj(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var cTe=jj(Object.getPrototypeOf,Object);const Fj=cTe;function uTe(){this.__data__=new qs,this.size=0}function dTe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hTe(e){return this.__data__.get(e)}function fTe(e){return this.__data__.has(e)}var pTe=200;function mTe(e,t){var n=this.__data__;if(n instanceof qs){var r=n.__data__;if(!hf||r.length<pTe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ed(r)}return n.set(e,t),this.size=n.size,this}function td(e){var t=this.__data__=new qs(e);this.size=t.size}td.prototype.clear=uTe;td.prototype.delete=dTe;td.prototype.get=hTe;td.prototype.has=fTe;td.prototype.set=mTe;function gTe(e,t){return e&&sy(t,_3(t),e)}function vTe(e,t){return e&&sy(t,b3(t),e)}var zj=typeof exports=="object"&&exports&&!exports.nodeType&&exports,l$=zj&&typeof module=="object"&&module&&!module.nodeType&&module,yTe=l$&&l$.exports===zj,c$=yTe?os.Buffer:void 0,u$=c$?c$.allocUnsafe:void 0;function _Te(e,t){if(t)return e.slice();var n=e.length,r=u$?u$(n):new e.constructor(n);return e.copy(r),r}function bTe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Hj(){return[]}var xTe=Object.prototype,wTe=xTe.propertyIsEnumerable,d$=Object.getOwnPropertySymbols,x3=d$?function(e){return e==null?[]:(e=Object(e),bTe(d$(e),function(t){return wTe.call(e,t)}))}:Hj;function STe(e,t){return sy(e,x3(e),t)}var CTe=Object.getOwnPropertySymbols,Wj=CTe?function(e){for(var t=[];e;)Bj(t,x3(e)),e=Fj(e);return t}:Hj;function kTe(e,t){return sy(e,Wj(e),t)}function Uj(e,t,n){var r=t(e);return g3(e)?r:Bj(r,n(e))}function ETe(e){return Uj(e,_3,x3)}function TTe(e){return Uj(e,b3,Wj)}var qw=kl(os,"DataView"),Kw=kl(os,"Promise"),Gw=kl(os,"Set"),h$="[object Map]",$Te="[object Object]",f$="[object Promise]",p$="[object Set]",m$="[object WeakMap]",g$="[object DataView]",MTe=Cl(qw),RTe=Cl(hf),ATe=Cl(Kw),LTe=Cl(Gw),DTe=Cl(Vw),ua=up;(qw&&ua(new qw(new ArrayBuffer(1)))!=g$||hf&&ua(new hf)!=h$||Kw&&ua(Kw.resolve())!=f$||Gw&&ua(new Gw)!=p$||Vw&&ua(new Vw)!=m$)&&(ua=function(e){var t=up(e),n=t==$Te?e.constructor:void 0,r=n?Cl(n):"";if(r)switch(r){case MTe:return g$;case RTe:return h$;case ATe:return f$;case LTe:return p$;case DTe:return m$}return t});const w3=ua;var PTe=Object.prototype,OTe=PTe.hasOwnProperty;function NTe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&OTe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var v$=os.Uint8Array;function S3(e){var t=new e.constructor(e.byteLength);return new v$(t).set(new v$(e)),t}function ITe(e,t){var n=t?S3(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var jTe=/\w*$/;function BTe(e){var t=new e.constructor(e.source,jTe.exec(e));return t.lastIndex=e.lastIndex,t}var y$=fu?fu.prototype:void 0,_$=y$?y$.valueOf:void 0;function FTe(e){return _$?Object(_$.call(e)):{}}function zTe(e,t){var n=t?S3(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var HTe="[object Boolean]",WTe="[object Date]",UTe="[object Map]",VTe="[object Number]",qTe="[object RegExp]",KTe="[object Set]",GTe="[object String]",YTe="[object Symbol]",XTe="[object ArrayBuffer]",QTe="[object DataView]",JTe="[object Float32Array]",ZTe="[object Float64Array]",e8e="[object Int8Array]",t8e="[object Int16Array]",n8e="[object Int32Array]",r8e="[object Uint8Array]",i8e="[object Uint8ClampedArray]",s8e="[object Uint16Array]",o8e="[object Uint32Array]";function a8e(e,t,n){var r=e.constructor;switch(t){case XTe:return S3(e);case HTe:case WTe:return new r(+e);case QTe:return ITe(e,n);case JTe:case ZTe:case e8e:case t8e:case n8e:case r8e:case i8e:case s8e:case o8e:return zTe(e,n);case UTe:return new r;case VTe:case GTe:return new r(e);case qTe:return BTe(e);case KTe:return new r;case YTe:return FTe(e)}}function l8e(e){return typeof e.constructor=="function"&&!v3(e)?j4e(Fj(e)):{}}var c8e="[object Map]";function u8e(e){return dp(e)&&w3(e)==c8e}var b$=pu&&pu.isMap,d8e=b$?y3(b$):u8e,h8e="[object Set]";function f8e(e){return dp(e)&&w3(e)==h8e}var x$=pu&&pu.isSet,p8e=x$?y3(x$):f8e,m8e=1,g8e=2,v8e=4,Vj="[object Arguments]",y8e="[object Array]",_8e="[object Boolean]",b8e="[object Date]",x8e="[object Error]",qj="[object Function]",w8e="[object GeneratorFunction]",S8e="[object Map]",C8e="[object Number]",Kj="[object Object]",k8e="[object RegExp]",E8e="[object Set]",T8e="[object String]",$8e="[object Symbol]",M8e="[object WeakMap]",R8e="[object ArrayBuffer]",A8e="[object DataView]",L8e="[object Float32Array]",D8e="[object Float64Array]",P8e="[object Int8Array]",O8e="[object Int16Array]",N8e="[object Int32Array]",I8e="[object Uint8Array]",j8e="[object Uint8ClampedArray]",B8e="[object Uint16Array]",F8e="[object Uint32Array]",Mt={};Mt[Vj]=Mt[y8e]=Mt[R8e]=Mt[A8e]=Mt[_8e]=Mt[b8e]=Mt[L8e]=Mt[D8e]=Mt[P8e]=Mt[O8e]=Mt[N8e]=Mt[S8e]=Mt[C8e]=Mt[Kj]=Mt[k8e]=Mt[E8e]=Mt[T8e]=Mt[$8e]=Mt[I8e]=Mt[j8e]=Mt[B8e]=Mt[F8e]=!0;Mt[x8e]=Mt[qj]=Mt[M8e]=!1;function Jm(e,t,n,r,i,s){var a,o=t&m8e,l=t&g8e,c=t&v8e;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!hp(e))return e;var d=g3(e);if(d){if(a=NTe(e),!o)return B4e(e,a)}else{var u=w3(e),h=u==qj||u==w8e;if(Oj(e))return _Te(e,o);if(u==Kj||u==Vj||h&&!i){if(a=l||h?{}:l8e(e),!o)return l?kTe(e,vTe(a,e)):STe(e,gTe(a,e))}else{if(!Mt[u])return i?e:{};a=a8e(e,u,o)}}s||(s=new td);var f=s.get(e);if(f)return f;s.set(e,a),p8e(e)?e.forEach(function(m){a.add(Jm(m,t,n,m,e,s))}):d8e(e)&&e.forEach(function(m,p){a.set(p,Jm(m,t,n,p,e,s))});var b=c?l?TTe:ETe:l?b3:_3,y=d?void 0:b(e);return F4e(y||e,function(m,p){y&&(p=m,m=e[p]),Rj(a,p,Jm(m,t,n,p,e,s))}),a}var z8e=1,H8e=4;function zl(e){return Jm(e,z8e|H8e)}function W8e(e){return e}var ib=1,Zm=2,Yw=3,Gd=4,w$=1e-6;function U8e(e){return"translate("+e+",0)"}function V8e(e){return"translate(0,"+e+")"}function q8e(e){return t=>+e(t)}function K8e(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function G8e(){return!this.__axis}function C3(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===ib||e===Gd?-1:1,d=e===Gd||e===Zm?"x":"y",u=e===ib||e===Yw?U8e:V8e;function h(f){var b=r??(t.ticks?t.ticks.apply(t,n):t.domain()),y=i??(t.tickFormat?t.tickFormat.apply(t,n):W8e),m=Math.max(s,0)+o,p=t.range(),g=+p[0]+l,_=+p[p.length-1]+l,S=(t.bandwidth?K8e:q8e)(t.copy(),l),k=f.selection?f.selection():f,C=k.selectAll(".domain").data([null]),T=k.selectAll(".tick").data(b,t).order(),w=T.exit(),E=T.enter().append("g").attr("class","tick"),$=T.select("line"),M=T.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(E),$=$.merge(E.append("line").attr("stroke","currentColor").attr(d+"2",c*s)),M=M.merge(E.append("text").attr("fill","currentColor").attr(d,c*m).attr("dy",e===ib?"0em":e===Yw?"0.71em":"0.32em")),f!==k&&(C=C.transition(f),T=T.transition(f),$=$.transition(f),M=M.transition(f),w=w.transition(f).attr("opacity",w$).attr("transform",function(P){return isFinite(P=S(P))?u(P+l):this.getAttribute("transform")}),E.attr("opacity",w$).attr("transform",function(P){var D=this.parentNode.__axis;return u((D&&isFinite(D=D(P))?D:S(P))+l)})),w.remove(),C.attr("d",e===Gd||e===Zm?a?"M"+c*a+","+g+"H"+l+"V"+_+"H"+c*a:"M"+l+","+g+"V"+_:a?"M"+g+","+c*a+"V"+l+"H"+_+"V"+c*a:"M"+g+","+l+"H"+_),T.attr("opacity",1).attr("transform",function(P){return u(S(P)+l)}),$.attr(d+"2",c*s),M.attr(d,c*m).text(y),k.filter(G8e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Zm?"start":e===Gd?"end":"middle"),k.each(function(){this.__axis=S})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function Y8e(e){return C3(Zm,e)}function X8e(e){return C3(Yw,e)}function Q8e(e){return C3(Gd,e)}var J8e={value:()=>{}};function k3(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new eg(n)}function eg(e){this._=e}function Z8e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}eg.prototype=k3.prototype={constructor:eg,on:function(e,t){var n=this._,r=Z8e(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=e$e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=S$(n[i],e.name,t);else if(t==null)for(i in n)n[i]=S$(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new eg(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function e$e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function S$(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=J8e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xw="http://www.w3.org/1999/xhtml";const C$={svg:"http://www.w3.org/2000/svg",xhtml:Xw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ly(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),C$.hasOwnProperty(t)?{space:C$[t],local:e}:e}function t$e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xw&&t.documentElement.namespaceURI===Xw?t.createElement(e):t.createElementNS(n,e)}}function n$e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gj(e){var t=ly(e);return(t.local?n$e:t$e)(t)}function r$e(){}function E3(e){return e==null?r$e:function(){return this.querySelector(e)}}function i$e(e){typeof e!="function"&&(e=E3(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,d=0;d<a;++d)(l=s[d])&&(c=e.call(l,l.__data__,d,s))&&("__data__"in l&&(c.__data__=l.__data__),o[d]=c);return new Ar(r,this._parents)}function s$e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function o$e(){return[]}function Yj(e){return e==null?o$e:function(){return this.querySelectorAll(e)}}function a$e(e){return function(){return s$e(e.apply(this,arguments))}}function l$e(e){typeof e=="function"?e=a$e(e):e=Yj(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Ar(r,i)}function Xj(e){return function(){return this.matches(e)}}function Qj(e){return function(t){return t.matches(e)}}var c$e=Array.prototype.find;function u$e(e){return function(){return c$e.call(this.children,e)}}function d$e(){return this.firstElementChild}function h$e(e){return this.select(e==null?d$e:u$e(typeof e=="function"?e:Qj(e)))}var f$e=Array.prototype.filter;function p$e(){return Array.from(this.children)}function m$e(e){return function(){return f$e.call(this.children,e)}}function g$e(e){return this.selectAll(e==null?p$e:m$e(typeof e=="function"?e:Qj(e)))}function v$e(e){typeof e!="function"&&(e=Xj(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Ar(r,this._parents)}function Jj(e){return new Array(e.length)}function y$e(){return new Ar(this._enter||this._groups.map(Jj),this._parents)}function L0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}L0.prototype={constructor:L0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function _$e(e){return function(){return e}}function b$e(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new L0(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function x$e(e,t,n,r,i,s,a){var o,l,c=new Map,d=t.length,u=s.length,h=new Array(d),f;for(o=0;o<d;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<u;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new L0(e,s[o]);for(o=0;o<d;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function w$e(e){return e.__data__}function S$e(e,t){if(!arguments.length)return Array.from(this,w$e);var n=t?x$e:b$e,r=this._parents,i=this._groups;typeof e!="function"&&(e=_$e(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var d=r[c],u=i[c],h=u.length,f=C$e(e.call(d,d&&d.__data__,c,r)),b=f.length,y=o[c]=new Array(b),m=a[c]=new Array(b),p=l[c]=new Array(h);n(d,u,y,m,p,f,t);for(var g=0,_=0,S,k;g<b;++g)if(S=y[g]){for(g>=_&&(_=g+1);!(k=m[_])&&++_<b;);S._next=k||null}}return a=new Ar(a,r),a._enter=o,a._exit=l,a}function C$e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function k$e(){return new Ar(this._exit||this._groups.map(Jj),this._parents)}function E$e(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function T$e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],d=r[l],u=c.length,h=o[l]=new Array(u),f,b=0;b<u;++b)(f=c[b]||d[b])&&(h[b]=f);for(;l<i;++l)o[l]=n[l];return new Ar(o,this._parents)}function $$e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function M$e(e){e||(e=R$e);function t(u,h){return u&&h?e(u.__data__,h.__data__):!u-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,d=0;d<o;++d)(c=a[d])&&(l[d]=c);l.sort(t)}return new Ar(i,this._parents).order()}function R$e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function A$e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function L$e(){return Array.from(this)}function D$e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function P$e(){let e=0;for(const t of this)++e;return e}function O$e(){return!this.node()}function N$e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function I$e(e){return function(){this.removeAttribute(e)}}function j$e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function B$e(e,t){return function(){this.setAttribute(e,t)}}function F$e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function z$e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function H$e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function W$e(e,t){var n=ly(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?j$e:I$e:typeof t=="function"?n.local?H$e:z$e:n.local?F$e:B$e)(n,t))}function Zj(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function U$e(e){return function(){this.style.removeProperty(e)}}function V$e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function q$e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function K$e(e,t,n){return arguments.length>1?this.each((t==null?U$e:typeof t=="function"?q$e:V$e)(e,t,n??"")):mu(this.node(),e)}function mu(e,t){return e.style.getPropertyValue(t)||Zj(e).getComputedStyle(e,null).getPropertyValue(t)}function G$e(e){return function(){delete this[e]}}function Y$e(e,t){return function(){this[e]=t}}function X$e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Q$e(e,t){return arguments.length>1?this.each((t==null?G$e:typeof t=="function"?X$e:Y$e)(e,t)):this.node()[e]}function eB(e){return e.trim().split(/^|\s+/)}function T3(e){return e.classList||new tB(e)}function tB(e){this._node=e,this._names=eB(e.getAttribute("class")||"")}tB.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function nB(e,t){for(var n=T3(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function rB(e,t){for(var n=T3(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function J$e(e){return function(){nB(this,e)}}function Z$e(e){return function(){rB(this,e)}}function e7e(e,t){return function(){(t.apply(this,arguments)?nB:rB)(this,e)}}function t7e(e,t){var n=eB(e+"");if(arguments.length<2){for(var r=T3(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?e7e:t?J$e:Z$e)(n,t))}function n7e(){this.textContent=""}function r7e(e){return function(){this.textContent=e}}function i7e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function s7e(e){return arguments.length?this.each(e==null?n7e:(typeof e=="function"?i7e:r7e)(e)):this.node().textContent}function o7e(){this.innerHTML=""}function a7e(e){return function(){this.innerHTML=e}}function l7e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function c7e(e){return arguments.length?this.each(e==null?o7e:(typeof e=="function"?l7e:a7e)(e)):this.node().innerHTML}function u7e(){this.nextSibling&&this.parentNode.appendChild(this)}function d7e(){return this.each(u7e)}function h7e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f7e(){return this.each(h7e)}function p7e(e){var t=typeof e=="function"?e:Gj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function m7e(){return null}function g7e(e,t){var n=typeof e=="function"?e:Gj(e),r=t==null?m7e:typeof t=="function"?t:E3(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function v7e(){var e=this.parentNode;e&&e.removeChild(this)}function y7e(){return this.each(v7e)}function _7e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function b7e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function x7e(e){return this.select(e?b7e:_7e)}function w7e(e){return arguments.length?this.property("__data__",e):this.node().__data__}function S7e(e){return function(t){e.call(this,t,this.__data__)}}function C7e(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function k7e(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function E7e(e,t,n){return function(){var r=this.__on,i,s=S7e(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function T7e(e,t,n){var r=C7e(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,d;l<c;++l)for(i=0,d=o[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(o=t?E7e:k7e,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function iB(e,t,n){var r=Zj(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function $7e(e,t){return function(){return iB(this,e,t)}}function M7e(e,t){return function(){return iB(this,e,t.apply(this,arguments))}}function R7e(e,t){return this.each((typeof t=="function"?M7e:$7e)(e,t))}function*A7e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var sB=[null];function Ar(e,t){this._groups=e,this._parents=t}function fp(){return new Ar([[document.documentElement]],sB)}function L7e(){return this}Ar.prototype=fp.prototype={constructor:Ar,select:i$e,selectAll:l$e,selectChild:h$e,selectChildren:g$e,filter:v$e,data:S$e,enter:y$e,exit:k$e,join:E$e,merge:T$e,selection:L7e,order:$$e,sort:M$e,call:A$e,nodes:L$e,node:D$e,size:P$e,empty:O$e,each:N$e,attr:W$e,style:K$e,property:Q$e,classed:t7e,text:s7e,html:c7e,raise:d7e,lower:f7e,append:p7e,insert:g7e,remove:y7e,clone:x7e,datum:w7e,on:T7e,dispatch:R7e,[Symbol.iterator]:A7e};function qr(e){return typeof e=="string"?new Ar([[document.querySelector(e)]],[document.documentElement]):new Ar([[e]],sB)}function D7e(e){let t;for(;t=e.sourceEvent;)e=t;return e}function eo(e,t){if(e=D7e(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Qw={capture:!0,passive:!1};function Jw(e){e.preventDefault(),e.stopImmediatePropagation()}function P7e(e){var t=e.document.documentElement,n=qr(e).on("dragstart.drag",Jw,Qw);"onselectstart"in t?n.on("selectstart.drag",Jw,Qw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function O7e(e,t){var n=e.document.documentElement,r=qr(e).on("dragstart.drag",null);t&&(r.on("click.drag",Jw,Qw),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var gu=0,Yd=0,Ld=0,oB=1e3,D0,Xd,P0=0,tl=0,cy=0,ff=typeof performance=="object"&&performance.now?performance:Date,aB=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $3(){return tl||(aB(N7e),tl=ff.now()+cy)}function N7e(){tl=0}function O0(){this._call=this._time=this._next=null}O0.prototype=lB.prototype={constructor:O0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$3():+n)+(t==null?0:+t),!this._next&&Xd!==this&&(Xd?Xd._next=this:D0=this,Xd=this),this._call=e,this._time=n,Zw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zw())}};function lB(e,t,n){var r=new O0;return r.restart(e,t,n),r}function I7e(){$3(),++gu;for(var e=D0,t;e;)(t=tl-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gu}function k$(){tl=(P0=ff.now())+cy,gu=Yd=0;try{I7e()}finally{gu=0,B7e(),tl=0}}function j7e(){var e=ff.now(),t=e-P0;t>oB&&(cy-=t,P0=e)}function B7e(){for(var e,t=D0,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:D0=n);Xd=e,Zw(r)}function Zw(e){if(!gu){Yd&&(Yd=clearTimeout(Yd));var t=e-tl;t>24?(e<1/0&&(Yd=setTimeout(k$,e-ff.now()-cy)),Ld&&(Ld=clearInterval(Ld))):(Ld||(P0=ff.now(),Ld=setInterval(j7e,oB)),gu=1,aB(k$))}}function E$(e,t,n){var r=new O0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var F7e=k3("start","end","cancel","interrupt"),z7e=[],cB=0,T$=1,e2=2,tg=3,$$=4,t2=5,ng=6;function uy(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;H7e(e,n,{name:t,index:r,group:i,on:F7e,tween:z7e,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:cB})}function M3(e,t){var n=$i(e,t);if(n.state>cB)throw new Error("too late; already scheduled");return n}function as(e,t){var n=$i(e,t);if(n.state>tg)throw new Error("too late; already running");return n}function $i(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function H7e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=lB(s,0,n.time);function s(c){n.state=T$,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,u,h,f;if(n.state!==T$)return l();for(d in r)if(f=r[d],f.name===n.name){if(f.state===tg)return E$(a);f.state===$$?(f.state=ng,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[d]):+d<t&&(f.state=ng,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[d])}if(E$(function(){n.state===tg&&(n.state=$$,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=e2,n.on.call("start",e,e.__data__,n.index,n.group),n.state===e2){for(n.state=tg,i=new Array(h=n.tween.length),d=0,u=-1;d<h;++d)(f=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function o(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=t2,1),u=-1,h=i.length;++u<h;)i[u].call(e,d);n.state===t2&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ng,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function rg(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>e2&&r.state<t2,r.state=ng,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function W7e(e){return this.each(function(){rg(this,e)})}function U7e(e,t){var n,r;return function(){var i=as(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function V7e(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=as(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function q7e(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$i(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?U7e:V7e)(n,e,t))}function R3(e,t,n){var r=e._id;return e.each(function(){var i=as(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return $i(i,r).value[t]}}function uB(e,t){var n;return(typeof t=="number"?pi:t instanceof Ko?v0:(n=Ko(t))?(t=n,v0):C5)(e,t)}function K7e(e){return function(){this.removeAttribute(e)}}function G7e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y7e(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function X7e(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function Q7e(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function J7e(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Z7e(e,t){var n=ly(e),r=n==="transform"?B0e:uB;return this.attrTween(e,typeof t=="function"?(n.local?J7e:Q7e)(n,r,R3(this,"attr."+e,t)):t==null?(n.local?G7e:K7e)(n):(n.local?X7e:Y7e)(n,r,t))}function eMe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function tMe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function nMe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&tMe(e,s)),n}return i._value=t,i}function rMe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&eMe(e,s)),n}return i._value=t,i}function iMe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ly(e);return this.tween(n,(r.local?nMe:rMe)(r,t))}function sMe(e,t){return function(){M3(this,e).delay=+t.apply(this,arguments)}}function oMe(e,t){return t=+t,function(){M3(this,e).delay=t}}function aMe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sMe:oMe)(t,e)):$i(this.node(),t).delay}function lMe(e,t){return function(){as(this,e).duration=+t.apply(this,arguments)}}function cMe(e,t){return t=+t,function(){as(this,e).duration=t}}function uMe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lMe:cMe)(t,e)):$i(this.node(),t).duration}function dMe(e,t){if(typeof t!="function")throw new Error;return function(){as(this,e).ease=t}}function hMe(e){var t=this._id;return arguments.length?this.each(dMe(t,e)):$i(this.node(),t).ease}function fMe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;as(this,e).ease=n}}function pMe(e){if(typeof e!="function")throw new Error;return this.each(fMe(this._id,e))}function mMe(e){typeof e!="function"&&(e=Xj(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Fs(r,this._parents,this._name,this._id)}function gMe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],d=l.length,u=a[o]=new Array(d),h,f=0;f<d;++f)(h=l[f]||c[f])&&(u[f]=h);for(;o<r;++o)a[o]=t[o];return new Fs(a,this._parents,this._name,this._id)}function vMe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function yMe(e,t,n){var r,i,s=vMe(t)?M3:as;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function _Me(e,t){var n=this._id;return arguments.length<2?$i(this.node(),n).on.on(e):this.each(yMe(n,e,t))}function bMe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xMe(){return this.on("end.remove",bMe(this._id))}function wMe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=E3(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),d,u,h=0;h<l;++h)(d=o[h])&&(u=e.call(d,d.__data__,h,o))&&("__data__"in d&&(u.__data__=d.__data__),c[h]=u,uy(c[h],t,n,h,c,$i(d,n)));return new Fs(s,this._parents,t,n)}function SMe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yj(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,d,u=0;u<c;++u)if(d=l[u]){for(var h=e.call(d,d.__data__,u,l),f,b=$i(d,n),y=0,m=h.length;y<m;++y)(f=h[y])&&uy(f,t,n,y,h,b);s.push(h),a.push(d)}return new Fs(s,a,t,n)}var CMe=fp.prototype.constructor;function kMe(){return new CMe(this._groups,this._parents)}function EMe(e,t){var n,r,i;return function(){var s=mu(this,e),a=(this.style.removeProperty(e),mu(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function dB(e){return function(){this.style.removeProperty(e)}}function TMe(e,t,n){var r,i=n+"",s;return function(){var a=mu(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function $Me(e,t,n){var r,i,s;return function(){var a=mu(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),mu(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function MMe(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=as(this,e),c=l.on,d=l.value[s]==null?o||(o=dB(t)):void 0;(c!==n||i!==d)&&(r=(n=c).copy()).on(a,i=d),l.on=r}}function RMe(e,t,n){var r=(e+="")=="transform"?j0e:uB;return t==null?this.styleTween(e,EMe(e,r)).on("end.style."+e,dB(e)):typeof t=="function"?this.styleTween(e,$Me(e,r,R3(this,"style."+e,t))).each(MMe(this._id,e)):this.styleTween(e,TMe(e,r,t),n).on("end.style."+e,null)}function AMe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function LMe(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&AMe(e,a,n)),r}return s._value=t,s}function DMe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,LMe(e,t,n??""))}function PMe(e){return function(){this.textContent=e}}function OMe(e){return function(){var t=e(this);this.textContent=t??""}}function NMe(e){return this.tween("text",typeof e=="function"?OMe(R3(this,"text",e)):PMe(e==null?"":e+""))}function IMe(e){return function(t){this.textContent=e.call(this,t)}}function jMe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&IMe(i)),t}return r._value=e,r}function BMe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,jMe(e))}function FMe(){for(var e=this._name,t=this._id,n=hB(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var d=$i(l,t);uy(l,e,n,c,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Fs(r,this._parents,e,n)}function zMe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=as(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var HMe=0;function Fs(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function hB(){return++HMe}var ds=fp.prototype;Fs.prototype={constructor:Fs,select:wMe,selectAll:SMe,selectChild:ds.selectChild,selectChildren:ds.selectChildren,filter:mMe,merge:gMe,selection:kMe,transition:FMe,call:ds.call,nodes:ds.nodes,node:ds.node,size:ds.size,empty:ds.empty,each:ds.each,on:_Me,attr:Z7e,attrTween:iMe,style:RMe,styleTween:DMe,text:NMe,textTween:BMe,remove:xMe,tween:q7e,delay:aMe,duration:uMe,ease:hMe,easeVarying:pMe,end:zMe,[Symbol.iterator]:ds[Symbol.iterator]};function WMe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var UMe={time:null,delay:0,duration:250,ease:WMe};function VMe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function qMe(e){var t,n;e instanceof Fs?(t=e._id,e=e._name):(t=hB(),(n=UMe).time=$3(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&uy(l,e,t,c,a,n||VMe(l,t));return new Fs(r,this._parents,e,t)}fp.prototype.interrupt=W7e;fp.prototype.transition=qMe;const ym=e=>()=>e;function KMe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ks(e,t,n){this.k=e,this.x=t,this.y=n}ks.prototype={constructor:ks,scale:function(e){return e===1?this:new ks(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ks(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var fB=new ks(1,0,0);ks.prototype;function sb(e){e.stopImmediatePropagation()}function Dd(e){e.preventDefault(),e.stopImmediatePropagation()}function GMe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function YMe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function M$(){return this.__zoom||fB}function XMe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function QMe(){return navigator.maxTouchPoints||"ontouchstart"in this}function JMe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function ZMe(){var e=GMe,t=YMe,n=JMe,r=XMe,i=QMe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=W0e,c=k3("start","zoom","end"),d,u,h,f=500,b=150,y=0,m=10;function p(R){R.property("__zoom",M$).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",$).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(R,O,N,I){var j=R.selection?R.selection():R;j.property("__zoom",M$),R!==j?k(R,O,N,I):j.interrupt().each(function(){C(this,arguments).event(I).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},p.scaleBy=function(R,O,N,I){p.scaleTo(R,function(){var j=this.__zoom.k,L=typeof O=="function"?O.apply(this,arguments):O;return j*L},N,I)},p.scaleTo=function(R,O,N,I){p.transform(R,function(){var j=t.apply(this,arguments),L=this.__zoom,A=N==null?S(j):typeof N=="function"?N.apply(this,arguments):N,F=L.invert(A),H=typeof O=="function"?O.apply(this,arguments):O;return n(_(g(L,H),A,F),j,a)},N,I)},p.translateBy=function(R,O,N,I){p.transform(R,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),a)},null,I)},p.translateTo=function(R,O,N,I,j){p.transform(R,function(){var L=t.apply(this,arguments),A=this.__zoom,F=I==null?S(L):typeof I=="function"?I.apply(this,arguments):I;return n(fB.translate(F[0],F[1]).scale(A.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof N=="function"?-N.apply(this,arguments):-N),L,a)},I,j)};function g(R,O){return O=Math.max(s[0],Math.min(s[1],O)),O===R.k?R:new ks(O,R.x,R.y)}function _(R,O,N){var I=O[0]-N[0]*R.k,j=O[1]-N[1]*R.k;return I===R.x&&j===R.y?R:new ks(R.k,I,j)}function S(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function k(R,O,N,I){R.on("start.zoom",function(){C(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(I).end()}).tween("zoom",function(){var j=this,L=arguments,A=C(j,L).event(I),F=t.apply(j,L),H=N==null?S(F):typeof N=="function"?N.apply(j,L):N,B=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),G=j.__zoom,J=typeof O=="function"?O.apply(j,L):O,W=l(G.invert(H).concat(B/G.k),J.invert(H).concat(B/J.k));return function(U){if(U===1)U=J;else{var z=W(U),V=B/z[2];U=new ks(V,H[0]-z[0]*V,H[1]-z[1]*V)}A.zoom(null,U)}})}function C(R,O,N){return!N&&R.__zooming||new T(R,O)}function T(R,O){this.that=R,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,O),this.taps=0}T.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,O){return this.mouse&&R!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var O=qr(this.that).datum();c.call(R,this.that,new KMe(R,{sourceEvent:this.sourceEvent,target:p,type:R,transform:this.that.__zoom,dispatch:c}),O)}};function w(R,...O){if(!e.apply(this,arguments))return;var N=C(this,O).event(R),I=this.__zoom,j=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),L=eo(R);if(N.wheel)(N.mouse[0][0]!==L[0]||N.mouse[0][1]!==L[1])&&(N.mouse[1]=I.invert(N.mouse[0]=L)),clearTimeout(N.wheel);else{if(I.k===j)return;N.mouse=[L,I.invert(L)],rg(this),N.start()}Dd(R),N.wheel=setTimeout(A,b),N.zoom("mouse",n(_(g(I,j),N.mouse[0],N.mouse[1]),N.extent,a));function A(){N.wheel=null,N.end()}}function E(R,...O){if(h||!e.apply(this,arguments))return;var N=R.currentTarget,I=C(this,O,!0).event(R),j=qr(R.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",B,!0),L=eo(R,N),A=R.clientX,F=R.clientY;P7e(R.view),sb(R),I.mouse=[L,this.__zoom.invert(L)],rg(this),I.start();function H(G){if(Dd(G),!I.moved){var J=G.clientX-A,W=G.clientY-F;I.moved=J*J+W*W>y}I.event(G).zoom("mouse",n(_(I.that.__zoom,I.mouse[0]=eo(G,N),I.mouse[1]),I.extent,a))}function B(G){j.on("mousemove.zoom mouseup.zoom",null),O7e(G.view,I.moved),Dd(G),I.event(G).end()}}function $(R,...O){if(e.apply(this,arguments)){var N=this.__zoom,I=eo(R.changedTouches?R.changedTouches[0]:R,this),j=N.invert(I),L=N.k*(R.shiftKey?.5:2),A=n(_(g(N,L),I,j),t.apply(this,O),a);Dd(R),o>0?qr(this).transition().duration(o).call(k,A,I,R):qr(this).call(p.transform,A,I,R)}}function M(R,...O){if(e.apply(this,arguments)){var N=R.touches,I=N.length,j=C(this,O,R.changedTouches.length===I).event(R),L,A,F,H;for(sb(R),A=0;A<I;++A)F=N[A],H=eo(F,this),H=[H,this.__zoom.invert(H),F.identifier],j.touch0?!j.touch1&&j.touch0[2]!==H[2]&&(j.touch1=H,j.taps=0):(j.touch0=H,L=!0,j.taps=1+!!d);d&&(d=clearTimeout(d)),L&&(j.taps<2&&(u=H[0],d=setTimeout(function(){d=null},f)),rg(this),j.start())}}function P(R,...O){if(this.__zooming){var N=C(this,O).event(R),I=R.changedTouches,j=I.length,L,A,F,H;for(Dd(R),L=0;L<j;++L)A=I[L],F=eo(A,this),N.touch0&&N.touch0[2]===A.identifier?N.touch0[0]=F:N.touch1&&N.touch1[2]===A.identifier&&(N.touch1[0]=F);if(A=N.that.__zoom,N.touch1){var B=N.touch0[0],G=N.touch0[1],J=N.touch1[0],W=N.touch1[1],U=(U=J[0]-B[0])*U+(U=J[1]-B[1])*U,z=(z=W[0]-G[0])*z+(z=W[1]-G[1])*z;A=g(A,Math.sqrt(U/z)),F=[(B[0]+J[0])/2,(B[1]+J[1])/2],H=[(G[0]+W[0])/2,(G[1]+W[1])/2]}else if(N.touch0)F=N.touch0[0],H=N.touch0[1];else return;N.zoom("touch",n(_(A,F,H),N.extent,a))}}function D(R,...O){if(this.__zooming){var N=C(this,O).event(R),I=R.changedTouches,j=I.length,L,A;for(sb(R),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),L=0;L<j;++L)A=I[L],N.touch0&&N.touch0[2]===A.identifier?delete N.touch0:N.touch1&&N.touch1[2]===A.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(A=eo(A,this),Math.hypot(u[0]-A[0],u[1]-A[1])<m)){var F=qr(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return p.wheelDelta=function(R){return arguments.length?(r=typeof R=="function"?R:ym(+R),p):r},p.filter=function(R){return arguments.length?(e=typeof R=="function"?R:ym(!!R),p):e},p.touchable=function(R){return arguments.length?(i=typeof R=="function"?R:ym(!!R),p):i},p.extent=function(R){return arguments.length?(t=typeof R=="function"?R:ym([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),p):t},p.scaleExtent=function(R){return arguments.length?(s[0]=+R[0],s[1]=+R[1],p):[s[0],s[1]]},p.translateExtent=function(R){return arguments.length?(a[0][0]=+R[0][0],a[1][0]=+R[1][0],a[0][1]=+R[0][1],a[1][1]=+R[1][1],p):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},p.constrain=function(R){return arguments.length?(n=R,p):n},p.duration=function(R){return arguments.length?(o=+R,p):o},p.interpolate=function(R){return arguments.length?(l=R,p):l},p.on=function(){var R=c.on.apply(c,arguments);return R===c?p:R},p.clickDistance=function(R){return arguments.length?(y=(R=+R)*R,p):Math.sqrt(y)},p.tapDistance=function(R){return arguments.length?(m=+R,p):m},p}const eRe=(e,t)=>{let n;for(const r of e)if(r==="+Inf"){if(n!==void 0&&n<t)return;break}else typeof r!="string"&&r<=t&&(n=r);return typeof n=="number"?n:void 0},ig=e=>e==="+Inf"?"+Inf":typeof e=="string"?"???":e<0?"<0 ms":e===0?"0 ms":e<.001?"<1 ms":e>=.001&&e<1?`${(e*1e3).toFixed(0)} ms`:e<10?`${e.toFixed(2)} s`:e<100?`${e.toFixed(1)} s`:`${e.toFixed(0)} s`,pB=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n-1]??0;if(typeof r!="number")throw new Error(`Invalid prev value: ${r}`);if(e.length>=2&&n===e.length-1){t.push(r*1.25);break}const i=e[n];if(typeof i!="number")throw new Error(`Invalid current value: ${i}`);t.push((r+i)/2)}return t},mB=(e,t)=>{if(e.length!==t.length)throw new Error("Invalid bucket count");let n=0;const r=[];for(let i=0;i<t.length;i++){const a=(typeof e[i]=="number"?e[i]:0)*t[i];r.push(a),n+=a}return r.map(i=>i/n)},tRe=60*1e3,nRe=15*60*1e3,Hl={bootDuration:void 0,closeReason:void 0,log:[]},rRe=(e,t)=>{var a,o;let n,r,i=[],s=zl(Hl);for(const l of e){s===void 0&&(s=zl(Hl));const c=(a=s==null?void 0:s.log)==null?void 0:a.length;if(l.type==="svBoot")c&&(i.push(s),s=zl(Hl)),s.bootTime=new Date(l.ts),s.bootDuration=l.duration;else if(l.type==="svClose")c&&(s.closeTime=new Date(l.ts),s.closeReason=l.reason,i.push(s),s=zl(Hl));else if(l.type==="data"){const d=l.ts-nRe,u=c?s.log.at(-1):void 0;let h=l.ts-tRe;if(u){const y=u.end.getTime();y>=d?h=y:(i.push(s),s=zl(Hl))}else if(s.bootTime){const y=s.bootTime.getTime();y>=d?h=y:s=zl(Hl)}const f=new Date(h),b=new Date(l.ts);n||(n=f),r=b,s.log.push({start:f,end:b,players:l.players,fxsMemory:l.fxsMemory,nodeMemory:l.nodeMemory,weightedPerf:t(l.perf)})}}return(o=s==null?void 0:s.log)!=null&&o.length&&i.push(s),i=i.filter(l=>l.log.length),n&&r&&i.length?{dataStart:n,dataEnd:r,lifespans:i}:void 0},iRe=(e,t)=>{const n=Date.now(),r=t*60*60*1e3,i=n-r;let s=0;const a=[];for(const o of e)if(!(!o.log.length||o.log.at(-1).end.getTime()<i))for(const c of o.log)a.push(c.players),!(c.end.getTime()<i)&&(c.start.getTime()<i?s+=c.end.getTime()-i:s+=c.end.getTime()-c.start.getTime());return{uptimePct:s/r*100,medianPlayerCount:dve(a,.5)??0}};function sRe({delay:e,onDebouncedResize:t,children:n}){const r=x.useRef(null),i=x.useRef(null),s=x.useRef(null),a=x.useRef({width:0,height:0});e===void 0&&(e=250);const o=()=>{if(!r.current||!r.current.parentNode)return;const c={width:r.current.clientWidth,height:r.current.clientHeight};a.current=c,t(c),s.current.style.visibility="visible",i.current.style.visibility="hidden"},l=x.useCallback(bS(e,o,{atBegin:!1}),[r]);return x.useEffect(()=>{if(!r.current)return;const c=new ResizeObserver(()=>{const d=r.current.clientHeight,u=r.current.clientWidth;d===0||u===0||a.current.width===u&&a.current.height===d||(a.current.width===0||a.current.height===0?o():(l(),s.current.style.visibility="hidden",i.current.style.visibility="visible"))});return c.observe(r.current),o(),()=>c.disconnect()},[r]),v.jsxs("div",{ref:r,style:{height:"100%",width:"100%",position:"relative"},children:[v.jsx("div",{ref:i,className:"absolute inset-0 flex items-center justify-center",children:v.jsx(dn,{className:"animate-spin size-16 text-muted-foreground"})}),v.jsx("div",{className:"absolute inset-0",ref:s,children:n})]})}const A3=x.memo(sRe),oRe=x.memo(({data:e,minTickIntervalMarker:t,width:n,height:r})=>{const i=m3(),s=a=>{var d;const o=((d=e.find((u,h)=>h===a.index-1))==null?void 0:d.bucket)??0,l=a.data.bucket,c=(a.value*100).toFixed()+"%";return v.jsxs("div",{className:"p-3 text-gray-900 bg-white rounded-md shadow-md",children:[v.jsxs("div",{children:["Tick duration: ",v.jsx("strong",{children:ig(o)})," ~ ",v.jsx("strong",{children:ig(l)})]}),v.jsxs("div",{children:["Time spent: ",v.jsxs("strong",{children:["~",c]})]}),v.jsxs("div",{children:["Tick count: ",a.data.count]})]})};return t=void 0,!n||!r?null:v.jsx(o4e,{height:r,width:n,data:e,theme:{tooltip:{wrapper:{zIndex:1e4}},text:{fontSize:"12px",fontWeight:600,fill:"inherit"},grid:{line:{strokeDasharray:"8 6",stroke:"#3F4146",strokeOpacity:i?1:.25,strokeWidth:1}}},indexBy:"bucket",margin:{top:0,right:25,bottom:40,left:60},layout:"horizontal",valueFormat:".1%",colors:{datum:"data.color"},colorBy:"indexValue",borderWidth:.5,borderColor:i?void 0:{from:"color",modifiers:[["darker",1]]},axisBottom:{format:".0%",legend:"percent of total time",legendPosition:"middle",legendOffset:32},axisLeft:{format:ig},enableGridX:!0,enableGridY:!1,labelSkipWidth:25,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltip:s,markers:t?[{axis:"y",value:t,lineStyle:{stroke:"black",strokeWidth:4,strokeDasharray:"6 2",strokeDashoffset:1}},{axis:"y",value:t,lineStyle:{stroke:"#F513B3",strokeWidth:2,strokeDasharray:"4 4"}}]:void 0})});function aRe(){const[e,t]=x.useState({width:0,height:0}),[n,r]=x.useState("svMain"),i=lt(lv),s=lt(cv),a=SS(),o=x.useMemo(()=>{if(!i||a().isExpired)return null;if(!i.perfBoundaries||!i.perfBucketCounts||!i.perfMinTickTime)return"incomplete";const u=s?s.threadName:n??"svMain",{perfBoundaries:h,perfBucketCounts:f,perfMinTickTime:b}=i,y=b[u],m=eRe(h,y),p=h.findIndex(C=>C===m);let g;p?g=C=>{const T=p+1;return C<=p?$N(1.1-C/T):MN(.25+(C-T)/(h.length-T))}:g=C=>TN(1-(C+1)/h.length);const _=f[u];let S;if(s)S=s.snap.weightedPerf;else{const C=pB(h);S=mB(_,C)}const k=[];for(let C=0;C<h.length;C++)k.push({bucket:h[C],count:s?0:_[C],value:S[C],color:g(C+1)});return{threadName:u,data:k,minTickIntervalMarker:m,perfBoundaries:h}},[i,s,n]),l=x.useMemo(()=>{const u=a();if(!i||u.isExpired||!i.perfBoundaries||!i.perfBucketCounts||!i.perfMinTickTime)return null;if(s){const h=VR(s.snap.end,"2-digit","2-digit"),f=pS(s.snap.end,"short"),b=qR(s.snap.end)?h:`${h} - ${f}`;return v.jsxs(v.Fragment,{children:["(",v.jsx("span",{className:"text-xs text-warning-inline font-mono",children:b}),")"]})}else return u.isStale?"(minutes ago)":"(last minute)"},[i,s]);let c,d=null;return typeof o=="object"&&o!==null?(c=o.threadName,d=v.jsx(oRe,{...o,width:e.width,height:e.height})):typeof o=="string"?d=v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:v.jsxs("p",{className:"max-w-80",children:["Data not yet available. ",v.jsx("br",{}),"The thread performance chart will appear soon after the server is online."]})}):d=v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:v.jsx(dn,{className:"animate-spin size-16 text-muted-foreground"})}),v.jsxs("div",{className:"py-2 md:rounded-xl border bg-card shadow-sm flex flex-col col-span-3 fill-primary h-[20rem] max-h-[20rem]",children:[v.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:[c??n," performance ",l]}),v.jsxs("div",{className:"flex gap-4",children:[v.jsxs(Ho,{defaultValue:n,onValueChange:r,disabled:!!s,children:[v.jsx(Ns,{className:ee("w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",!!s&&"hidden"),children:v.jsx(Wo,{placeholder:"Filter by admin"})}),v.jsxs(Is,{className:"px-0",children:[v.jsx(Qe,{value:"svMain",className:"cursor-pointer",children:"svMain"}),v.jsx(Qe,{value:"svSync",className:"cursor-pointer",children:"svSync"}),v.jsx(Qe,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),v.jsx("div",{className:"hidden xs:block",children:v.jsx(Nq,{})})]})]}),v.jsx(A3,{onDebouncedResize:t,children:d})]})}function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var lRe={pointerEvents:"none"},cRe=function(e){var t=e.label,n=e.style,r=Ut();return v.jsx(xt.g,{transform:n.transform,opacity:n.progress,style:lRe,children:v.jsx(xt.text,{textAnchor:"middle",dominantBaseline:"central",style:At({},r.labels.text,{fill:n.textColor}),children:t})})},gB=function(e){var t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t},uRe=function(e,t){return e.filter(function(n){return Math.abs(ny(n.arc.endAngle-n.arc.startAngle))>=t})},dRe={startAngle:{enter:function(e){return At({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return At({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return At({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return At({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return At({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return At({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return At({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return At({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return At({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return At({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return At({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return At({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return At({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return At({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return At({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return At({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},vB=function(e,t){return x.useMemo(function(){var n=dRe[e];return{enter:function(r){return At({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return At({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return At({progress:0},n.leave(r.arc),t?t.leave(r):{})}}},[e,t])},hRe=function(e,t){var n=u2e(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return Ia(n,r)},fRe=function(e){return function(t,n,r,i){return qo([t,n,r,i],function(s,a,o,l){var c=hRe({startAngle:s,endAngle:a,innerRadius:o,outerRadius:l},e);return"translate("+c.x+","+c.y+")"})}},pRe=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=_r(),s=i.animate,a=i.config,o=vB(n,r);return{transition:ml(e,{keys:function(l){return l.id},initial:o.update,from:o.enter,enter:o.update,update:o.update,leave:o.leave,config:a,immediate:!s}),interpolate:fRe(t)}},mRe=function(e){var t=e.center,n=e.data,r=e.transitionMode,i=e.label,s=e.radiusOffset,a=e.skipAngle,o=e.textColor,l=e.component,c=l===void 0?cRe:l,d=ja(i),u=Ut(),h=hu(o,u),f=x.useMemo(function(){return n.filter(function(g){return Math.abs(ny(g.arc.endAngle-g.arc.startAngle))>=a})},[n,a]),b=pRe(f,s,r),y=b.transition,m=b.interpolate,p=c;return v.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:y(function(g,_){return x.createElement(p,{key:_.id,datum:_,label:d(_),style:At({},g,{transform:m(g.startAngle,g.endAngle,g.innerRadius,g.outerRadius),textColor:h(_)})})})})},gRe=function(e){var t=e.label,n=e.style,r=Ut();return v.jsxs(xt.g,{opacity:n.opacity,children:[v.jsx(xt.path,{fill:"none",stroke:n.linkColor,strokeWidth:n.thickness,d:n.path}),v.jsx(xt.text,{transform:n.textPosition,textAnchor:n.textAnchor,dominantBaseline:"central",style:At({},r.labels.text,{fill:n.textColor}),children:t})]})},vRe=function(e){var t=gB(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2);return t<Math.PI/2||t>1.5*Math.PI?"start":"end"},yB=function(e,t,n,r){var i,s,a=gB(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2),o=Ia(a,e.outerRadius+t),l=Ia(a,e.outerRadius+t+n);return a<Math.PI/2||a>1.5*Math.PI?(i="after",s={x:l.x+r,y:l.y}):(i="before",s={x:l.x-r,y:l.y}),{side:i,points:[o,l,s]}},yRe=BN().x(function(e){return e.x}).y(function(e){return e.y}),_Re=function(e,t,n,r,i,s,a){return qo([e,t,n,r,i,s,a],function(o,l,c,d,u,h,f){var b=yB({startAngle:o,endAngle:l,innerRadius:c,outerRadius:d},u,h,f).points;return yRe(b)})},bRe=function(e,t,n,r){return qo([e,t,n,r],function(i,s,a,o){return vRe({startAngle:i,endAngle:s,innerRadius:a,outerRadius:o})})},xRe=function(e,t,n,r,i,s,a,o){return qo([e,t,n,r,i,s,a,o],function(l,c,d,u,h,f,b,y){var m=yB({startAngle:l,endAngle:c,innerRadius:d,outerRadius:u},h,f,b),p=m.points,g=m.side,_=p[2];return g==="before"?_.x-=y:_.x+=y,"translate("+_.x+","+_.y+")"})},wRe=function(e){var t=e.data,n=e.offset,r=n===void 0?0:n,i=e.diagonalLength,s=e.straightLength,a=e.skipAngle,o=a===void 0?0:a,l=e.textOffset,c=e.linkColor,d=e.textColor,u=_r(),h=u.animate,f=u.config,b=Ut(),y=hu(c,b),m=hu(d,b),p=function(_,S){return x.useMemo(function(){return uRe(_,S)},[_,S])}(t,o),g=function(_){var S=_.offset,k=_.diagonalLength,C=_.straightLength,T=_.textOffset,w=_.getLinkColor,E=_.getTextColor;return x.useMemo(function(){return{enter:function($){return{startAngle:$.arc.startAngle,endAngle:$.arc.endAngle,innerRadius:$.arc.innerRadius,outerRadius:$.arc.outerRadius,offset:S,diagonalLength:0,straightLength:0,textOffset:T,linkColor:w($),textColor:E($),opacity:0}},update:function($){return{startAngle:$.arc.startAngle,endAngle:$.arc.endAngle,innerRadius:$.arc.innerRadius,outerRadius:$.arc.outerRadius,offset:S,diagonalLength:k,straightLength:C,textOffset:T,linkColor:w($),textColor:E($),opacity:1}},leave:function($){return{startAngle:$.arc.startAngle,endAngle:$.arc.endAngle,innerRadius:$.arc.innerRadius,outerRadius:$.arc.outerRadius,offset:S,diagonalLength:0,straightLength:0,textOffset:T,linkColor:w($),textColor:E($),opacity:0}}}},[k,C,T,w,E,S])}({offset:r,diagonalLength:i,straightLength:s,textOffset:l,getLinkColor:y,getTextColor:m});return{transition:ml(p,{keys:function(_){return _.id},initial:g.update,from:g.enter,enter:g.update,update:g.update,leave:g.leave,config:f,immediate:!h}),interpolateLink:_Re,interpolateTextAnchor:bRe,interpolateTextPosition:xRe}},SRe=function(e){var t=e.center,n=e.data,r=e.label,i=e.skipAngle,s=e.offset,a=e.diagonalLength,o=e.straightLength,l=e.strokeWidth,c=e.textOffset,d=e.textColor,u=e.linkColor,h=e.component,f=h===void 0?gRe:h,b=ja(r),y=wRe({data:n,skipAngle:i,offset:s,diagonalLength:a,straightLength:o,textOffset:c,linkColor:u,textColor:d}),m=y.transition,p=y.interpolateLink,g=y.interpolateTextAnchor,_=y.interpolateTextPosition,S=f;return v.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:m(function(k,C){return x.createElement(S,{key:C.id,datum:C,label:b(C),style:At({},k,{thickness:l,path:p(k.startAngle,k.endAngle,k.innerRadius,k.outerRadius,k.offset,k.diagonalLength,k.straightLength),textAnchor:g(k.startAngle,k.endAngle,k.innerRadius,k.outerRadius),textPosition:_(k.startAngle,k.endAngle,k.innerRadius,k.outerRadius,k.offset,k.diagonalLength,k.straightLength,k.textOffset)})})})})},CRe=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,s=e.onMouseMove,a=e.onMouseLeave,o=x.useCallback(function(u){return r==null?void 0:r(t,u)},[r,t]),l=x.useCallback(function(u){return i==null?void 0:i(t,u)},[i,t]),c=x.useCallback(function(u){return s==null?void 0:s(t,u)},[s,t]),d=x.useCallback(function(u){return a==null?void 0:a(t,u)},[a,t]);return v.jsx(xt.path,{d:n.path,opacity:n.opacity,fill:t.fill||n.color,stroke:n.borderColor,strokeWidth:n.borderWidth,onClick:r?o:void 0,onMouseEnter:i?l:void 0,onMouseMove:s?c:void 0,onMouseLeave:a?d:void 0})},kRe=function(e,t,n,r,i){return qo([e,t,n,r],function(s,a,o,l){return i({startAngle:s,endAngle:a,innerRadius:Math.max(0,o),outerRadius:Math.max(0,l)})})},ERe=function(e,t,n){t===void 0&&(t="innerRadius");var r=_r(),i=r.animate,s=r.config,a=vB(t,n);return{transition:ml(e,{keys:function(o){return o.id},initial:a.update,from:a.enter,enter:a.update,update:a.update,leave:a.leave,config:s,immediate:!i}),interpolate:kRe}},TRe=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.onClick,o=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,d=e.transitionMode,u=e.component,h=u===void 0?CRe:u,f=Ut(),b=hu(s,f),y=ERe(n,d,{enter:function(_){return{opacity:0,color:_.color,borderColor:b(_)}},update:function(_){return{opacity:1,color:_.color,borderColor:b(_)}},leave:function(_){return{opacity:0,color:_.color,borderColor:b(_)}}}),m=y.transition,p=y.interpolate,g=h;return v.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:m(function(_,S){return x.createElement(g,{key:S.id,datum:S,style:At({},_,{borderWidth:i,path:p(_.startAngle,_.endAngle,_.innerRadius,_.outerRadius,r)}),onClick:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c})})})},$Re=function(e,t,n,r,i,s){s===void 0&&(s=!0);var a=[],o=Ia(Qr(r),n);a.push([o.x,o.y]);var l=Ia(Qr(i),n);a.push([l.x,l.y]);for(var c=Math.round(Math.min(r,i));c<=Math.round(Math.max(r,i));c++)if(c%90==0){var d=Ia(Qr(c),n);a.push([d.x,d.y])}a=a.map(function(m){var p=m[0],g=m[1];return[e+p,t+g]}),s&&a.push([e,t]);var u=a.map(function(m){return m[0]}),h=a.map(function(m){return m[1]}),f=Math.min.apply(Math,u),b=Math.max.apply(Math,u),y=Math.min.apply(Math,h);return{points:a,x:f,y,width:b-f,height:Math.max.apply(Math,h)-y}},MRe=function(e){var t=e===void 0?{}:e,n=t.cornerRadius,r=n===void 0?0:n,i=t.padAngle,s=i===void 0?0:i;return x.useMemo(function(){return q_e().innerRadius(function(a){return a.innerRadius}).outerRadius(function(a){return a.outerRadius}).cornerRadius(r).padAngle(s)},[r,s])};function nl(){return nl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nl.apply(this,arguments)}function _B(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var R$,RRe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,s=e.toggleSerie;return v.jsx(v.Fragment,{children:r.map(function(a,o){var l;return v.jsx(pj,nl({},a,{containerWidth:t,containerHeight:n,data:(l=a.data)!=null?l:i,toggleSerie:a.toggleSerie?s:void 0}),o)})})},Ae={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return v.jsx(u9,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(R$=window.devicePixelRatio)!=null?R$:1},ARe=["points"],LRe=function(e){var t=e.data,n=e.id,r=n===void 0?Ae.id:n,i=e.value,s=i===void 0?Ae.value:i,a=e.valueFormat,o=e.colors,l=o===void 0?Ae.colors:o,c=ja(r),d=ja(s),u=ey(a),h=dj(l,"id");return x.useMemo(function(){return t.map(function(f){var b,y=c(f),m=d(f),p={id:y,label:(b=f.label)!=null?b:y,hidden:!1,value:m,formattedValue:u(m),data:f};return nl({},p,{color:h(p)})})},[t,c,d,u,h])},DRe=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,s=e.outerRadius,a=e.padAngle,o=e.sortByValue,l=e.activeId,c=e.activeInnerRadiusOffset,d=e.activeOuterRadiusOffset,u=e.hiddenIds,h=e.forwardLegendData,f=x.useMemo(function(){var p=Q_e().value(function(g){return g.value}).startAngle(Qr(n)).endAngle(Qr(r)).padAngle(Qr(a));return o||p.sortValues(null),p},[n,r,a,o]),b=x.useMemo(function(){var p=t.filter(function(g){return!u.includes(g.id)});return{dataWithArc:f(p).map(function(g){var _=Math.abs(g.endAngle-g.startAngle);return nl({},g.data,{arc:{index:g.index,startAngle:g.startAngle,endAngle:g.endAngle,innerRadius:l===g.data.id?i-c:i,outerRadius:l===g.data.id?s+d:s,thickness:s-i,padAngle:g.padAngle,angle:_,angleDeg:ny(_)}})}),legendData:t.map(function(g){return{id:g.id,label:g.label,color:g.color,hidden:u.includes(g.id),data:g}})}},[f,t,u,l,i,c,s,d]),y=b.legendData,m=x.useRef(h);return x.useEffect(function(){typeof m.current=="function"&&m.current(y)},[m,y]),b},PRe=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,s=x.useState(i||r===void 0?null:r),a=s[0],o=s[1];return{activeId:i?t:a,setActiveId:x.useCallback(function(l){n&&n(l),i||o(l)},[i,n,o])}},ORe=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,s=i===void 0?Ae.innerRadius:i,a=e.startAngle,o=a===void 0?Ae.startAngle:a,l=e.endAngle,c=l===void 0?Ae.endAngle:l,d=e.padAngle,u=d===void 0?Ae.padAngle:d,h=e.sortByValue,f=h===void 0?Ae.sortByValue:h,b=e.cornerRadius,y=b===void 0?Ae.cornerRadius:b,m=e.fit,p=m===void 0?Ae.fit:m,g=e.activeInnerRadiusOffset,_=g===void 0?Ae.activeInnerRadiusOffset:g,S=e.activeOuterRadiusOffset,k=S===void 0?Ae.activeOuterRadiusOffset:S,C=e.activeId,T=e.onActiveIdChange,w=e.defaultActiveId,E=e.forwardLegendData,$=PRe({activeId:C,onActiveIdChange:T,defaultActiveId:w}),M=$.activeId,P=$.setActiveId,D=x.useState([]),R=D[0],O=D[1],N=x.useMemo(function(){var L,A=Math.min(n,r)/2,F=A*Math.min(s,1),H=n/2,B=r/2;if(p){var G=$Re(H,B,A,o-90,c-90),J=G.points,W=_B(G,ARe),U=Math.min(n/W.width,r/W.height),z={width:W.width*U,height:W.height*U};z.x=(n-z.width)/2,z.y=(r-z.height)/2,H=(H-W.x)/W.width*W.width*U+z.x,B=(B-W.y)/W.height*W.height*U+z.y,L={box:W,ratio:U,points:J},A*=U,F*=U}return{centerX:H,centerY:B,radius:A,innerRadius:F,debug:L}},[n,r,s,o,c,p]),I=DRe({data:t,startAngle:o,endAngle:c,innerRadius:N.innerRadius,outerRadius:N.radius,padAngle:u,sortByValue:f,activeId:M,activeInnerRadiusOffset:_,activeOuterRadiusOffset:k,hiddenIds:R,forwardLegendData:E}),j=x.useCallback(function(L){O(function(A){return A.indexOf(L)>-1?A.filter(function(F){return F!==L}):[].concat(A,[L])})},[]);return nl({arcGenerator:MRe({cornerRadius:y,padAngle:Qr(u)}),activeId:M,setActiveId:P,toggleSerie:j},I,N)},NRe=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,s=e.radius,a=e.innerRadius;return x.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:s,innerRadius:a}},[t,n,r,i,s,a])},IRe=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.isInteractive,o=e.onClick,l=e.onMouseEnter,c=e.onMouseMove,d=e.onMouseLeave,u=e.setActiveId,h=e.tooltip,f=e.transitionMode,b=o5(),y=b.showTooltipFromEvent,m=b.hideTooltip,p=x.useMemo(function(){if(a)return function(k,C){o==null||o(k,C)}},[a,o]),g=x.useMemo(function(){if(a)return function(k,C){y(x.createElement(h,{datum:k}),C),u(k.id),l==null||l(k,C)}},[a,y,u,l,h]),_=x.useMemo(function(){if(a)return function(k,C){y(x.createElement(h,{datum:k}),C),c==null||c(k,C)}},[a,y,c,h]),S=x.useMemo(function(){if(a)return function(k,C){m(),u(null),d==null||d(k,C)}},[a,m,u,d]);return v.jsx(TRe,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:s,transitionMode:f,onClick:p,onMouseEnter:g,onMouseMove:_,onMouseLeave:S})},jRe=["isInteractive","animate","motionConfig","theme","renderWrapper"],BRe=function(e){var t=e.data,n=e.id,r=n===void 0?Ae.id:n,i=e.value,s=i===void 0?Ae.value:i,a=e.valueFormat,o=e.sortByValue,l=o===void 0?Ae.sortByValue:o,c=e.layers,d=c===void 0?Ae.layers:c,u=e.startAngle,h=u===void 0?Ae.startAngle:u,f=e.endAngle,b=f===void 0?Ae.endAngle:f,y=e.padAngle,m=y===void 0?Ae.padAngle:y,p=e.fit,g=p===void 0?Ae.fit:p,_=e.innerRadius,S=_===void 0?Ae.innerRadius:_,k=e.cornerRadius,C=k===void 0?Ae.cornerRadius:k,T=e.activeInnerRadiusOffset,w=T===void 0?Ae.activeInnerRadiusOffset:T,E=e.activeOuterRadiusOffset,$=E===void 0?Ae.activeOuterRadiusOffset:E,M=e.width,P=e.height,D=e.margin,R=e.colors,O=R===void 0?Ae.colors:R,N=e.borderWidth,I=N===void 0?Ae.borderWidth:N,j=e.borderColor,L=j===void 0?Ae.borderColor:j,A=e.enableArcLabels,F=A===void 0?Ae.enableArcLabels:A,H=e.arcLabel,B=H===void 0?Ae.arcLabel:H,G=e.arcLabelsSkipAngle,J=G===void 0?Ae.arcLabelsSkipAngle:G,W=e.arcLabelsTextColor,U=W===void 0?Ae.arcLabelsTextColor:W,z=e.arcLabelsRadiusOffset,V=z===void 0?Ae.arcLabelsRadiusOffset:z,K=e.arcLabelsComponent,q=e.enableArcLinkLabels,X=q===void 0?Ae.enableArcLinkLabels:q,ie=e.arcLinkLabel,re=ie===void 0?Ae.arcLinkLabel:ie,ce=e.arcLinkLabelsSkipAngle,ye=ce===void 0?Ae.arcLinkLabelsSkipAngle:ce,ae=e.arcLinkLabelsOffset,Me=ae===void 0?Ae.arcLinkLabelsOffset:ae,Pe=e.arcLinkLabelsDiagonalLength,ge=Pe===void 0?Ae.arcLinkLabelsDiagonalLength:Pe,xe=e.arcLinkLabelsStraightLength,oe=xe===void 0?Ae.arcLinkLabelsStraightLength:xe,se=e.arcLinkLabelsThickness,fe=se===void 0?Ae.arcLinkLabelsThickness:se,Q=e.arcLinkLabelsTextOffset,ne=Q===void 0?Ae.arcLinkLabelsTextOffset:Q,he=e.arcLinkLabelsTextColor,ve=he===void 0?Ae.arcLinkLabelsTextColor:he,Ce=e.arcLinkLabelsColor,Te=Ce===void 0?Ae.arcLinkLabelsColor:Ce,we=e.arcLinkLabelComponent,be=e.defs,mt=be===void 0?Ae.defs:be,Je=e.fill,qe=Je===void 0?Ae.fill:Je,ct=e.isInteractive,nt=ct===void 0?Ae.isInteractive:ct,Ie=e.onClick,Ke=e.onMouseEnter,rt=e.onMouseMove,Xe=e.onMouseLeave,ut=e.tooltip,gt=ut===void 0?Ae.tooltip:ut,bn=e.activeId,Pt=e.onActiveIdChange,Ot=e.defaultActiveId,Jt=e.transitionMode,nn=Jt===void 0?Ae.transitionMode:Jt,Vt=e.legends,Pn=Vt===void 0?Ae.legends:Vt,xn=e.forwardLegendData,dt=e.role,Ze=dt===void 0?Ae.role:dt,Be=i3(M,P,D),vt=Be.outerWidth,hn=Be.outerHeight,on=Be.margin,br=Be.innerWidth,El=Be.innerHeight,Le=LRe({data:t,id:r,value:s,valueFormat:a,colors:O}),De=ORe({data:Le,width:br,height:El,fit:g,innerRadius:S,startAngle:h,endAngle:b,padAngle:m,sortByValue:l,cornerRadius:C,activeInnerRadiusOffset:w,activeOuterRadiusOffset:$,activeId:bn,onActiveIdChange:Pt,defaultActiveId:Ot,forwardLegendData:xn}),st=De.dataWithArc,Et=De.legendData,ht=De.arcGenerator,Kt=De.centerX,wt=De.centerY,Gt=De.radius,ra=De.innerRadius,Tl=De.setActiveId,Un=De.toggleSerie,nd=CI(mt,st,qe),ke={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};d.includes("arcs")&&(ke.arcs=v.jsx(IRe,{center:[Kt,wt],data:st,arcGenerator:ht,borderWidth:I,borderColor:L,isInteractive:nt,onClick:Ie,onMouseEnter:Ke,onMouseMove:rt,onMouseLeave:Xe,setActiveId:Tl,tooltip:gt,transitionMode:nn},"arcs")),X&&d.includes("arcLinkLabels")&&(ke.arcLinkLabels=v.jsx(SRe,{center:[Kt,wt],data:st,label:re,skipAngle:ye,offset:Me,diagonalLength:ge,straightLength:oe,strokeWidth:fe,textOffset:ne,textColor:ve,linkColor:Te,component:we},"arcLinkLabels")),F&&d.includes("arcLabels")&&(ke.arcLabels=v.jsx(mRe,{center:[Kt,wt],data:st,label:B,radiusOffset:V,skipAngle:J,textColor:U,transitionMode:nn,component:K},"arcLabels")),Pn.length>0&&d.includes("legends")&&(ke.legends=v.jsx(RRe,{width:br,height:El,data:Et,legends:Pn,toggleSerie:Un},"legends"));var ls=NRe({dataWithArc:st,arcGenerator:ht,centerX:Kt,centerY:wt,radius:Gt,innerRadius:ra});return v.jsx(o3,{width:vt,height:hn,margin:on,defs:nd,role:Ze,children:d.map(function(Mn,OF){return ke[Mn]!==void 0?ke[Mn]:typeof Mn=="function"?v.jsx(x.Fragment,{children:x.createElement(Mn,ls)},OF):null})})},FRe=function(e){var t=e.isInteractive,n=t===void 0?Ae.isInteractive:t,r=e.animate,i=r===void 0?Ae.animate:r,s=e.motionConfig,a=s===void 0?Ae.motionConfig:s,o=e.theme,l=e.renderWrapper,c=_B(e,jRe);return v.jsx(ty,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:v.jsx(BRe,nl({isInteractive:n},c))})};const A$="#A97CD2",_m={"user-initiated":{label:"By user",color:"#7CD28F"},timeout:{label:"Timeout",color:"#E8A838"},"server-initiated":{label:"By server",color:"#61CDBB"},unknown:{label:"Unknown",color:"#E8C1A0"},security:{label:"Security",color:"#F47560"},crash:{label:"Crash",color:"#F1E15B"}},L$=({centerX:e,centerY:t,dataWithArc:n,innerRadius:r,active:i})=>{if(i)return v.jsxs(v.Fragment,{children:[v.jsx("circle",{cx:e,cy:t,r:r*.95,fill:i.color}),v.jsxs("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:[i.label,":"]}),v.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:bE(i.data.count)})]});{const s=x.useMemo(()=>n.reduce((a,o)=>a+o.data.count,0),[n]);return v.jsxs(v.Fragment,{children:[v.jsx("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:"Total:"}),v.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:bE(s)})]})}},zRe=x.memo(({data:e,activeId:t,setActiveId:n,width:r,height:i})=>{const s=m3(),[a,o]=x.useState(!1),l=x.useCallback(c=>{if(!t)return L$(c);const d=c.dataWithArc.find(u=>u.id===t);return L$({...c,active:d})},[t]);return!r||!i?null:v.jsx(FRe,{data:e,height:i,width:r,theme:{text:{fontSize:"13px",fontWeight:600}},activeId:t,onActiveIdChange:n,margin:{top:8,right:8,bottom:8,left:8},innerRadius:.6,padAngle:1.75,cornerRadius:4,activeOuterRadiusOffset:6,borderWidth:1,borderColor:s?void 0:{from:"color",modifiers:[["darker",.8]]},valueFormat:".1%",enableArcLinkLabels:!1,layers:["arcs","arcLabels","arcLinkLabels",l],arcLabelsSkipAngle:20,arcLabelsTextColor:{from:"color",modifiers:[["darker",2.5]]},onClick:(c,d)=>o(u=>!u),onMouseEnter:(c,d)=>o(!1),onMouseLeave:(c,d)=>{a&&n(c.id),d.preventDefault()},colors:{datum:"data.color"},tooltip:()=>null,sortByValue:!0})});function HRe(){const[e,t]=x.useState(null),[n,r]=x.useState({width:0,height:0}),i=lt(av),s=SS(),a=x.useMemo(()=>{if(!(i!=null&&i.summaryLast6h)||s().isExpired)return null;if(!i.summaryLast6h.length)return"not_enough_data";const d=i.summaryLast6h.reduce((u,h)=>u+h[1],0);return i.summaryLast6h.map(([u,h])=>{var f,b;return{id:u,label:((f=_m[u])==null?void 0:f.label)??u,count:h,value:h/d,color:((b=_m[u])==null?void 0:b.color)??A$}})},[i==null?void 0:i.summaryLast6h]),o=x.useMemo(()=>!(i!=null&&i.summaryLast6h)||s().isExpired||!i.summaryLast6h.length?null:i.summaryLast6h.map(([d,u])=>{var h,f;return{id:d,label:((h=_m[d])==null?void 0:h.label)??d,color:((f=_m[d])==null?void 0:f.color)??A$}}),[i==null?void 0:i.summaryLast6h]);let l=null;return typeof a=="object"&&a!==null?l=v.jsx(zRe,{data:a,activeId:e,setActiveId:t,width:n.width,height:n.height}):typeof a=="string"?l=v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:v.jsx("p",{className:"max-w-80",children:"No players have disconnected from the server in the last 6 hours."})}):l=v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:v.jsx(dn,{className:"animate-spin size-16 text-muted-foreground"})}),v.jsxs("div",{className:"col-span-3 sm:col-span-2 2xl:col-span-3 py-2 md:rounded-xl border bg-card shadow-sm flex flex-col min-w-64 h-[20rem] max-h-[20rem]",children:[v.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Player drop reasons (last 6h)"}),v.jsx("div",{className:"hidden sm:block",children:v.jsx(IA,{})})]}),v.jsx(A3,{onDebouncedResize:r,children:l}),o&&v.jsx("div",{className:"px-4 mx-auto flex flex-wrap justify-center gap-2",children:o.map(c=>v.jsxs("div",{"data-active":e===c.id,className:"flex items-center cursor-pointer hover:underline data-[active=true]:underline",onClick:()=>t(e===c.id?null:c.id),children:[v.jsx("div",{className:"size-4 mr-1 rounded-full",style:{backgroundColor:c.color}}),v.jsx("span",{className:"text-sm",children:c.label})]},c.id))})]})}const bm=(e,t)=>`translate(${e}, ${t})`;function WRe({svgRef:e,canvasRef:t,setRenderError:n,size:{width:r,height:i},margins:s,isDarkMode:a,bucketLabels:o,dataStart:l,dataEnd:c,lifespans:d,cursorSetter:u}){qr(e).selectAll("*").remove();const h=qr(e);if(h.empty())throw new Error("SVG selection failed.");const f=qr(t);if(f.empty())throw new Error("Canvas selection failed.");if(!(t!=null&&t.getContext))throw new Error("Canvas not supported.");let b=!0;console.log("From:",l.toISOString()),console.log("To:",c.toISOString()),console.log("Window:",UR(c.getTime()-l.getTime())),console.log("Number of lifespans:",d.length);const y=i-s.top-s.bottom,m=r-s.left-s.right;h.append("clipPath").attr("id","fullPerfChartClipPath").append("rect").attr("x",0).attr("y",s.top).attr("width",m).attr("height",i);const p=h.append("g").attr("clip-path","url(#fullPerfChartClipPath)").attr("id","fullPerfChartGroup").attr("transform",bm(s.left,0)),g=vN().domain([l,c]).range([0,m]),_=y1().domain(o).range([i-s.bottom,s.top]),S=yN(a?AN:RN).domain([0,1]),k=io(d,oe=>io(oe.log,se=>se.players)),C=io(d,oe=>io(oe.log,se=>se.fxsMemory)),T=io(d,oe=>io(oe.log,se=>se.nodeMemory)),w=Math.ceil((k+1)/5)*5,E=[i-s.bottom,s.top],$=oc([0,w],E);oc([0,C],E),oc([0,T],E);const M=oc([382,1350],[7,16]),P=X8e(g).ticks(M(r)),D=p.append("g").attr("transform",bm(0,i-s.bottom)).attr("class","time-axis").call(P),R=Y8e(_);h.append("g").attr("class","buckets-axis").attr("transform",bm(r-s.right+s.axis,0)).call(R);const O=k<=7?X9(k+1):null,N=Q8e($).tickFormat(oe=>oe.toString()).tickValues(O);h.append("g").attr("class","players-axis").attr("transform",bm(s.left-s.axis,0)).call(N);let I=[];const j=o.map(oe=>Math.floor(_(oe))),L=Math.ceil(_.bandwidth()),A=Ko(S(0)).darker(1.15).formatHsl(),F=()=>{const oe=f.node();if(!oe)return n("Canvas node not found.");const se=oe.getContext("2d");if(!se)return n("Canvas 2d context not found.");b&&console.time("drawing canvas heatmap"),se.clearRect(0,0,m,y),se.fillStyle=a?"#281C2B":"#E4D4FA",se.fillRect(0,0,m,y),I=[];let fe=0,Q=0;for(const ne of d){const{bootTime:he,closeTime:ve,log:Ce}=ne,Te=g(he||Ce[0].start),we=g(ve||Ce.at(-1).end),be=we-Te;if(!(we<0||Te>m)&&!(be<5)){fe++;for(const mt of ne.log){const Je=Math.floor(g(mt.start)),ct=Math.floor(g(mt.end))-Je;if(ct){I.push(mt);for(let nt=0;nt<mt.weightedPerf.length;nt++){const Ie=mt.weightedPerf[nt];se.fillStyle=Ie>.001?S(Ie):A,se.fillRect(Je,j[nt],ct,L),Q++}}}}}b&&(console.log("Canvas heatmap finished drawing:",{lifespanCount:fe,snapCount:I.length,rectCount:Q}),console.timeEnd("drawing canvas heatmap"))};F();const H=oe=>{const se=oe.bootTime?g(oe.bootTime):g(oe.log[0].start),fe=oe.closeTime?g(oe.closeTime):g(oe.log.at(-1).end),Q=fe-se;return Q<5||fe<0+s.left||se>m+s.left?[]:[{...oe,lifespanStartX:se,lifespanEndX:fe,lifespanWidth:Q}]},B=oe=>{const se=BN(fe=>g(fe.end),fe=>$(fe.players));oe.selectAll("path.players-line-bg").data(H).join("path").attr("class","players-line-bg").each((fe,Q,ne)=>{qr(ne[Q]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","black").attr("stroke-width",6).attr("d",se(fe.log))}),oe.selectAll("path.players-line").data(H).join("path").attr("class","players-line").each((fe,Q,ne)=>{qr(ne[Q]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","rgb(204, 203, 203)").attr("stroke-width",2).attr("d",se(fe.log))})};p.selectAll("g.lifespan").data(d).join("g").attr("class","lifespan").call(B);const G=p.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),J=p.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),W=p.append("text").attr("class","cursorText").attr("fill","rgba(216, 245, 19)").attr("font-size",12),U=p.append("circle").attr("class","cursorDot").attr("fill","red").attr("r",4),z=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),J.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),W.attr("x",-99).attr("y",-99),U.attr("cx",-99).attr("cy",-99),u(void 0)};z();const V=20*60*1e3,K=v1(oe=>oe.end).center,q=oe=>{if(!I.length)return;const se=g.invert(oe),fe=K(I,se);if(fe===-1)return;const Q=I[fe];if(Math.abs(Q.end.getTime()-se.getTime())<V)return{snapIndex:fe,snapData:Q}};let X=null;const ie=(oe,se)=>{const fe=q(oe);if(!fe)return X=null,z();const{snapIndex:Q,snapData:ne}=fe;if(Q===X)return;X=Q,u(ne);const he={x:g(ne.end),y:$(ne.players),val:ne.players};G.attr("x1",he.x).attr("y1",0).attr("x2",he.x).attr("y2",y),J.attr("x1",0).attr("y1",he.y).attr("x2",m).attr("y2",he.y),W.attr("x",5).attr("y",he.y<50?he.y+20:he.y-10).text(he.val),U.attr("cx",he.x).attr("cy",he.y)};let re=!1,ce;const ye=20;p.append("rect").attr("id","cursorTargetRect").attr("x",0).attr("y",0).attr("width",m).attr("height",y).attr("fill","transparent").on("mousemove",function(oe){const[se,fe]=eo(oe);re?(clearTimeout(ce),ce=setTimeout(()=>{ie(se)},ye)):(re=!0,ie(se),setTimeout(()=>{re=!1},ye))}),h.on("mouseleave",function(){setTimeout(()=>{z()},150)});let ae=!1;const Pe=Fn(20,({transform:oe})=>{if(oe.k===1&&oe.x===0){if(!ae)return;ae=!1}else ae=!0;g.range([parseFloat(oe.applyX(0).toFixed(6)),parseFloat(oe.applyX(m).toFixed(6))]),P.ticks(M(r)*oe.k),p.selectAll("g.time-axis").call(P),D.selectAll("rect.day-night"),p.selectAll("g.lifespan").call(B),z(),F()},{noLeading:!1,noTrailing:!1}),ge=[[0,s.top],[m,i-s.top]],xe=ZMe().scaleExtent([1,12]).translateExtent(ge).extent(ge).on("zoom",Pe);h.call(xe),b=!1}const URe=x.memo(({threadName:e,apiData:t,width:n,height:r,isDarkMode:i})=>{const s=et(xS),a=x.useRef(null),o=x.useRef(null),[l,c]=x.useState(""),[d,u]=x.useState(0),h=Eq(),f={top:0,right:50,bottom:30,left:40,axis:1},b=x.useMemo(()=>{if(!t)return s(void 0),null;const y=rRe(t.threadPerfLog,p=>{const g=pB(t.boundaries);return mB(p.buckets,g)});if(!y)return s(void 0),null;const m=iRe(y.lifespans,24);return s(m),{...y,bucketLabels:t.boundaries.map(ig),cursorSetter:p=>{if(!p)return h(void 0);h({threadName:e,snap:p})}}},[t,e,i,l]);return x.useEffect(()=>{if(!(!b||!a.current||!o.current||!n||!r)&&b.lifespans.length)try{console.groupCollapsed("Drawing full performance chart:"),console.time("drawFullPerfChart"),WRe({svgRef:a.current,canvasRef:o.current,setRenderError:c,size:{width:n,height:r},margins:f,isDarkMode:i,...b}),u(0),c(""),console.timeEnd("drawFullPerfChart")}catch(y){c(y.message??"Unknown error.")}finally{console.groupEnd()}},[b,n,r,a,o,l]),!n||!r?null:l?v.jsxs("div",{className:"absolute inset-0 p-4 flex flex-col gap-4 items-center justify-center text-center text-lg font-mono text-destructive-inline",children:["Render Error: ",l,v.jsx("br",{}),v.jsxs(Ve,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{u(y=>y+1),c("")},children:["Retry",d?` (${d})`:""]})]}):v.jsxs(v.Fragment,{children:[v.jsx("svg",{ref:a,width:n,height:r,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),v.jsx("canvas",{ref:o,width:n-f.left-f.right,height:r-f.top-f.bottom,style:{zIndex:0,position:"absolute",top:`${f.top}px`,left:`${f.left}px`}})]})});function VRe({error:e}){const t={bad_request:"Chart data loading failed: bad request.",invalid_thread_name:"Chart data loading failed: invalid thread name.",data_unavailable:"Chart data loading failed: data not yet available.",not_enough_data:v.jsxs("p",{className:"text-center",children:[v.jsx("strong",{children:"There is not enough data to display the chart just yet."}),v.jsx("br",{}),v.jsx("span",{className:"text-base italic",children:"The chart requires at least 30 minutes of server runtime data to be available."})]})};return typeof e=="string"?v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-muted-foreground",children:t[e]??"Unknown BackendApiError"}):v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-destructive-inline",children:["Error: ",e.message??"Unknown Error"]})}function qRe(){const[e,t]=x.useState({width:0,height:0}),[n,r]=x.useState("svMain"),[i,s]=x.useState(""),a=m3(),o=Wt({method:"GET",path:"/perfChartData/:thread/"}),l=Uv("/perfChartData/:thread",async()=>{s("");const d=await o({pathParams:{thread:n}});if(!d)throw new Error("empty_response");return"fail_reason"in d?(s(d.fail_reason),null):d},{});x.useEffect(()=>{l.mutate()},[n]);let c=null;return l.data?c=v.jsx(URe,{threadName:n,apiData:l.data,width:e.width,height:e.height,isDarkMode:a}):l.isLoading?c=v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:v.jsx(dn,{className:"animate-spin size-16 text-muted-foreground"})}):(i||l.error)&&(c=v.jsx(VRe,{error:i||l.error})),v.jsxs("div",{className:"w-full h-[26rem] py-2 md:rounded-xl border bg-card shadow-sm flex flex-col fill-primary",children:[v.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Server performance"}),v.jsxs("div",{className:"flex gap-4",children:[v.jsxs(Ho,{defaultValue:n,onValueChange:r,children:[v.jsx(Ns,{className:"w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",children:v.jsx(Wo,{placeholder:"Filter by admin"})}),v.jsxs(Is,{className:"px-0",children:[v.jsx(Qe,{value:"svMain",className:"cursor-pointer",children:"svMain"}),v.jsx(Qe,{value:"svSync",className:"cursor-pointer",children:"svSync"}),v.jsx(Qe,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),v.jsx("div",{className:"hidden xs:block",children:v.jsx(dK,{})})]})]}),v.jsx(A3,{onDebouncedResize:t,children:c})]})}const KRe=x.memo(({uptimePct:e,medianPlayerCount:t,fxsMemory:n,nodeMemory:r})=>{const i=e?e.toFixed(2)+"%":"--",s=t?Math.ceil(t):"--",a=n?n.toFixed(2)+"MB":"--";let o=null,l="--";if(r){const c=Math.ceil(r.used/r.limit*100);l=r.used.toFixed(2)+"MB ("+c+"%)",c>85?o="text-destructive":c>70&&(o="text-warning")}return v.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-1 gap-4 h-full pb-2 text-muted-foreground",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(FA,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),v.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[v.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:i}),v.jsx("span",{className:"text-center sm:text-right text-sm",children:"Uptime 24h"})]})]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(IK,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),v.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[v.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:s}),v.jsx("span",{className:"text-center sm:text-right text-sm",children:"Median Players 24h"})]})]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(DE,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),v.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[v.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:a}),v.jsx("span",{className:"text-center sm:text-right text-sm",children:"FXServer Memory"})]})]}),v.jsxs("div",{className:ee("flex items-center",o??"text-muted-foreground"),children:[v.jsx(DE,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),v.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[v.jsx("span",{className:ee("text-center sm:text-right text-xl",o??"text-primary"),children:l}),v.jsx("span",{className:"text-center sm:text-right text-sm",children:"Node.js Memory"})]})]})]})});function GRe(){const e=lt(xS),t=lt(lv),n=lt(cv),r=SS(),i=x.useMemo(()=>{const o=r();if(!t||o.isExpired)return null;if(n&&n.snap){const l=VR(n.snap.end,"2-digit","2-digit"),c=pS(n.snap.end,"short"),d=qR(n.snap.end)?l:`${l} - ${c}`;return{fxsMemory:n.snap.fxsMemory,nodeMemory:t.nodeMemory&&n.snap.nodeMemory?{used:n.snap.nodeMemory,limit:t.nodeMemory.limit}:null,titleTimeIndicator:v.jsxs(v.Fragment,{children:["(",v.jsx("span",{className:"text-xs text-warning-inline font-mono",children:d}),")"]})}}else return{fxsMemory:t.fxsMemory,nodeMemory:t.nodeMemory,titleTimeIndicator:o.isStale?"(minutes ago)":"(live)"}},[t,n]);let s=null,a=null;return i?(s=i.titleTimeIndicator,a=v.jsx(KRe,{fxsMemory:i.fxsMemory,medianPlayerCount:e==null?void 0:e.medianPlayerCount,uptimePct:e==null?void 0:e.uptimePct,nodeMemory:i.nodeMemory})):a=v.jsx("div",{className:"size-full flex flex-col items-center justify-center",children:v.jsx(dn,{className:"animate-spin size-16 text-muted-foreground"})}),v.jsxs("div",{className:"col-span-3 sm:col-span-1 2xl:col-span-2 min-w-52 py-2 px-4 flex flex-col md:rounded-xl border shadow-sm bg-card",children:[v.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[v.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:["Server stats ",s]}),v.jsx("div",{className:"hidden xs:block",children:v.jsx(sK,{})})]}),a]})}function YRe(){const e=x.useRef(null),t=kq();return x.useEffect(()=>(e.current=mS(["dashboard"]),e.current.on("connect",()=>{console.log("Dashboard Socket.IO Connected.")}),e.current.on("disconnect",n=>{console.log("Dashboard Socket.IO Disonnected:",n)}),e.current.on("error",n=>{console.log("Dashboard Socket.IO",n)}),e.current.on("dashboard",function(n){t(n)}),()=>{var n,r;(n=e.current)==null||n.removeAllListeners(),(r=e.current)==null||r.disconnect()}),[]),v.jsxs("div",{className:"w-full min-w-96 flex flex-col gap-4",children:[v.jsxs("div",{className:"w-full grid grid-cols-3 2xl:grid-cols-8 gap-4",children:[v.jsx(HRe,{}),v.jsx(GRe,{}),v.jsx(aRe,{})]}),v.jsx(qRe,{}),v.jsx(aP,{featName:"dashboardNewCharts",durationDays:28,children:v.jsxs("div",{className:"mx-auto max-w-4xl w-full sm:w-auto sm:min-w-[28rem] relative overflow-hidden z-40 p-3 pr-10 flex items-center justify-between space-x-4 rounded-xl border shadow-lg transition-all text-black/75 dark:text-white/90 border-warning/70 bg-warning-hint animate-toastbar-enter opacity-50 hover:opacity-100",children:[v.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-warning stroke-warning animate-toastbar-icon",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("path",{d:"M12 16v-4"}),v.jsx("path",{d:"M12 8h.01"})]})}),v.jsx("div",{className:"flex-grow",children:v.jsxs("span",{className:"block whitespace-pre-line",children:[v.jsx("b",{children:"This update changes how the performance chart show its data."})," ",v.jsx("br",{}),"Now the histogram (colors) are based on the time spent on each bucket instead of the number of ticks. And the bucket boundaries (ms) may have changed to have a better resolution at lower tick times."]})})]})})]})}function XRe({reason:e,count:t,totalCrashes:n}){const r=(t/n*100).toFixed(2);return v.jsxs("div",{className:"bg-card rounded-lg border px-2 py-3 flex gap-3 relative",children:[v.jsxs("div",{className:"flex-shrink-0 rounded-md px-3 py-1 m-auto text-sm font-medium bg-secondary text-secondary-foreground",children:[v.jsx("span",{children:t}),v.jsxs("span",{className:"ml-1 ",children:["(",r,"%)"]})]}),v.jsxs("p",{className:"flex-1 text-sm ",children:[e," lipsu"]})]})}function QRe(){var r,i,s;const e=Wt({method:"GET",path:"/playerCrashesData"}),t=Uv("/playerCrashesData",async()=>{const a=await e({});if(!a)throw new Error("empty_response");if("fail_reason"in a)throw new Error(a.fail_reason);return a},{});let n=0;return t.data&&(console.log("asdfsfdgfsd"),n=((r=t.data)==null?void 0:r.reduce((a,[,o])=>a+o,0))??0),v.jsx(v.Fragment,{children:v.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[v.jsxs("div",{className:"px-2 md:px-0",children:[v.jsx("h1",{className:"text-3xl mb-2",children:"Crash Reasons - last 24h"}),v.jsxs("p",{children:["Here you can see all the player crash reasons in the last 24 hours. ",v.jsx("br",{}),"This is useful for troubleshooting and solving bugs. ",v.jsx("br",{}),v.jsxs("span",{className:"text-muted-foreground italic",children:["NOTE: Some crash reasons might be missing due to players using translated game clients.",v.jsx("br",{})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[v.jsxs("span",{className:"shrink-0",children:["Reasons: ",((i=t.data)==null?void 0:i.length)??0]}),t.error?v.jsx("div",{className:"inline-flex flex-wrap gap-1",children:v.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",t.error.message]})}):t.isLoading||t.isValidating?v.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):null]}),v.jsx("div",{className:"space-y-4",children:(s=t.data)==null?void 0:s.map(([a,o])=>v.jsx(XRe,{reason:a,count:o,totalCrashes:n},a))})]})]})})}const JRe=[{path:"/players",title:"Players",children:v.jsx(gie,{})},{path:"/history",title:"History",children:v.jsx(ose,{})},{path:"/whitelist",title:"Whitelist",children:v.jsx(oi,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",children:v.jsx(oi,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",children:v.jsx(oi,{legacyUrl:"settings"})},{path:"/system/master-actions",title:"Master Actions",children:v.jsx(oi,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",children:v.jsx(oi,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",children:v.jsx(E6,{pageName:"console"})},{path:"/system/action-log",title:"Action Log",children:v.jsx(E6,{pageName:"action"})},{path:"/",title:"Dashboard",children:v.jsx(YRe,{})},{path:"/server/console",title:"Live Console",children:v.jsx(pee,{})},{path:"/server/resources",title:"Resources",children:v.jsx(oi,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",children:v.jsx(oi,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",children:v.jsx(oi,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",children:v.jsx(oi,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",children:v.jsx(oi,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",children:v.jsx(oi,{legacyUrl:"advanced"})},{path:"/settings/ban-templates",title:"Ban Templates",children:v.jsx(hle,{})},{path:"/ban-identifiers",title:"Ban Identifiers",children:v.jsx(mle,{})},{path:"/player-crashes",title:"Player Crashes",children:v.jsx(QRe,{})}];function ZRe(e){return xA()(e.title),v.jsx(da,{path:e.path,children:e.children})}function eAe(){const e=et(_A),t=lt(yA);return v.jsx(f7,{FallbackComponent:sq,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),oS("/"),e(!1)},children:v.jsxs(wR,{children:[JRe.map(n=>v.jsx(ZRe,{path:n.path,title:n.title,children:n.children},n.path)),!1,v.jsx(da,{path:"/:fullPath*",component:Aq})]})},t)}const pp="NavigationMenu",[L3,bB,tAe]=zf(pp),[n2,nAe,rAe]=zf(pp),[D3,CPe]=gr(pp,[tAe,rAe]),[iAe,Mi]=D3(pp),[sAe,oAe]=D3(pp),aAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,delayDuration:a=200,skipDelayDuration:o=300,orientation:l="horizontal",dir:c,...d}=e,[u,h]=x.useState(null),f=He(t,E=>h(E)),b=Cu(c),y=x.useRef(0),m=x.useRef(0),p=x.useRef(0),[g,_]=x.useState(!0),[S="",k]=Ls({prop:r,onChange:E=>{const $=E!=="",M=o>0;$?(window.clearTimeout(p.current),M&&_(!1)):(window.clearTimeout(p.current),p.current=window.setTimeout(()=>_(!0),o)),i==null||i(E)},defaultProp:s}),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>k(""),150)},[k]),T=x.useCallback(E=>{window.clearTimeout(m.current),k(E)},[k]),w=x.useCallback(E=>{S===E?window.clearTimeout(m.current):y.current=window.setTimeout(()=>{window.clearTimeout(m.current),k(E)},a)},[S,k,a]);return x.useEffect(()=>()=>{window.clearTimeout(y.current),window.clearTimeout(m.current),window.clearTimeout(p.current)},[]),x.createElement(lAe,{scope:n,isRootMenu:!0,value:S,dir:b,orientation:l,rootNavigationMenu:u,onTriggerEnter:E=>{window.clearTimeout(y.current),g?w(E):T(E)},onTriggerLeave:()=>{window.clearTimeout(y.current),C()},onContentEnter:()=>window.clearTimeout(m.current),onContentLeave:C,onItemSelect:E=>{k($=>$===E?"":E)},onItemDismiss:()=>k("")},x.createElement($e.nav,te({"aria-label":"Main","data-orientation":l,dir:b},d,{ref:f})))}),lAe=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:s,children:a,value:o,onItemSelect:l,onItemDismiss:c,onTriggerEnter:d,onTriggerLeave:u,onContentEnter:h,onContentLeave:f}=e,[b,y]=x.useState(null),[m,p]=x.useState(new Map),[g,_]=x.useState(null);return x.createElement(iAe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:CC(o),baseId:Xr(),dir:i,orientation:s,viewport:b,onViewportChange:y,indicatorTrack:g,onIndicatorTrackChange:_,onTriggerEnter:Ct(d),onTriggerLeave:Ct(u),onContentEnter:Ct(h),onContentLeave:Ct(f),onItemSelect:Ct(l),onItemDismiss:Ct(c),onViewportContentChange:x.useCallback((S,k)=>{p(C=>(C.set(S,k),new Map(C)))},[]),onViewportContentRemove:x.useCallback(S=>{p(k=>k.has(S)?(k.delete(S),new Map(k)):k)},[])},x.createElement(L3.Provider,{scope:t},x.createElement(sAe,{scope:t,items:m},a)))},cAe="NavigationMenuList",uAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Mi(cAe,n),s=x.createElement($e.ul,te({"data-orientation":i.orientation},r,{ref:t}));return x.createElement($e.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange},x.createElement(L3.Slot,{scope:n},i.isRootMenu?x.createElement(kB,{asChild:!0},s):s))}),dAe="NavigationMenuItem",[hAe,xB]=D3(dAe),fAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,s=Xr(),a=r||s||"LEGACY_REACT_AUTO_VALUE",o=x.useRef(null),l=x.useRef(null),c=x.useRef(null),d=x.useRef(()=>{}),u=x.useRef(!1),h=x.useCallback((b="start")=>{if(o.current){d.current();const y=r2(o.current);y.length&&P3(b==="start"?y:y.reverse())}},[]),f=x.useCallback(()=>{if(o.current){const b=r2(o.current);b.length&&(d.current=CAe(b))}},[]);return x.createElement(hAe,{scope:n,value:a,triggerRef:l,contentRef:o,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:h,onFocusProxyEnter:h,onRootContentClose:f,onContentFocusOutside:f},x.createElement($e.li,te({},i,{ref:t})))}),D$="NavigationMenuTrigger",pAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,s=Mi(D$,e.__scopeNavigationMenu),a=xB(D$,e.__scopeNavigationMenu),o=x.useRef(null),l=He(o,a.triggerRef,t),c=TB(s.baseId,a.value),d=$B(s.baseId,a.value),u=x.useRef(!1),h=x.useRef(!1),f=a.value===s.value;return x.createElement(x.Fragment,null,x.createElement(L3.ItemSlot,{scope:n,value:a.value},x.createElement(EB,{asChild:!0},x.createElement($e.button,te({id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":O3(f),"aria-expanded":f,"aria-controls":d},i,{ref:l,onPointerEnter:pe(e.onPointerEnter,()=>{h.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:pe(e.onPointerMove,N0(()=>{r||h.current||a.wasEscapeCloseRef.current||u.current||(s.onTriggerEnter(a.value),u.current=!0)})),onPointerLeave:pe(e.onPointerLeave,N0(()=>{r||(s.onTriggerLeave(),u.current=!1)})),onClick:pe(e.onClick,()=>{s.onItemSelect(a.value),h.current=f}),onKeyDown:pe(e.onKeyDown,b=>{const m={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];f&&b.key===m&&(a.onEntryKeyDown(),b.preventDefault())})})))),f&&x.createElement(x.Fragment,null,x.createElement(hP,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const y=a.contentRef.current,m=b.relatedTarget,p=m===o.current,g=y==null?void 0:y.contains(m);(p||!g)&&a.onFocusProxyEnter(p?"start":"end")}}),s.viewport&&x.createElement("span",{"aria-owns":d})))}),P$="navigationMenu.linkSelect",mAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...s}=e;return x.createElement(EB,{asChild:!0},x.createElement($e.a,te({"data-active":r?"":void 0,"aria-current":r?"page":void 0},s,{ref:t,onClick:pe(e.onClick,a=>{const o=a.target,l=new CustomEvent(P$,{bubbles:!0,cancelable:!0});if(o.addEventListener(P$,c=>i==null?void 0:i(c),{once:!0}),Og(o,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(sg,{bubbles:!0,cancelable:!0});Og(o,c)}},{checkForDefaultPrevented:!1})})))}),wB="NavigationMenuIndicator",gAe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Mi(wB,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?vR.createPortal(x.createElement(yn,{present:n||s},x.createElement(vAe,te({},r,{ref:t}))),i.indicatorTrack):null}),vAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Mi(wB,n),s=bB(n),[a,o]=x.useState(null),[l,c]=x.useState(null),d=i.orientation==="horizontal",u=!!i.value;x.useEffect(()=>{var f;const y=(f=s().find(m=>m.value===i.value))===null||f===void 0?void 0:f.ref.current;y&&o(y)},[s,i.value]);const h=()=>{a&&c({size:d?a.offsetWidth:a.offsetHeight,offset:d?a.offsetLeft:a.offsetTop})};return i2(a,h),i2(i.indicatorTrack,h),l?x.createElement($e.div,te({"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":i.orientation},r,{ref:t,style:{position:"absolute",...d?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}})):null}),pf="NavigationMenuContent",yAe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Mi(pf,e.__scopeNavigationMenu),s=xB(pf,e.__scopeNavigationMenu),a=He(s.contentRef,t),o=s.value===i.value,l={value:s.value,triggerRef:s.triggerRef,focusProxyRef:s.focusProxyRef,wasEscapeCloseRef:s.wasEscapeCloseRef,onContentFocusOutside:s.onContentFocusOutside,onRootContentClose:s.onRootContentClose,...r};return i.viewport?x.createElement(_Ae,te({forceMount:n},l,{ref:a})):x.createElement(yn,{present:n||o},x.createElement(SB,te({"data-state":O3(o)},l,{ref:a,onPointerEnter:pe(e.onPointerEnter,i.onContentEnter),onPointerLeave:pe(e.onPointerLeave,N0(i.onContentLeave)),style:{pointerEvents:!o&&i.isRootMenu?"none":void 0,...l.style}})))}),_Ae=x.forwardRef((e,t)=>{const n=Mi(pf,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return un(()=>{r(e.value,{ref:t,...e})},[e,t,r]),un(()=>()=>i(e.value),[e.value,i]),null}),sg="navigationMenu.rootContentDismiss",SB=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:l,...c}=e,d=Mi(pf,n),u=x.useRef(null),h=He(u,t),f=TB(d.baseId,r),b=$B(d.baseId,r),y=bB(n),m=x.useRef(null),{onItemDismiss:p}=d;x.useEffect(()=>{const _=u.current;if(d.isRootMenu&&_){const S=()=>{var k;p(),o(),_.contains(document.activeElement)&&((k=i.current)===null||k===void 0||k.focus())};return _.addEventListener(sg,S),()=>_.removeEventListener(sg,S)}},[d.isRootMenu,e.value,i,p,o]);const g=x.useMemo(()=>{const S=y().map($=>$.value);d.dir==="rtl"&&S.reverse();const k=S.indexOf(d.value),C=S.indexOf(d.previousValue),T=r===d.value,w=C===S.indexOf(r);if(!T&&!w)return m.current;const E=(()=>{if(k!==C){if(T&&C!==-1)return k>C?"from-end":"from-start";if(w&&k!==-1)return k>C?"to-start":"to-end"}return null})();return m.current=E,E},[d.previousValue,d.value,d.dir,y,r]);return x.createElement(kB,{asChild:!0},x.createElement(Hf,te({id:b,"aria-labelledby":f,"data-motion":g,"data-orientation":d.orientation},c,{ref:h,onDismiss:()=>{var _;const S=new Event(sg,{bubbles:!0,cancelable:!0});(_=u.current)===null||_===void 0||_.dispatchEvent(S)},onFocusOutside:pe(e.onFocusOutside,_=>{var S;l();const k=_.target;(S=d.rootNavigationMenu)!==null&&S!==void 0&&S.contains(k)&&_.preventDefault()}),onPointerDownOutside:pe(e.onPointerDownOutside,_=>{var S;const k=_.target,C=y().some(w=>{var E;return(E=w.ref.current)===null||E===void 0?void 0:E.contains(k)}),T=d.isRootMenu&&((S=d.viewport)===null||S===void 0?void 0:S.contains(k));(C||T||!d.isRootMenu)&&_.preventDefault()}),onKeyDown:pe(e.onKeyDown,_=>{const S=_.altKey||_.ctrlKey||_.metaKey;if(_.key==="Tab"&&!S){const T=r2(_.currentTarget),w=document.activeElement,E=T.findIndex(P=>P===w),M=_.shiftKey?T.slice(0,E).reverse():T.slice(E+1,T.length);if(P3(M))_.preventDefault();else{var C;(C=s.current)===null||C===void 0||C.focus()}}}),onEscapeKeyDown:pe(e.onEscapeKeyDown,_=>{a.current=!0})})))}),CB="NavigationMenuViewport",bAe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=!!Mi(CB,e.__scopeNavigationMenu).value;return x.createElement(yn,{present:n||s},x.createElement(xAe,te({},r,{ref:t})))}),xAe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,s=Mi(CB,n),a=He(t,s.onViewportChange),o=oAe(pf,e.__scopeNavigationMenu),[l,c]=x.useState(null),[d,u]=x.useState(null),h=l?(l==null?void 0:l.width)+"px":void 0,f=l?(l==null?void 0:l.height)+"px":void 0,b=!!s.value,y=b?s.value:s.previousValue;return i2(d,()=>{d&&c({width:d.offsetWidth,height:d.offsetHeight})}),x.createElement($e.div,te({"data-state":O3(b),"data-orientation":s.orientation},i,{ref:a,style:{pointerEvents:!b&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":h,"--radix-navigation-menu-viewport-height":f,...i.style},onPointerEnter:pe(e.onPointerEnter,s.onContentEnter),onPointerLeave:pe(e.onPointerLeave,N0(s.onContentLeave))}),Array.from(o.items).map(([p,{ref:g,forceMount:_,...S}])=>{const k=y===p;return x.createElement(yn,{key:p,present:_||k},x.createElement(SB,te({},S,{ref:Nf(g,C=>{k&&C&&u(C)})})))}))}),wAe="FocusGroup",kB=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Mi(wAe,n);return x.createElement(n2.Provider,{scope:n},x.createElement(n2.Slot,{scope:n},x.createElement($e.div,te({dir:i.dir},r,{ref:t}))))}),O$=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],SAe="FocusGroupItem",EB=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=nAe(n),s=Mi(SAe,n);return x.createElement(n2.ItemSlot,{scope:n},x.createElement($e.button,te({},r,{ref:t,onKeyDown:pe(e.onKeyDown,a=>{if(["Home","End",...O$].includes(a.key)){let l=i().map(u=>u.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),O$.includes(a.key)){const u=l.indexOf(a.currentTarget);l=l.slice(u+1)}setTimeout(()=>P3(l)),a.preventDefault()}})})))});function r2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function P3(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function CAe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function i2(e,t){const n=Ct(t);un(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function O3(e){return e?"open":"closed"}function TB(e,t){return`${e}-trigger-${t}`}function $B(e,t){return`${e}-content-${t}`}function N0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const MB=aAe,RB=uAe,kAe=fAe,AB=pAe,EAe=mAe,LB=gAe,DB=yAe,PB=bAe,s2=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(MB,{ref:r,className:ee("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,v.jsx(jB,{})]}));s2.displayName=MB.displayName;const o2=x.forwardRef(({className:e,...t},n)=>v.jsx(RB,{ref:n,className:ee("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));o2.displayName=RB.displayName;const OB=kAe,TAe=Jo("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:bg-secondary focus:text-secondary-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary/50 data-[state=open]:bg-secondary/50"),NB=x.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(AB,{ref:r,className:ee(TAe(),"group",e),...n,children:[t," ",v.jsx(ku,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));NB.displayName=AB.displayName;const IB=x.forwardRef(({className:e,...t},n)=>v.jsx(DB,{ref:n,className:ee("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));IB.displayName=DB.displayName;const $Ae=EAe,jB=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{className:ee("absolute left-0 top-full flex justify-center"),children:v.jsx(PB,{className:ee("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));jB.displayName=PB.displayName;const MAe=x.forwardRef(({className:e,...t},n)=>v.jsx(LB,{ref:n,className:ee("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:v.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));MAe.displayName=LB.displayName;const[dy,kPe]=gr("Tooltip",[Du]),N3=Du(),RAe="TooltipProvider",AAe=700,a2="tooltip.open",[LAe,I3]=dy(RAe),DAe=e=>{const{__scopeTooltip:t,delayDuration:n=AAe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[a,o]=x.useState(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),x.createElement(LAe,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(d=>{l.current=d},[]),disableHoverableContent:i},s)},j3="Tooltip",[PAe,hy]=dy(j3),OAe=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=I3(j3,e.__scopeTooltip),c=N3(t),[d,u]=x.useState(null),h=Xr(),f=x.useRef(0),b=a??l.disableHoverableContent,y=o??l.delayDuration,m=x.useRef(!1),[p=!1,g]=Ls({prop:r,defaultProp:i,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(a2))):l.onClose(),s==null||s(T)}}),_=x.useMemo(()=>p?m.current?"delayed-open":"instant-open":"closed",[p]),S=x.useCallback(()=>{window.clearTimeout(f.current),m.current=!1,g(!0)},[g]),k=x.useCallback(()=>{window.clearTimeout(f.current),g(!1)},[g]),C=x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{m.current=!0,g(!0)},y)},[y,g]);return x.useEffect(()=>()=>window.clearTimeout(f.current),[]),x.createElement(lC,c,x.createElement(PAe,{scope:t,contentId:h,open:p,stateAttribute:_,trigger:d,onTriggerChange:u,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayed?C():S()},[l.isOpenDelayed,C,S]),onTriggerLeave:x.useCallback(()=>{b?k():window.clearTimeout(f.current)},[k,b]),onOpen:S,onClose:k,disableHoverableContent:b},n))},N$="TooltipTrigger",NAe=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=hy(N$,n),s=I3(N$,n),a=N3(n),o=x.useRef(null),l=He(t,o,i.onTriggerChange),c=x.useRef(!1),d=x.useRef(!1),u=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),x.createElement(cC,te({asChild:!0},a),x.createElement($e.button,te({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:pe(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:pe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:pe(e.onBlur,i.onClose),onClick:pe(e.onClick,i.onClose)})))}),IAe="TooltipPortal",[EPe,jAe]=dy(IAe,{forceMount:void 0}),mf="TooltipContent",BAe=x.forwardRef((e,t)=>{const n=jAe(mf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=hy(mf,e.__scopeTooltip);return x.createElement(yn,{present:r||a.open},a.disableHoverableContent?x.createElement(BB,te({side:i},s,{ref:t})):x.createElement(FAe,te({side:i},s,{ref:t})))}),FAe=x.forwardRef((e,t)=>{const n=hy(mf,e.__scopeTooltip),r=I3(mf,e.__scopeTooltip),i=x.useRef(null),s=He(t,i),[a,o]=x.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:u}=r,h=x.useCallback(()=>{o(null),u(!1)},[u]),f=x.useCallback((b,y)=>{const m=b.currentTarget,p={x:b.clientX,y:b.clientY},g=HAe(p,m.getBoundingClientRect()),_=WAe(p,g),S=UAe(y.getBoundingClientRect()),k=qAe([..._,...S]);o(k),u(!0)},[u]);return x.useEffect(()=>()=>h(),[h]),x.useEffect(()=>{if(l&&d){const b=m=>f(m,d),y=m=>f(m,l);return l.addEventListener("pointerleave",b),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",y)}}},[l,d,f,h]),x.useEffect(()=>{if(a){const b=y=>{const m=y.target,p={x:y.clientX,y:y.clientY},g=(l==null?void 0:l.contains(m))||(d==null?void 0:d.contains(m)),_=!VAe(p,a);g?h():_&&(h(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,a,c,h]),x.createElement(BB,te({},e,{ref:s}))}),[zAe,TPe]=dy(j3,{isInside:!1}),BB=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=hy(mf,n),c=N3(n),{onClose:d}=l;return x.useEffect(()=>(document.addEventListener(a2,d),()=>document.removeEventListener(a2,d)),[d]),x.useEffect(()=>{if(l.trigger){const u=h=>{const f=h.target;f!=null&&f.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),x.createElement(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:d},x.createElement(uC,te({"data-state":l.stateAttribute},c,o,{ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),x.createElement(yS,null,r),x.createElement(zAe,{scope:n,isInside:!0},x.createElement(hP,{id:l.contentId,role:"tooltip"},i||r))))});function HAe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function WAe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function UAe(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function VAe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,c=t[a].x,d=t[a].y;l>r!=d>r&&n<(c-o)*(r-l)/(d-l)+o&&(i=!i)}return i}function qAe(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),KAe(t)}function KAe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const GAe=DAe,YAe=OAe,XAe=NAe,FB=BAe,QAe=GAe,wa=YAe,Sa=XAe,Co=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(FB,{ref:r,sideOffset:t,className:ee("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Co.displayName=FB.displayName;function JAe(e,t){const n=lt(_A),r=dv(),i=gv(),s=a=>{if(e.disabled){a.preventDefault();return}i(),(e.isActive||n)&&(console.log("Page is already active or in error state. Forcing error boundry + router re-render."),r(),a.preventDefault())};return v.jsx(No,{ref:t,href:e.href,onClick:s,className:e.className,children:e.children})}const B3=x.forwardRef(JAe);function Gn({href:e,children:t,className:n,disabled:r}){const[i]=Pf(e);return r?v.jsxs(wa,{children:[v.jsx(Sa,{className:"cursor-help",children:v.jsx(Ve,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),v.jsxs(Co,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",v.jsx("br",{}),"to access this page."]})]}):v.jsx(B3,{href:e,isActive:i,className:ee(If({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function l2({href:e,children:t}){const[n]=Pf(e);return v.jsx(B3,{href:e,isActive:n,children:v.jsx("a",{children:t})})}const I$=Jo("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80"}}});function hs(e){const[t]=Pf(e.href);return v.jsx(OB,{children:v.jsx($Ae,{asChild:!0,active:t,children:e.disabled?v.jsxs(wa,{children:[v.jsx(Sa,{className:"cursor-help",children:v.jsx("a",{className:ee(I$({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),v.jsxs(Co,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",v.jsx("br",{}),"to access this page."]})]}):v.jsx(B3,{href:e.href,isActive:t,className:ee(I$({variant:t?"secondary":"default"}),e.className),children:e.children})})})}function ZAe(){const{hasPerm:e}=ii();return v.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[v.jsx(s2,{children:v.jsxs(o2,{children:[v.jsx(hs,{href:"/players",children:"Players"}),v.jsx(hs,{href:"/history",children:"History"}),v.jsx(hs,{href:"/whitelist",children:"Whitelist"}),v.jsx(hs,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),v.jsx(hs,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),v.jsx(s2,{children:v.jsx(o2,{children:v.jsxs(OB,{children:[v.jsx(NB,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),v.jsxs(IB,{className:"flex flex-col gap-2 p-4 list-none",children:[v.jsx(hs,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),v.jsx(hs,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),v.jsx(hs,{className:"w-36 justify-start",href:"/system/console-log",disabled:!e("txadmin.log.view"),children:"Console Log"}),v.jsx(hs,{className:"w-36 justify-start",href:"/system/action-log",disabled:!e("txadmin.log.view"),children:"Action Log"})]})]})})})]})}const zB="Avatar",[eLe,$Pe]=gr(zB),[tLe,HB]=eLe(zB),nLe=x.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=x.useState("idle");return x.createElement(tLe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s},x.createElement($e.span,te({},r,{ref:t})))}),rLe="AvatarImage",iLe=x.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,a=HB(rLe,n),o=aLe(r),l=Ct(c=>{i(c),a.onImageLoadingStatusChange(c)});return un(()=>{o!=="idle"&&l(o)},[o,l]),o==="loaded"?x.createElement($e.img,te({},s,{ref:t,src:r})):null}),sLe="AvatarFallback",oLe=x.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=HB(sLe,n),[a,o]=x.useState(r===void 0);return x.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&s.imageLoadingStatus!=="loaded"?x.createElement($e.span,te({},i,{ref:t})):null});function aLe(e){const[t,n]=x.useState("idle");return un(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,s=a=>()=>{r&&n(a)};return n("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,()=>{r=!1}},[e]),t}const WB=nLe,UB=iLe,VB=oLe,qB=x.forwardRef(({className:e,...t},n)=>v.jsx(WB,{ref:n,className:ee("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));qB.displayName=WB.displayName;const KB=x.forwardRef(({className:e,...t},n)=>v.jsx(UB,{ref:n,className:ee("aspect-square h-full w-full",e),...t}));KB.displayName=UB.displayName;const GB=x.forwardRef(({className:e,...t},n)=>v.jsx(VB,{ref:n,className:ee("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));GB.displayName=VB.displayName;const j$=["#de87ff","#4ad63b","#8625c2","#81da23","#7135ce","#b1d408","#3953eb","#5ab000","#ad30ce","#01a91e","#e533cd","#00ad3f","#ff2ebe","#00d577","#d800ab","#71dd65","#5836c0","#97d947","#0044cd","#c3cf23","#6369ff","#c8c200","#015fe8","#fcbc01","#ba69ff","#afd440","#d669ff","#1c7a00","#ff5ee8","#5a9300","#a0009e","#70dc85","#f301a0","#00a75d","#f4006b","#69dba1","#b20084","#b8a900","#0178f1","#e4b100","#0266d2","#e49700","#0277d8","#f27b00","#0091e0","#dd2b00","#00d1db","#d80029","#50dbc0","#ff409c","#00702b","#ff8ff6","#386500","#bd88ff","#617700","#948eff","#db7d00","#3f49a4","#ff7c29","#24509c","#ffb14a","#6b3b9a","#e2c45f","#872b84","#019967","#ce0073","#007144","#ff76d0","#4d5e00","#82a3ff","#ff6434","#5aceff","#b93600","#81b5ff","#9c3700","#00a7b6","#ff4a61","#01a79e","#ff4b77","#007f6b","#b1003c","#b4d086","#92266c","#887b00","#d2b0ff","#ac6500","#005f9e","#ff794e","#007db0","#ff695a","#017574","#a6111d","#abc6ff","#975100","#b0bcff","#966800","#ffabed","#265e33","#ff77af","#375b3a","#a7004d","#cbc98f","#972063","#f7bb73","#005a83","#ff915a","#5f487e","#5e5800","#e1b9e9","#6b4e0b","#ff9cc5","#4a582a","#ff8792","#83986d","#873464","#d0b58b","#6f4274","#feb595","#893650","#dba98f","#952f28","#b093bc","#ff8d79","#a06a80","#7e432c","#e8b0cc","#9c6e57","#ff9fa8"],lLe=e=>{e=e.normalize("NFKD").replace(/[\u0300-\u036F]/g,"");let t="";if(/^[A-Z][a-z]*((?:[A-Z][a-z]*)+)$/.test(e)){const n=e.match(/[A-Z]/g);t=n?n.slice(0,2).join(""):"??"}else if(/^[a-z]+([_\-.][a-z]+)+$/.test(e)){const n=e.split(/[_\-.]/);t=n[0][0]+n[1][0]}else{const n=e.replace(/[^a-zA-Z0-9]/g,"");n.length===0?t=e.length?e[0]:"??":n.length<=2?t=n:t=n[0]+n[n.length-1]}return t.toLocaleUpperCase()},cLe=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return j$[Math.abs(t)%j$.length]};function YB({username:e,profilePicture:t,className:n}){return v.jsxs(qB,{className:ee("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&v.jsx(KB,{src:t,alt:e}),v.jsx(GB,{className:n,style:{backgroundColor:cLe(e)},delayMs:t?1e3:void 0,children:lLe(e)})]})}function XB(e){return XR({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"},child:[]}]})(e)}function F3({style:e,className:t}){const n=x.useId(),r=x.useId();return v.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[v.jsxs("mask",{id:n,fill:"#fff",children:[v.jsx("path",{d:"M.42 48.27v191.46C.42 266.39 22.03 288 48.69 288h191.46c26.66 0 48.27-21.61 48.27-48.27V48.27C288.42 21.61 266.81 0 240.15 0H48.69C22.03 0 .42 21.61.42 48.27Zm36.19 106.19.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.733 28.733 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H65.49v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.37 25.37 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38h-25.14Z"}),v.jsx("path",{d:"m310.85 240.677 75.49-180.805a22.205 22.205 0 0 1 20.487-13.65 22.203 22.203 0 0 1 20.486 13.65l75.49 180.805h-36.828l-15.9-38.781h-86.484l-15.901 38.781h-36.84Zm63.603-67.51h64.723l-32.361-79.23-32.362 79.23Z"}),v.jsx("path",{d:"M616.61 120.438V68.424c0-12.256 9.934-22.202 22.202-22.202h11.279v152.041c0 11.994 2.787 16.46 10.327 16.46 1.953 0 4.466-.274 6.98-.559v27.061c-3.621 1.393-9.207 2.227-16.461 2.227-8.087 0-14.507-1.393-19.534-4.466-6.134-4.181-10.04-9.767-11.434-17.021C610.202 236.746 594.027 244 571.707 244c-19.808 0-36.542-6.98-50.216-21.201-13.387-14.233-20.081-31.528-20.081-52.443 0-20.927 6.694-38.222 20.081-52.169 13.674-14.233 30.408-21.201 50.216-21.201 22.583.024 39.603 10.064 44.903 23.452Zm-10.04 80.624c8.373-8.088 12.553-18.414 12.553-30.682 0-12.28-4.18-22.595-12.553-30.682-8.088-8.088-18.415-12.28-30.409-12.28s-21.76 4.18-29.848 12.28c-7.813 8.087-11.72 18.414-11.72 30.682 0 12.28 3.907 22.594 11.72 30.682 8.088 8.087 17.854 12.28 29.848 12.28s22.321-4.193 30.409-12.28Z"}),v.jsx("path",{d:"M680.5 240.677V122.272c0-12.256 9.933-22.201 22.201-22.201h11.006v20.081c5.86-13.673 19.807-22.88 37.661-22.88 19.248 0 32.636 8.087 39.615 24.548 8.088-16.461 23.155-24.548 45.19-24.548 30.408 0 47.988 21.487 47.988 56.349v44.356c0 10.874 1.953 14.781 9.481 14.781l4.609-.012c.072 0 .131.06.131.131v27.49c-3.346 1.12-8.087 1.68-14.507 1.68-22.035 0-32.921-12.28-32.921-36.828V158.35c0-19.248-8.933-31.242-24.548-31.242-15.615 0-27.061 13.674-27.061 32.635v80.898h-33.207v-82.303c0-19.248-9.207-31.242-25.108-31.242-15.627 0-27.335 13.674-27.335 32.636v80.897H680.5v.048Z"}),v.jsx("path",{d:"M907.304 63.898c-.048-10.077 7.789-18.664 17.806-19.772 11.887-1.31 22.095 7.754 22.095 19.677 0 11.16-8.933 19.807-19.808 19.807-11.136 0-20.046-8.6-20.093-19.712Zm25.548 36.173h11.28v98.752c0 10.874 2.227 14.781 9.766 14.781 2.514 0 4.467-.274 5.861-.56v28.181c-3.347 1.393-8.934 2.227-16.735 2.227-21.487 0-32.361-11.994-32.361-35.708V122.26c-.012-12.244 9.933-22.189 22.189-22.189Z"}),v.jsx("path",{d:"M972.3 240.677V122.272c0-12.256 9.934-22.201 22.202-22.201h11.008v20.081c6.69-13.673 22.32-22.88 42.13-22.88 33.19 0 52.44 21.487 52.44 56.349v44.356c0 10.874 1.95 14.781 9.48 14.781l4.61-.012c.07 0 .13.06.13.131v27.49c-3.91 1.12-8.65 1.68-14.51 1.68-22.03 0-32.92-12.28-32.92-36.828V158.35c0-19.248-10.87-31.242-29.57-31.242-18.69 0-31.8 13.388-31.8 32.635v80.898h-33.2v.036Z"})]}),v.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),v.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[v.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),v.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function uLe({style:e,className:t}){const n=x.useId(),r=x.useId();return v.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[v.jsx("mask",{id:n,fill:"#fff",children:v.jsx("path",{d:"M-.46 48.21v191.46c0 26.66 21.61 48.27 48.27 48.27h191.46c26.66 0 48.27-21.61 48.27-48.27V48.21c0-26.66-21.61-48.27-48.27-48.27H47.81C21.15-.06-.46 21.55-.46 48.21ZM35.73 154.4l.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.735 28.735 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H64.61v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.365 25.365 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38H230.2Z"})}),v.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),v.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[v.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),v.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function dLe(){const e=lt(uv),t=lt(pA);return v.jsxs("div",{className:"flex justify-start",children:[v.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),v.jsxs("span",{children:[": ",v.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const z3=`h-11 w-11 sm:h-10 sm:min-w-max sm:px-2 lg:px-3
    flex justify-center items-center gap-2
    transition-all ring-offset-background 
    focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
    rounded-md text-sm border
   
    bg-zinc-100 hover:bg-zinc-200 border-zinc-200
    dark:bg-zinc-900 dark:hover:bg-zinc-800 dark:border-zinc-800
`;function hLe({className:e}){const{setIsSheetOpen:t}=lL();return v.jsxs("button",{className:ee(z3,e),title:"Server Menu",onClick:()=>t(!0),children:[v.jsx(gK,{className:"h-6 w-6 sm:h-5 sm:w-5"}),v.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function fLe({className:e}){const{setIsSheetOpen:t}=aL();return v.jsxs("button",{className:ee(z3,e),title:"Global Menu",onClick:()=>t(!0),children:[v.jsx(mK,{className:"h-6 w-6 sm:h-5 sm:w-5"}),v.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function pLe({className:e}){const{setIsSheetOpen:t}=cL(),n=lt(uv);return v.jsxs("button",{className:ee(z3,e),title:"Global Menu",onClick:()=>t(!0),children:[v.jsx(bK,{className:"h-6 w-6 sm:h-5 sm:w-5"}),v.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",v.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function mLe(){const{authData:e,logout:t}=cl(),{theme:n,setTheme:r}=Cj(),{setAccountModalOpen:i}=OS();if(!e)return null;const s=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},o=()=>{sl("https://discord.gg/uAmsGa2")},l=()=>{t.mutate()};return v.jsxs(vc,{children:[v.jsxs(yc,{className:"flex flex-row items-center gap-2 sm:gap-3 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",children:[v.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),v.jsx(YB,{className:`w-11 h-11 sm:w-10 sm:h-10 rounded-md text-2xl 
                        transition-all focus-visible:outline-none
                        hover:border-zinc-500 hover:border`,username:e.name,profilePicture:e.profilePicture})]}),v.jsxs(Pa,{children:[v.jsxs(Ui,{className:"cursor-pointer",onClick:s,children:[v.jsxs("span",{className:"hidden dark:flex items-center",children:[v.jsx(PK,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),v.jsxs("span",{className:"flex dark:hidden items-center",children:[v.jsx(vK,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),v.jsxs(Ui,{className:"cursor-pointer",onClick:a,children:[v.jsx(cK,{className:"mr-2 h-4 w-4"}),"Your Account"]}),v.jsxs(Ui,{className:"cursor-pointer",onClick:o,children:[v.jsx(XB,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&v.jsxs(v.Fragment,{children:[v.jsx(_c,{}),v.jsxs(Ui,{className:"cursor-pointer",onClick:l,children:[v.jsx(hK,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function gLe(){return v.jsx("header",{className:`sticky top-0 z-20 flex flex-col items-center justify-center
            border-b bg-card text-card-foreground border-card-background`,children:v.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[v.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[v.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:v.jsx(l2,{href:"/",children:v.jsx(F3,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),v.jsx(l2,{href:"/",children:v.jsx(uLe,{className:"h-8 w-8 lg:h-10 lg:w-10 hidden sm:max-xl:block hover:scale-105 hover:brightness-110"})}),v.jsx("div",{className:"lg:hidden",children:v.jsx(dLe,{})}),v.jsx("nav",{className:"hidden lg:block flex-grow",children:v.jsx(ZAe,{})})]}),v.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[v.jsx(hLe,{className:"lg:hidden"}),v.jsx(fLe,{className:"lg:hidden"}),v.jsx(pLe,{className:"xl:hidden"}),v.jsx(mLe,{})]})]})})}function vLe(){return lt(pA)}function yLe({pendingStep:e}){const[t]=bu(),[n,r]=x.useState(""),i=x.useRef("");return x.useEffect(()=>{let s="";if(e==="setup"&&!t.startsWith("/server/setup")?(s="/server/setup",i.current="Go to the setup page!"):e==="deployer"&&!t.startsWith("/server/deployer")?(s="/server/deployer",i.current="Go to the deployer page!"):s="",s){const a=setTimeout(()=>{r(s)},500);return()=>clearTimeout(a)}else{r("");return}},[t,e]),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[v.jsx(lK,{className:"h-12 w-12 opacity-75 animate-pulse"}),v.jsx("p",{className:"text-center text-lg tracking-wider font-light opacity-75",children:"You need to configure your server to be able to start it."}),n?v.jsx(Zc,{href:n,className:"animate-toastbar-enter",children:i.current}):v.jsx(Zc,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||v.jsx(v.Fragment,{children:" "})})]})}function _Le(){const e=lt(mA),{hasPerm:t}=ii();return v.jsxs("div",{className:"relative",children:[e&&v.jsx(yLe,{pendingStep:e}),v.jsxs("div",{className:ee(e&&"opacity-0 pointer-events-none"),children:[v.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight overflow-hidden text-ellipsis",children:v.jsx(vLe,{})}),v.jsxs("div",{className:"space-y-1 select-none",children:[v.jsxs(Gn,{href:"/",children:[v.jsx(uK,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),v.jsxs(Gn,{href:"/server/console",disabled:!t("console.view"),children:[v.jsx(RK,{className:"mr-2 h-4 w-4"}),"Live Console"]}),v.jsxs(Gn,{href:"/server/resources",children:[v.jsx(Bq,{className:"mr-2 h-4 w-4"}),"Resources"]}),v.jsxs(Gn,{href:"/server/server-log",children:[v.jsx(eK,{className:"mr-2 h-4 w-4"}),"Server Log"]}),v.jsxs(Gn,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[v.jsx(nK,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&v.jsxs(Gn,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[v.jsx(Zq,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function bLe({style:e}){return v.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:v.jsx("path",{d:"M18.97 18.35a3.076 3.076 0 0 1-3.42 3.4h-7.1a4.075 4.075 0 0 1-1.529-.25.75.75 0 1 1 .558-1.4 2.679 2.679 0 0 0 .971.146h7.1c1.363 0 1.92-.55 1.92-1.9a3.42 3.42 0 0 0-3.4-3.7.748.748 0 0 1-.714-.783.768.768 0 0 1 .783-.715 4.872 4.872 0 0 1 4.831 5.202zm-12.67.407L2.53 22.53a.75.75 0 0 1-1.06-1.06l3.579-3.579a4.81 4.81 0 0 1 4.721-4.722l1.486-1.485a3.755 3.755 0 1 1 4.428-4.428l2.95-2.95a1.407 1.407 0 0 0-1.124-.556 1.345 1.345 0 0 0-.947.367.75.75 0 1 1-1.046-1.074 2.832 2.832 0 0 1 1.993-.793 2.9 2.9 0 0 1 2.184 1l1.776-1.78a.75.75 0 0 1 1.06 1.06L6.3 18.756zm6.55-8.667 1.24-1.24a2.29 2.29 0 0 0 .17-.84 2.255 2.255 0 1 0-2.25 2.25 2.29 2.29 0 0 0 .84-.17zm5.94-1.41h-.22a.75.75 0 0 0 0 1.5h.22a2.261 2.261 0 0 1 2.46 2.47c0 .864-.309 1.17-1.18 1.17h-.36a.75.75 0 0 0 0 1.5h.36a2.435 2.435 0 0 0 2.68-2.67 3.76 3.76 0 0 0-3.96-3.97zM5.922 8.035a.75.75 0 1 0 .3-1.471A1.421 1.421 0 0 1 6.51 3.75a1.386 1.386 0 0 1 .956.375.749.749 0 0 0 1.029-1.09A2.875 2.875 0 0 0 6.51 2.25a2.922 2.922 0 0 0-.588 5.785zM3.93 15.32h.35a.75.75 0 1 0 0-1.5h-.35c-.871 0-1.18-.306-1.18-1.17a2.261 2.261 0 0 1 2.46-2.47h.99a.75.75 0 0 0 0-1.5h-.99a3.726 3.726 0 0 0-3.96 3.97 2.435 2.435 0 0 0 2.68 2.67z"})})}function xLe({style:e}){return v.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:v.jsx("path",{d:"M19.75 18.02c0 2.405-1.332 3.73-3.75 3.73H8a4.932 4.932 0 0 1-1.072-.108.75.75 0 1 1 .324-1.464A3.555 3.555 0 0 0 8 20.25h8c1.577 0 2.25-.667 2.25-2.23a3.954 3.954 0 0 0-3.411-4.22.75.75 0 1 1 .2-1.486 5.422 5.422 0 0 1 4.711 5.706zm1.78-14.49-19 19a.75.75 0 0 1-1.06-1.06l2.842-2.843a4.87 4.87 0 0 1-.062-.607c0-2.662 1.506-5.77 5.75-5.77h.689l1.521-1.52c-.068 0-.132.02-.2.02a4.25 4.25 0 1 1 4.25-4.25c0 .069-.017.133-.02.2l4.23-4.23a.75.75 0 0 1 1.06 1.06zm-9.521 5.72a2.75 2.75 0 1 0-2.75-2.75 2.753 2.753 0 0 0 2.75 2.75zm-6.18 7.861 3.293-3.293a3.7 3.7 0 0 0-3.293 3.293z"})})}const Pd=Jo(`h-10 sm:h-8 rounded-md transition-colors
    flex flex-grow items-center justify-center flex-shrink-0
    border bg-muted shadow-sm

    focus:outline-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,{variants:{type:{default:"hover:bg-primary hover:text-primary-foreground hover:border-primary",destructive:"hover:bg-destructive hover:text-destructive-foreground hover:border-destructive",warning:"hover:bg-warning hover:text-warning-foreground hover:border-warning",success:"hover:bg-success hover:text-success-foreground hover:border-success",info:"hover:bg-info hover:text-info-foreground hover:border-info"}},defaultVariants:{type:"default"}});function wLe(){const e=lt(mA),t=lt(wq),n=sL(),r=mv(),i=gv(),{hasPerm:s}=ii(),a=Wt({method:"POST",path:"/fxserver/controls"}),o=Wt({method:"POST",path:"/fxserver/commands"}),l=y=>{const m={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},p=`${m[y]}...`,g=()=>{i(),a({data:{action:y},toastLoadingMessage:p})};y==="start"?g():n({title:m[y],message:`Are you sure you want to ${y} the server?`,onConfirm:g})},c=()=>{l(t?"stop":"start")},d=()=>{t&&l("restart")},u=()=>{t&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:y=>{i(),o({data:{action:"admin_broadcast",parameter:y},toastLoadingMessage:"Sending announcement..."})}})},h=()=>{t&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:y=>{i(),o({data:{action:"kick_all",parameter:y},toastLoadingMessage:"Kicking players..."})}})},f=s("control.server"),b=s("players.message");return e?v.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):v.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[v.jsxs(wa,{children:[v.jsx(Sa,{asChild:!0,children:t?v.jsx("button",{onClick:c,className:Pd({type:"destructive"}),disabled:!f,children:v.jsx(xK,{className:"h-5"})}):v.jsxs("div",{className:"relative flex flex-grow inset-0",children:[v.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),v.jsx("button",{onClick:c,className:ee(Pd({type:"success"}),"relative"),disabled:!f,children:v.jsx(wK,{className:"h-5"})})]})}),v.jsx(Co,{className:ee(!f&&"text-destructive-inline text-center"),children:f?v.jsx("p",{children:t?"Stop the server":"Start the server! 🚀"}):v.jsxs("p",{children:["You do not have permission ",v.jsx("br",{}),"to control the server."]})})]}),v.jsxs(wa,{children:[v.jsx(Sa,{asChild:!0,children:v.jsx("button",{onClick:d,className:ee(Pd({type:"warning"})),disabled:!f||!t,children:v.jsx(CK,{className:"h-5"})})}),v.jsx(Co,{className:ee(!f&&"text-destructive-inline text-center"),children:f?v.jsx("p",{children:"Restart Server"}):v.jsxs("p",{children:["You do not have permission ",v.jsx("br",{}),"to control the server."]})})]}),v.jsxs(wa,{children:[v.jsx(Sa,{asChild:!0,children:v.jsx("button",{onClick:h,className:Pd(),disabled:!f||!t,children:v.jsx(bLe,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),v.jsx(Co,{className:ee(!f&&"text-destructive-inline text-center"),children:f?v.jsx("p",{children:"Kick All Players"}):v.jsxs("p",{children:["You do not have permission ",v.jsx("br",{}),"to control the server."]})})]}),v.jsxs(wa,{children:[v.jsx(Sa,{asChild:!0,children:v.jsx("button",{onClick:u,className:Pd(),disabled:!b||!t,children:v.jsx(pK,{className:"h-5"})})}),v.jsx(Co,{className:ee(!b&&"text-destructive-inline text-center"),children:b?v.jsx("p",{children:"Send Announcement"}):v.jsxs("p",{children:["You do not have permission ",v.jsx("br",{}),"to send an Announcement."]})})]})]})}const SLe=Jo("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center cursor-help",{variants:{type:{default:"bg-secondary text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning text-warning-foreground",success:"bg-success text-success-foreground",info:"bg-info text-info-foreground",muted:"bg-muted text-muted-foreground"}},defaultVariants:{type:"default"}});function xm({children:e,tooltip:t,type:n}){return v.jsxs(wa,{children:[v.jsx(Sa,{asChild:!0,children:v.jsx("span",{className:SLe({type:n}),children:e})}),v.jsx(Co,{side:"right",children:v.jsx("p",{children:t})})]})}const B$=["READY","CONNECTING","RECONNECTING","IDLE","NEARLY","DISCONNECTED","WAITING_FOR_GUILDS","IDENTIFYING","RESUMING"];function CLe(){const e=gA();let t="--",n="--",r="default",i="--",s="--",a="default",o="--",l="--",c="default";return e&&(t=e.server.status,e.server.status==="ONLINE"?(r="success",n="Resources running, accepting connections."):e.server.status==="PARTIAL"?(r="warning",n="Resources not running or not accepting connections."):e.server.status==="OFFLINE"?(r="destructive",n="Server is offline."):(r="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(i="DISABLED",s="Anyone can join."):e.server.whitelist==="adminOnly"?(i="ADMIN",a="warning",s="Only admins can join."):e.server.whitelist==="guildMember"?(i="MEMBER",s="Only guild members can join."):e.server.whitelist==="guildRoles"?(i="ROLE",s="Only guild members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(i="LICENSE",s="Only players with an approved license can join."),e.discord===!1?(o="DISABLED",c="default",l="Discord bot is disabled."):e.discord===0?(o="READY",c="default",l="Discord bot is ready."):(o=`CODE-${e.discord}`,c="destructive",l=B$[e.discord]?`Bot ws status: ${B$[e.discord]}`:"Unknown status code")),v.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[v.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",v.jsx(xm,{tooltip:n,type:r,children:t})]}),v.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Process:",v.jsx(xm,{tooltip:"Status of the FXServer process.",children:(e==null?void 0:e.server.process.toUpperCase())??"--"})]}),v.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",v.jsx(xm,{tooltip:s,type:a,children:i})]}),v.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",v.jsx(xm,{tooltip:l,type:c,children:o})]})]})}const QB=Intl.DateTimeFormat().resolvedOptions().timeZone,kLe=v.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",v.jsx("b",{children:window.txConsts.serverTimezone})," ",v.jsx("br",{}),"Your timezone: ",v.jsx("b",{children:QB})," ",v.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),F$={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:v.jsxs(v.Fragment,{children:[v.jsxs("p",{children:["Possible formats: ",v.jsx("br",{}),v.jsxs("ul",{className:"list-disc ml-4",children:[v.jsxs("li",{children:[v.jsx(zn,{children:"+MM"})," relative time in minutes (example: ",v.jsx(zn,{children:"+15"})," for 15 minutes from now.)"]}),v.jsxs("li",{children:[v.jsx(zn,{children:"HH:MM"})," absolute 24-hour time (example: ",v.jsx(zn,{children:"23:30"})," for 11:30 PM.)"]})]})]}),QB!==window.txConsts.serverTimezone&&kLe]}),placeholder:"+15",required:!0,isWide:!0},ELe=e=>{if(e.startsWith("+")){const t=parseInt(e.substring(1));if(isNaN(t)||t<1||t>=1440)return!1}else{const[t,n]=e.split(":",2).map(r=>parseInt(r));if(typeof t>"u"||isNaN(t)||t<0||t>23||typeof n>"u"||isNaN(n)||n<0||n>59)return!1}return!0};function TLe(){const e=gv(),t=mv(),{hasPerm:n}=ii(),r=Wt({method:"POST",path:"/fxserver/schedule"}),i=gA();if(!i)return v.jsxs("div",{children:[v.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),v.jsx("span",{className:"font-light text-muted-foreground italic",children:"loading..."})]});const{scheduler:s}=i;let a="nothing scheduled",o="text-muted-foreground italic",l=!1,c=!1,d=!1;const u=typeof s.nextRelativeMs=="number";if(u){const g=s.nextIsTemp?"(temp)":"",_=Ag(s.nextRelativeMs,{units:["h","m"]}),S=s.nextRelativeMs<6e4;S?(l=!0,a=`right now ${g}`):a=`in ${_} ${g}`,s.nextSkip?(o="text-muted-foreground line-through",S||(d=!0)):(o="text-warning-inline",S||(c=!0))}const h=g=>{if(e(),g.includes(",")){tn.error({title:"Invalid scheduled restart time.",msg:`It looks like you are trying to schedule multiple restart times, which can only be done the Settings page.
This input is for just the next (not persistent) restart.`},{duration:1e4});return}if(!ELe(g)){tn.error(`Invalid schedule time: ${g}`);return}r({data:{action:"setNextTempSchedule",parameter:g},toastLoadingMessage:"Scheduling server restart..."})},f=()=>{t({...F$,onSubmit:h,submitLabel:"Edit"})},b=()=>{t({...F$,onSubmit:h,submitLabel:"Schedule"})},y=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},m=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},p=n("control.server");return v.jsxs("div",{children:[v.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),v.jsx("span",{className:ee("font-light",o),children:a}),v.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[u?v.jsxs(Ve,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!p||l,onClick:f,children:[v.jsx(_K,{className:"h-4 w-4 mr-1"})," Edit"]}):v.jsxs(Ve,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!p||l,onClick:b,children:[v.jsx(Kq,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&v.jsxs(Ve,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:y,disabled:!p,children:[v.jsx(Gq,{className:"h-4 w-4 mr-1"})," Cancel"]}),d&&v.jsxs(Ve,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:m,disabled:!p,children:[v.jsx(qq,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function JB({isSheet:e}){return v.jsxs("aside",{className:ee("flex flex-col gap-4 z-10",e?"mr-4 pl-2":"tx-sidebar hidden lg:flex"),children:[v.jsx("div",{className:ee(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4"),children:v.jsx(_Le,{})}),v.jsx("hr",{className:e?"block":"hidden"}),v.jsxs("div",{className:ee(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[v.jsx(wLe,{}),v.jsx(CLe,{}),v.jsx(TLe,{})]}),v.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?v.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:Oh,target:"_blank",className:`w-sidebar h-[80px] relative self-center group shadow-sm opacity-80 hover:opacity-100
                    dark:brightness-90 dark:hover:brightness-100`,children:[v.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                    scale-0 group-hover:scale-100 transition-transform bg-black
                    dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),v.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?v.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[v.jsxs("span",{className:ee("text-muted-foreground",window.txConsts.txaVersion.includes("-")&&"text-destructive-inline font-semibold"),children:["tx: ",v.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",v.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),v.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:Oh,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function $Le(){const t=lt(uv).toLocaleString("en-US");return v.jsxs("div",{className:"w-full flex justify-between items-center",children:[v.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:v.jsx($S,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),v.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const MLe=e=>{let t=e.substring(0,75).replace(/[\u0000-\u001F\u007F-\u009F\u1CBB\u1CBC\u200B-\u200D\uFEFF\u200E\uA980-\uA9DF\u239B-\u23AD\u534D\u5350\u1000-\u109F\u0B80-\u0BFF]/g,"").replace(/(\uD808[\uDC00-\uDFFF]|\uD809[\uDC00-\uDC7F]|\uD809[\uDC80-\uDD4F]|\uD834[\uDC00-\uDCFF])/g,"").replace(/~(HUD_\S+|HC_\S+|[a-z]|[a1]_\d+|bold|italic|ws|wanted_star|nrt|EX_R\*|BLIP_\S+|ACCEPT|CANCEL|PAD_\S+|INPUT_\S+|INPUTGROUP_\S+)~/ig,"").replace(/\^\d/ig,"").replace(new RegExp("\\p{Mark}{2,}","ug"),"").replace(/\s+/g," ").trim();t.length||(t="empty name");let n=t.normalize("NFKC").replace(/[^\p{Letter}\p{Number} ]/gu,"").replace(/\s+/g,"").toLocaleLowerCase().trim();return n.length||(n="emptyname"),{displayName:t,pureName:n}};function RLe({filterString:e,setFilterString:t}){const n=x.useRef(null);return wi("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),v.jsx("div",{className:"pt-2 px-2 flex gap-2",children:v.jsxs("div",{className:"relative w-full",children:[v.jsx(sn,{ref:n,className:"h-8",placeholder:"Filter by Name or ID",value:e,onChange:r=>t(r.target.value),onKeyDown:r=>{r.key==="Escape"&&t("")}}),e?v.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:()=>t(""),children:v.jsx(ns,{})}):v.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:v.jsx(zn,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const ALe=x.memo(RLe);function LLe({virtualItem:e,player:t,modalOpener:n}){return v.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[v.jsx("div",{className:"pid-block leading-[1.7]",children:v.jsx("span",{className:"pid-badge",children:t.netid})}),v.jsx("span",{className:"pname",children:t.displayName})]})}function DLe(){const e=lt(CS),t=lt(vA),n=yv(),r=x.useRef(null),[i,s]=x.useState(""),a=x.useMemo(()=>{const u=MLe(i).pureName;return u!=="emptyname"?e.filter(h=>h.pureName.includes(u)||h.netid.toString().includes(u)):e},[e,i]),o=x.useMemo(()=>{var f;const u=((f=e.at(-1))==null?void 0:f.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(u))+1+1}ch; }`},[e]),l=xC({scrollingDelay:0,count:a.length,getScrollElement:()=>{var u;return(u=r.current)==null?void 0:u.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),d=u=>{t&&n({mutex:t,netid:u})};return v.jsxs(v.Fragment,{children:[v.jsx(ALe,{filterString:i,setFilterString:s}),v.jsxs("div",{className:ee("text-center m-1 text-warning-inline tracking-wider italic text-xs",a.length!==e.length&&c.length?"block":"hidden"),children:["Showing ",a.length," of ",e.length," players."]}),v.jsx("div",{className:ee("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?v.jsxs("p",{children:["No players to show.",v.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):v.jsxs("p",{children:["No players online.",v.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),v.jsx("style",{children:o}),v.jsx(Si,{className:"h-full select-none",ref:r,children:v.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(u=>v.jsx(LLe,{virtualItem:u,player:a[u.index],modalOpener:d},u.key))})})]})}function ZB({isSheet:e}){return v.jsxs("aside",{className:ee("flex flex-col gap-4 z-10",e?"w-full pr-2":"tx-sidebar hidden xl:flex"),style:{height:e?"calc(100vh - 3rem)":"calc(100vh - 3.5rem - 1px - 2rem)"},children:[v.jsx("div",{className:"rounded-xl border border-border bg-card text-card-foreground shadow-sm shrink-0 p-4",children:v.jsx($Le,{})}),v.jsx("div",{className:ee("min-h-[480px]",!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm","flex flex-col gap-2 flex-grow overflow-hidden"),children:v.jsx(DLe,{})})]})}const H3=TC,PLe=$C,eF=x.forwardRef(({className:e,...t},n)=>v.jsx(qf,{className:ee("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));eF.displayName=qf.displayName;const OLe=Jo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),fy=x.forwardRef(({side:e="right",className:t,children:n,...r},i)=>v.jsxs(PLe,{children:[v.jsx(eF,{}),v.jsxs(Kf,{ref:i,className:ee(OLe({side:e}),t),...r,children:[n,v.jsxs(Nv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[v.jsx(ns,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fy.displayName=Kf.displayName;const tF=({className:e,...t})=>v.jsx("div",{className:ee("flex flex-col space-y-2 text-center sm:text-left",e),...t});tF.displayName="SheetHeader";const nF=x.forwardRef(({className:e,...t},n)=>v.jsx(Gf,{ref:n,className:ee("text-lg font-semibold text-foreground",e),...t}));nF.displayName=Gf.displayName;const NLe=x.forwardRef(({className:e,...t},n)=>v.jsx(Yf,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));NLe.displayName=Yf.displayName;function ILe(){const{isSheetOpen:e,setIsSheetOpen:t}=aL(),{hasPerm:n}=ii();return v.jsx(H3,{open:e,onOpenChange:t,children:v.jsxs(fy,{side:"left",className:"flex flex-col gap-6 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:[v.jsx(tF,{children:v.jsx(nF,{children:v.jsx(l2,{href:"/",children:v.jsx(F3,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),v.jsxs("div",{children:[v.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsxs(Gn,{href:"/players",children:[v.jsx($S,{className:"mr-2 h-4 w-4"}),"Players"]}),v.jsxs(Gn,{href:"/history",children:[v.jsx(kK,{className:"mr-2 h-4 w-4"}),"History"]}),v.jsxs(Gn,{href:"/whitelist",children:[v.jsx(Xq,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),v.jsxs(Gn,{href:"/admins",disabled:!n("manage.admins"),children:[v.jsx(AK,{className:"mr-2 h-4 w-4"}),"Admins"]}),v.jsxs(Gn,{href:"/settings",disabled:!n("settings.view"),children:[v.jsx($K,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),v.jsxs("div",{children:[v.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsxs(Gn,{href:"/system/master-actions",children:[v.jsx(BK,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),v.jsxs(Gn,{href:"/system/diagnostics",children:[v.jsx(IA,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),v.jsxs(Gn,{href:"/system/console-log",disabled:!n("txadmin.log.view"),children:[v.jsx(Fg,{className:"mr-2 h-4 w-4"}),"Console Log"]}),v.jsxs(Gn,{href:"/system/action-log",disabled:!n("txadmin.log.view"),children:[v.jsx(Fg,{className:"mr-2 h-4 w-4"}),"Action Log"]})]})]})]})})}function jLe(){const{isSheetOpen:e,setIsSheetOpen:t}=lL();return v.jsx(H3,{open:e,onOpenChange:t,children:v.jsx(fy,{side:"left",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:v.jsx(Si,{className:"h-full",children:v.jsx(JB,{isSheet:!0})})})})}function BLe(){const{isSheetOpen:e,setIsSheetOpen:t}=cL();return v.jsx(H3,{open:e,onOpenChange:t,children:v.jsx(fy,{side:"right",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:v.jsx(Si,{className:"h-full",children:v.jsx(ZB,{isSheet:!0})})})})}function FLe(){return v.jsxs(v.Fragment,{children:[v.jsx(ILe,{}),v.jsx(jLe,{}),v.jsx(BLe,{})]})}const rF=Ge(!1),iF=Ge(window.txConsts.fxsOutdated),sF=Ge(window.txConsts.txaOutdated);function zLe(){const[e,t]=fr(rF),[n,r]=fr(iF),[i,s]=fr(sF);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:s}}const HLe=()=>et(rF),WLe=()=>{const e=et(iF),t=et(sF);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},oF="tsUpdateDismissed",ULe=12*60*60*1e3,VLe=48*60*60*1e3,qLe=()=>{const e=localStorage.getItem(oF);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},KLe=e=>{const t=qLe(),n=Date.now();return!t||t+(e?ULe:VLe)<n};function ob({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[s,a]=x.useState(0),o=()=>{a(Math.random())},l=()=>{localStorage.setItem(oF,Date.now().toString()),o()};return x.useEffect(()=>{const c=setInterval(()=>{o()},6e4);return()=>clearInterval(c)},[]),i&&!KLe(r)?null:v.jsx("div",{className:"absolute top-[calc(3.5rem+1px)] w-full flex justify-center z-40",children:v.jsxs("div",{className:ee("w-full sm:w-[28rem] h-9 hover:h-32 overflow-hidden sm:rounded-b-md","flex flex-col justify-center items-center p-2","group cursor-default transition-[height] shadow-xl",r?"bg-destructive text-destructive-foreground":"bg-info text-info-foreground"),children:[v.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),v.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,v.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&v.jsxs(Ve,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[v.jsx(Iq,{className:"h-[0.9rem] mr-1"})," Postpone"]}),v.jsx(Ve,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:v.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[v.jsx(XB,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function GLe(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=zLe();return e?v.jsx(ob,{titleIcon:v.jsx(Jq,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:v.jsxs(v.Fragment,{children:["The connection to the txAdmin server has been lost. ",v.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?v.jsx(ob,{titleIcon:v.jsx(LE,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:t.isImportant?"This version of txAdmin is outdated.":"A patch (bug fix) update is available for txAdmin.",description:t.isImportant?`Version v${t.version} has been released bringing new features, bug fixes and improvements.`:`If you are experiencing any kind of issue, please update to v${t.version}.`,isImportant:t.isImportant,canPostpone:!0}):n?v.jsx(ob,{titleIcon:v.jsx(LE,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:n.isImportant?"This version of FXServer is outdated.":"An update is available for FXServer.",description:`Please update FXServer to artifact ${n.version}.`,isImportant:n.isImportant,canPostpone:!0}):null}const YLe="AlertDialog",[XLe,MPe]=gr(YLe,[RP]),na=RP(),QLe=e=>{const{__scopeAlertDialog:t,...n}=e,r=na(t);return x.createElement(TC,te({},r,n,{modal:!0}))},JLe=e=>{const{__scopeAlertDialog:t,...n}=e,r=na(t);return x.createElement($C,te({},r,n))},ZLe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=na(n);return x.createElement(qf,te({},i,r,{ref:t}))}),aF="AlertDialogContent",[eDe,tDe]=XLe(aF),nDe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=na(n),a=x.useRef(null),o=He(t,a),l=x.useRef(null);return x.createElement(wse,{contentName:aF,titleName:rDe,docsSlug:"alert-dialog"},x.createElement(eDe,{scope:n,cancelRef:l},x.createElement(Kf,te({role:"alertdialog"},s,i,{ref:o,onOpenAutoFocus:pe(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)===null||d===void 0||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),x.createElement(yS,null,r),!1)))}),rDe="AlertDialogTitle",iDe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=na(n);return x.createElement(Gf,te({},i,r,{ref:t}))}),sDe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=na(n);return x.createElement(Yf,te({},i,r,{ref:t}))}),oDe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=na(n);return x.createElement(Nv,te({},i,r,{ref:t}))}),aDe="AlertDialogCancel",lDe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=tDe(aDe,n),s=na(n),a=He(t,i);return x.createElement(Nv,te({},s,r,{ref:a}))}),cDe=QLe,uDe=JLe,lF=ZLe,cF=nDe,uF=oDe,dF=lDe,hF=iDe,fF=sDe,dDe=cDe,hDe=uDe,pF=x.forwardRef(({className:e,...t},n)=>v.jsx(lF,{className:ee("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));pF.displayName=lF.displayName;const mF=x.forwardRef(({className:e,...t},n)=>v.jsxs(hDe,{children:[v.jsx(pF,{}),v.jsx(cF,{ref:n,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));mF.displayName=cF.displayName;const gF=({className:e,...t})=>v.jsx("div",{className:ee("flex flex-col space-y-2 text-center sm:text-left",e),...t});gF.displayName="AlertDialogHeader";const vF=({className:e,...t})=>v.jsx("div",{className:ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vF.displayName="AlertDialogFooter";const yF=x.forwardRef(({className:e,...t},n)=>v.jsx(hF,{ref:n,className:ee("text-lg font-semibold",e),...t}));yF.displayName=hF.displayName;const _F=x.forwardRef(({className:e,...t},n)=>v.jsx(fF,{ref:n,className:ee("text-sm text-muted-foreground",e),...t}));_F.displayName=fF.displayName;const bF=x.forwardRef(({className:e,...t},n)=>v.jsx(uF,{ref:n,className:ee(If(),e),...t}));bF.displayName=uF.displayName;const xF=x.forwardRef(({className:e,...t},n)=>v.jsx(dF,{ref:n,className:ee(If({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xF.displayName=dF.displayName;function fDe(){const e=x.useRef(null),t=kG(),n=CG(),r=()=>{t.isOpen&&(n(),t.onCancel&&t.onCancel())},i=()=>{t.isOpen&&(n(),t.onConfirm())},s=o=>{o.preventDefault(),o.key==="Enter"||o.key==="NumpadEnter"?i():(o.key==="Backspace"||o.key==="Escape")&&r()},a=o=>{o||r()};return pW(e,r),v.jsx(dDe,{open:t.isOpen,onOpenChange:a,children:v.jsxs(mF,{ref:e,children:[v.jsxs(gF,{children:[v.jsx(yF,{children:t.title}),v.jsx(_F,{children:t.message})]}),v.jsxs(vF,{children:[v.jsx(xF,{children:t.cancelLabel??"Cancel"}),v.jsx(bF,{autoFocus:!0,onKeyDown:s,onClick:i,className:ee(If({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}function pDe(){const e=x.useRef(null),t=TG(),n=EG(),r=()=>{var o;if(!t.isOpen)return;n();const a=((o=e.current)==null?void 0:o.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},s=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return v.jsx(Xf,{open:t.isOpen,onOpenChange:s,children:v.jsx(Ou,{className:ee(t.isWide&&"md:max-w-2xl"),children:v.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[v.jsxs(Nu,{children:[v.jsx(Iu,{children:t.title}),v.jsx(IP,{children:t.message})]}),v.jsx(sn,{autoFocus:!0,id:"userInput",ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),v.jsxs(Iv,{className:"gap-2 flex-col",children:[v.jsx("div",{className:"flex flex-col sm:flex-row sm:justify-start gap-2 w-full flex-wrap",children:t.suggestions&&t.suggestions.map((a,o)=>v.jsxs(Ve,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[v.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},o))}),v.jsx(Ve,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}const wF="Tabs",[mDe,RPe]=gr(wF,[kv]),SF=kv(),[gDe,W3]=mDe(wF),vDe=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...c}=e,d=Cu(o),[u,h]=Ls({prop:r,onChange:i,defaultProp:s});return x.createElement(gDe,{scope:n,baseId:Xr(),value:u,onValueChange:h,orientation:a,dir:d,activationMode:l},x.createElement($e.div,te({dir:d,"data-orientation":a},c,{ref:t})))}),yDe="TabsList",_De=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=W3(yDe,n),a=SF(n);return x.createElement(kD,te({asChild:!0},a,{orientation:s.orientation,dir:s.dir,loop:r}),x.createElement($e.div,te({role:"tablist","aria-orientation":s.orientation},i,{ref:t})))}),bDe="TabsTrigger",xDe=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=W3(bDe,n),o=SF(n),l=CF(a.baseId,r),c=kF(a.baseId,r),d=r===a.value;return x.createElement(ED,te({asChild:!0},o,{focusable:!i,active:d}),x.createElement($e.button,te({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},s,{ref:t,onMouseDown:pe(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?a.onValueChange(r):u.preventDefault()}),onKeyDown:pe(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(r)}),onFocus:pe(e.onFocus,()=>{const u=a.activationMode!=="manual";!d&&!i&&u&&a.onValueChange(r)})})))}),wDe="TabsContent",SDe=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=W3(wDe,n),l=CF(o.baseId,r),c=kF(o.baseId,r),d=r===o.value,u=x.useRef(d);return x.useEffect(()=>{const h=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(h)},[]),x.createElement(yn,{present:i||d},({present:h})=>x.createElement($e.div,te({"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0}}),h&&s))});function CF(e,t){return`${e}-trigger-${t}`}function kF(e,t){return`${e}-content-${t}`}const CDe=vDe,EF=_De,TF=xDe,$F=SDe,kDe=CDe,MF=x.forwardRef(({className:e,...t},n)=>v.jsx(EF,{ref:n,className:ee("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));MF.displayName=EF.displayName;const c2=x.forwardRef(({className:e,...t},n)=>v.jsx(TF,{ref:n,className:ee("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));c2.displayName=TF.displayName;const U3=x.forwardRef(({className:e,...t},n)=>v.jsx($F,{ref:n,className:ee("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));U3.displayName=$F.displayName;const wm="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",di={regexValidHwidToken:/^[0-9A-Fa-f]{1,2}:[0-9A-Fa-f]{64}$/,validIdentifiers:{discord:/^discord:\d{17,20}$/,fivem:/^fivem:\d{1,8}$/,license:/^license:[0-9A-Fa-f]{40}$/,license2:/^license2:[0-9A-Fa-f]{40}$/,live:/^live:\d{14,20}$/,steam:/^steam:1100001[0-9A-Fa-f]{8}$/,xbl:/^xbl:\d{14,20}$/},validIdentifierParts:{discord:/^\d{17,20}$/,fivem:/^\d{1,8}$/,license:/^[0-9A-Fa-f]{40}$/,license2:/^[0-9A-Fa-f]{40}$/,live:/^\d{14,20}$/,steam:/^1100001[0-9A-Fa-f]{8}$/,xbl:/^\d{14,20}$/},adminPasswordMinLength:6,adminPasswordMaxLength:128,regexActionID:new RegExp(`^[${wm}]{4}-[${wm}]{4}$`),regexWhitelistReqID:new RegExp(`R[${wm}]{4}`),regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,noLookAlikesAlphabet:wm,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/},EDe=x.memo(function(){const{authData:e,setAuthData:t}=cl(),{setAccountModalTab:n}=OS(),r=rL(),i=Wt({method:"POST",path:"/auth/changePassword"}),[s,a]=x.useState(""),[o,l]=x.useState(""),[c,d]=x.useState(""),[u,h]=x.useState(""),[f,b]=x.useState(!1),y=m=>{if(m==null||m.preventDefault(),!!e){if(h(""),o.length<di.adminPasswordMinLength||o.length>di.adminPasswordMaxLength){h(`The password must be between ${di.adminPasswordMinLength} and ${di.adminPasswordMaxLength} digits long.`);return}else if(o!==c){h("The passwords do not match.");return}b(!0),i({data:{newPassword:o,oldPassword:e.isTempPassword?void 0:s},error:p=>{b(!1),h(p)},success:p=>{b(!1),"success"in p?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(tn.success("Password changed successfully!"),r()):h(p.error)}})}};if(e)return v.jsx(U3,{value:"password",tabIndex:void 0,children:v.jsxs("form",{onSubmit:y,children:[e.isTempPassword?v.jsxs("p",{className:"text-sm text-warning-inline",children:["Your account has a temporary password that needs to be changed before you can use this web panel. ",v.jsx("br",{}),v.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):v.jsx("p",{className:"text-sm text-muted-foreground",children:"You can use your password to login to the txAdmin inferface even without using the Cfx.re login button."}),v.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&v.jsxs("div",{className:"space-y-1",children:[v.jsx(Jn,{htmlFor:"current-password",children:"Current Password"}),v.jsx(sn,{id:"current-password",placeholder:"Enter current password",type:"password",value:s,autoFocus:!0,required:!0,onChange:m=>{a(m.target.value),h("")}})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx(Jn,{htmlFor:"new-password",children:"New Password"}),v.jsx(sn,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:o,autoFocus:e.isTempPassword,required:!0,onChange:m=>{l(m.target.value),h("")}})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx(Jn,{htmlFor:"confirm-password",children:"Confirm Password"}),v.jsx(sn,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:m=>{d(m.target.value),h("")}})]})]}),u&&v.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:u}),v.jsx(Ve,{className:"w-full",type:"submit",disabled:f,children:f?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function TDe(){const e=uP(),[t,n]=x.useState(""),[r,i]=x.useState(""),[s,a]=x.useState(""),[o,l]=x.useState(!1),c=rL(),[d,u]=x.useState(!1),{isPending:h,error:f,data:b}=_G({queryKey:["getIdentifiers"],gcTime:3e4,queryFn:()=>e("/auth/getIdentifiers")}),y=Wt({method:"POST",path:"/auth/changeIdentifiers"});x.useEffect(()=>{b&&(n(b.cfxreId),i(b.discordId))},[b]),x.useEffect(()=>{a(f?f.message:"")},[f]);const m=_=>{_==null||_.preventDefault(),a(""),u(!0),y({data:{cfxreId:t,discordId:r},error:S=>{a(S)},success:S=>{u(!1),"success"in S?(tn.success("Identifiers changed successfully!"),c()):a(S.error)}})},p=async()=>{if(!t)return;const _=t.trim();if(/^\d+$/.test(_))n(`fivem:${_}`);else if(_.startsWith("fivem:"))t!==_&&n(_);else{try{l(!0);const S=await cie(`https://forum.cfx.re/u/${_}.json`);S.user&&typeof S.user.id=="number"?n(`fivem:${S.user.id}`):a("Could not find the user in the forum. Make sure you typed the username correctly.")}catch{a("Failed to check the identifiers on the forum API.")}l(!1)}},g=()=>{if(!r)return;const _=r.trim();/^\d+$/.test(_)?i(`discord:${_}`):r!==_&&i(_)};return v.jsx(U3,{value:"identifiers",tabIndex:void 0,children:v.jsxs("form",{onSubmit:m,children:[v.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",v.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",v.jsx("strong",{children:"In Game Menu"})," and the ",v.jsx("strong",{children:"Discord Bot"}),". ",v.jsx("br",{}),v.jsx("strong",{children:"It is recommended that you configure at least one."})]}),v.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsxs(Jn,{htmlFor:"cfxreId",children:["FiveM identifier ",v.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),v.jsx(sn,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:h||o?"loading...":t,disabled:h||o,autoFocus:!0,onBlur:p,onChange:_=>{n(_.target.value),a("")}}),v.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your identifier can be found by clicking in your name in the playerlist and going to the IDs page. ",v.jsx("br",{}),"You can also type in your ",v.jsx(Zc,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",v.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs(Jn,{htmlFor:"discordId",children:["Discord identifier ",v.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),v.jsx(sn,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:h?"loading...":r,disabled:h,onBlur:g,onChange:_=>{i(_.target.value),a("")}}),v.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",v.jsx(Zc,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",v.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),s&&v.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:s}),v.jsx(Ve,{className:"w-full",type:"submit",disabled:!b||d,children:d?"Saving...":"Save Changes"})]})})}function $De(){const{authData:e}=cl(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=OS();x.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const s=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return v.jsx(Xf,{open:t,onOpenChange:s,children:v.jsxs(Ou,{className:"sm:max-w-lg",tabIndex:void 0,children:[v.jsx(Nu,{children:v.jsx(Iu,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),v.jsxs(kDe,{defaultValue:"password",value:r,onValueChange:i,children:[v.jsxs(MF,{className:"grid w-full grid-cols-2 mb-4",children:[v.jsx(c2,{value:"password",children:"Password"}),v.jsx(c2,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),v.jsx(EDe,{}),v.jsx(TDe,{})]})]})})}const MDe=5*60;function Ec({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:s,timeStyle:a}){const o=n-e,l=n-t,c=e-l,d=()=>{tn.warning(`This means that the server clock is ${Math.abs(o)} seconds ${o>0?"ahead":"behind"} your computer time. Make sure both your computer and the server have their clocks synchronized.`)},u=i?_V(c,s??"medium"):ic(c,s??"medium",a??"short");return v.jsxs("span",{className:r,title:ic(c,"long","long"),children:[u,Math.abs(o)>MDe&&v.jsx("button",{className:"ml-1 text-warning-inline",onClick:d,children:"(clock drift)"})]})}function z$({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?v.jsxs("span",{className:ee("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block","bg-secondary text-secondary-foreground"),children:["0 ",e,"s"]}):v.jsxs("span",{className:ee("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block",e==="Ban"?"bg-destructive text-destructive-foreground":"bg-warning text-warning-foreground"),children:[t," ",n]})}const H$=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function RDe({playerRef:e,player:t,refreshModalData:n}){const r=x.useRef(null),[i,s]=x.useState(t.notesLog??""),[a,o]=x.useState(H$(t.notes)),l=Wt({method:"POST",path:"/player/save_note"}),c=()=>{var u;s("Saving..."),l({queryParams:e,data:{note:(u=r.current)==null?void 0:u.value.trim()},success:h=>{"error"in h?s(h.error):n()}})},d=u=>{u.key==="Enter"&&!u.shiftKey&&!window.txIsMobile?(u.preventDefault(),c()):o(H$(u.currentTarget.value))};return v.jsxs(v.Fragment,{children:[v.jsxs(Jn,{htmlFor:"playerNotes",children:["Notes: ",v.jsx("span",{className:"text-muted-foreground",children:i})]}),v.jsx(Vv,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>s("Press enter to save."),onKeyDown:d,style:{height:`${1+1.25*a}rem`},placeholder:t.isRegistered?"Type your notes about the player.":"Cannot set notes for players that are not registered."}),window.txIsMobile&&v.jsx("div",{className:"mt-2 w-full",children:v.jsx(Ve,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function ADe({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:s}){const{hasPerm:a}=ii(),o=Wt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?Ag(t.sessionTime*6e4,{units:["h","m"]}):"--",c=t.tsLastConnection?v.jsx(Ec,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",d=t.playTime?Ag(t.playTime*6e4,{units:["d","h","m"]}):"--",u=t.tsJoined?v.jsx(Ec,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",h=t.tsWhitelisted?v.jsx(Ec,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",f=t.actionHistory.filter(m=>m.type==="ban"&&!m.revokedAt).length,b=t.actionHistory.filter(m=>m.type==="warn"&&!m.revokedAt).length,y=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(m,p)=>{"success"in m&&s()}})};return v.jsxs("div",{className:"p-1",children:[v.jsxs("dl",{className:"pb-2",children:[t.isConnected&&v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:d})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u})]}),!t.isConnected&&v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),v.jsx("dd",{className:"text-sm leading-6 mt-0",children:h}),v.jsx("dd",{className:"text-right",children:v.jsx(Ve,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:y,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),v.jsxs("dd",{className:"text-sm leading-6 mt-0 space-x-2",children:[v.jsx(z$,{type:"Ban",count:f}),v.jsx(z$,{type:"Warn",count:b})]}),v.jsx("dd",{className:"text-right",children:v.jsx(Ve,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),v.jsx(RDe,{player:t,playerRef:e,refreshModalData:s})]})}function W$({title:e,emptyMessage:t,currIds:n,allIds:r,isSmaller:i}){x.useState(!1);const s=n.sort((o,l)=>o.localeCompare(l)),a=r.filter(o=>!n.includes(o)).sort((o,l)=>o.localeCompare(l));return v.jsxs("div",{children:[v.jsx("div",{className:"flex justify-between items-center pb-1",children:v.jsx("h3",{className:"text-xl",children:e})}),v.jsxs("p",{className:ee("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[s.length===0&&v.jsx("span",{className:"block px-1 opacity-50 italic",children:t}),s.map(o=>v.jsx("span",{className:"block px-1 font-semibold",children:o},o)),a.map(o=>v.jsx("span",{className:"block px-1 opacity-50",children:o},o))]})]})}function LDe({player:e}){return v.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[v.jsx(W$,{title:"Player Identifiers",emptyMessage:"This player has no identifiers.",currIds:e.ids,allIds:(e==null?void 0:e.oldIds)??[]}),v.jsx(W$,{title:"Player Hardware IDs",emptyMessage:"This player has no hardware IDs.",currIds:e.hwids,allIds:(e==null?void 0:e.oldHwids)??[],isSmaller:!0})]})}function py({children:e}){return v.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function DDe({action:e,serverTime:t,modalOpener:n}){let r,i,s;if(e.type==="ban"?(i="border-destructive",s=`BANNED by ${e.author}`):e.type==="warn"&&(i="border-warning",s=`WARNED by ${e.author}`),e.revokedBy){i="";const a=ic(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=ic(e.exp,"medium","short");r=e.exp<t?`Expired on ${a}.`:`Expires in ${a}.`}return v.jsxs("div",{onClick:()=>{n(e.id)},className:ee("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[v.jsxs("div",{className:"flex w-full justify-between",children:[v.jsx("strong",{className:"text-sm text-muted-foreground",children:s}),v.jsxs("small",{className:"text-right text-2xs space-x-1",children:[v.jsx(zn,{className:"tracking-widest",children:e.id}),v.jsx("span",{className:"opacity-75 cursor-help",title:ic(e.ts,"long","long"),children:ic(e.ts,"medium","short")})]})]}),v.jsx("span",{className:"text-sm",children:e.reason}),r&&v.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function PDe({actionHistory:e,serverTime:t,refreshModalData:n}){const r=JL();if(!e.length)return v.jsx(py,{children:"No bans/warns found."});const i=a=>{r(a)},s=[...e].reverse();return v.jsx("div",{className:"flex flex-col gap-1 p-1",children:s.map(a=>v.jsx(DDe,{action:a,serverTime:t,modalOpener:i},a.id))})}function ODe({playerRef:e,banTemplates:t}){const n=x.useRef(null),[r,i]=x.useState(!1),{hasPerm:s}=ii(),a=BS(),o=Wt({method:"POST",path:"/player/ban",throwGenericErrors:!0});if(!s("players.ban"))return v.jsx(py,{children:"You don't have permission to ban players."});const l=()=>{if(!n.current)return;const{reason:c,duration:d}=n.current.getData();if(!c||c.length<3){tn.warning("The reason must be at least 3 characters long."),n.current.focusReason();return}i(!0),o({queryParams:e,data:{reason:c,duration:d},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:u=>{i(!1),a()},error:u=>{i(!1)}})};return v.jsxs("div",{className:"grid gap-4 p-1",children:[v.jsx(kO,{ref:n,banTemplates:t,disabled:r,onNavigateAway:()=>{a()}}),v.jsx("div",{className:"flex place-content-end",children:v.jsx(Ve,{size:"sm",variant:"destructive",disabled:r,onClick:l,children:r?v.jsxs("span",{className:"flex items-center leading-relaxed",children:[v.jsx(dn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function my({msg:e}){return v.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[v.jsx(dn,{className:"inline animate-spin h-5"})," ",e]})}function NDe({playerRef:e,player:t}){const{hasPerm:n}=ii(),r=mv(),i=BS(),s=bu()[1],[a]=Pf("/admins"),o=dv(),l=gv(),c=Wt({method:"POST",path:"/player/message"}),d=Wt({method:"POST",path:"/player/kick"}),u=Wt({method:"POST",path:"/player/warn"}),h=p=>{"success"in p&&(i(),l())},f=()=>{if(!t)return;const p=new URLSearchParams;p.set("autofill","true"),p.set("name",t.pureName);for(const g of t.ids)g.startsWith("discord:")?p.set("discord",g):g.startsWith("fivem:")&&p.set("citizenfx",g);s(`/admins?${p.toString()}`),console.log("isAlreadyInAdminPage",a),a&&o(),i(),l()},b=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:p=>{c({queryParams:e,data:{message:p},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:h})}})},y=()=>{t&&r({title:`Kick ${t.displayName}`,message:"Type the kick reason or leave it blank (press enter)",placeholder:"any reason you want",submitLabel:"Send",onSubmit:p=>{d({queryParams:e,data:{reason:p},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:h})}})},m=()=>{t&&r({title:`Warn ${t.displayName}`,message:"Type the warn reason.",placeholder:"any reason you want",submitLabel:"Send",required:!0,onSubmit:p=>{u({queryParams:e,data:{reason:p},genericHandler:{successMsg:"Player warned."},toastLoadingMessage:"Warning player...",success:h})}})};return v.jsxs(Iv,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[v.jsxs(Ve,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:f,className:"pl-2 sm:mr-auto",children:[v.jsx(BA,{className:"h-5 mr-1"})," Give Admin"]}),v.jsxs(Ve,{variant:"outline",size:"sm",disabled:!n("players.message")||!t||!t.isConnected,onClick:b,className:"pl-2",children:[v.jsx(fK,{className:"h-5 mr-1"})," DM"]}),v.jsxs(Ve,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:y,className:"pl-2",children:[v.jsx(xLe,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),v.jsxs(Ve,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t||!t.isConnected,onClick:m,className:"pl-2",children:[v.jsx(zg,{className:"h-5 mr-1"})," Warn"]})]})}const Od=[{title:"Info",icon:v.jsx(TS,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:v.jsx(aK,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:v.jsx(Fg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:v.jsx(Bg,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function IDe(){const{isModalOpen:e,closeModal:t,playerRef:n}=$G(),[r,i]=x.useState(Od[0].title),[s,a]=x.useState(0),[o,l]=x.useState(void 0),[c,d]=x.useState(""),[u,h]=x.useState(0),f=Wt({method:"GET",path:"/player",abortOnUnmount:!0}),b=()=>{a(s+1)};x.useEffect(()=>{n&&(l(void 0),d(""),f({queryParams:n,success:g=>{"error"in g?d(g.error):(l(g),h(Math.round(Date.now()/1e3)))},error:g=>{d(g)}}))},[n,s]),x.useEffect(()=>{e||setTimeout(()=>{i(Od[0].title)},200)},[e]);const y=g=>{e&&!g&&t()},m=g=>{if(g.key==="ArrowUp"||g.key==="ArrowDown"){g.preventDefault();const _=Od.findIndex(C=>C.title===r),S=g.key==="ArrowUp"?_-1:_+1,k=Od[S];if(k){i(k.title);const C=document.getElementById(`player-modal-tab-${k.title}`);C&&C.focus()}}};let p;return o?o.player.netid?p=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",o.player.netid,"]"]}),o.player.displayName]}):p=v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),o.player.displayName]}):c?p=v.jsx("span",{className:"text-destructive-inline",children:"Error!"}):p=v.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),v.jsx(Xf,{open:e,onOpenChange:y,children:v.jsxs(Ou,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[v.jsx(Nu,{className:"p-4 border-b",children:v.jsx(Iu,{className:"tracking-wide line-clamp-1 break-all mr-6",children:p})}),v.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[v.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:Od.map(g=>v.jsxs(Ve,{id:`player-modal-tab-${g.title}`,variant:r===g.title?"secondary":"ghost",className:ee("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",g.className),onClick:()=>i(g.title),onKeyDown:m,children:[g.icon," ",g.title]},g.title))}),v.jsx(Si,{className:"w-full max-h-[calc(100vh-3.125rem-4rem-5rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:o?v.jsxs(v.Fragment,{children:[r==="Info"&&v.jsx(ADe,{playerRef:n,player:o.player,serverTime:o.serverTime,tsFetch:u,setSelectedTab:i,refreshModalData:b}),r==="History"&&v.jsx(PDe,{actionHistory:o.player.actionHistory,serverTime:o.serverTime,refreshModalData:b}),r==="IDs"&&v.jsx(LDe,{player:o.player}),r==="Ban"&&v.jsx(ODe,{banTemplates:o.banTemplates,playerRef:n})]}):v.jsx(py,{children:c?v.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):v.jsx(my,{msg:"Loading..."})})})]}),v.jsx(NDe,{playerRef:n,player:o==null?void 0:o.player})]})})}function jDe(){const e=ZS(),t=YZ(),n=x.useRef(0),r=HLe(),i=Sq(),s=$q(),a=WLe();return x.useEffect(()=>{const o=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=mS(o);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",c=>{console.log("Main Socket.IO Disonnected:",c);const d=n.current+1;n.current=d,setTimeout(()=>{n.current===d&&r(!0)},500)}),l.on("error",c=>{console.log("Main Socket.IO",c)}),l.on("logout",function(c){e("main socketio",c)}),l.on("refreshToUpdate",function(){window.location.href="/login#updated"}),l.on("status",function(c){i(c)}),l.on("playerlist",function(c){window.txConsts.isWebInterface&&s(c)}),l.on("updateAvailable",function(c){a(c)}),l.on("updateAuthData",function(c){console.warn("Got updateAuthData from websocket",c),t(c)}),()=>{l.removeAllListeners(),l.disconnect(),i(null)}},[]),null}function U$({title:e,emptyMessage:t,ids:n,isSmaller:r}){x.useState(!1);const i=Array.isArray(n)&&n.length;return v.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[v.jsx("div",{className:"flex justify-between items-center pb-1",children:v.jsx("h3",{className:"text-xl",children:e})}),v.jsx("p",{className:ee("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i&&r?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:i?n.map(s=>v.jsx("span",{className:"block px-1 font-semibold",children:s},s)):v.jsx("span",{className:"block px-1 opacity-50 italic",children:t})})]})}function BDe({action:e}){return v.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[v.jsx(U$,{title:"Target Identifiers",emptyMessage:"This action targets no identifiers.",ids:e.ids}),v.jsx(U$,{title:"Target Hardware IDs",emptyMessage:"This action targets no hardware IDs.",ids:e.hwids,isSmaller:!0})]})}const FDe=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function zDe({actionReason:e}){const t=x.useRef(null),[n,r]=x.useState(FDe(e));return v.jsxs(v.Fragment,{children:[v.jsx(Jn,{htmlFor:"actionReason",children:"Reason:"}),v.jsx(Vv,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function HDe({action:e,serverTime:t,tsFetch:n}){const r=yv();let i;if(e.type==="ban")if(e.expiration===!1)i=v.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const d=Ag((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=v.jsxs("span",{className:"text-warning-inline",children:["In ",d]})}else i=v.jsx(Ec,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let s;e.revocation.timestamp?s=v.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",v.jsx(Ec,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):s=v.jsx("span",{className:"opacity-75",children:"No"});const a=e.playerName!==!1?v.jsx("span",{children:e.playerName}):v.jsx("span",{className:"italic opacity-75",children:"unknown player"}),o=e.ids.filter(d=>d.startsWith("license:")),l=o.length===1?o[0].split(":")[1]:!1,c=()=>{l&&r({license:l})};return v.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[v.jsxs("dl",{className:"pb-2",children:[v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:v.jsx(Ec,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),v.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[v.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),v.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:a}),v.jsx("dd",{className:"text-right",children:v.jsx(Ve,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:c,disabled:!l,children:"View"})})]})]}),v.jsx(zDe,{actionReason:e.reason})]})}function WDe({action:e,refreshModalData:t}){const[n,r]=x.useState(!1),{hasPerm:i}=ii(),s=Wt({method:"POST",path:"/history/revokeAction"}),a=e.type.charAt(0).toUpperCase()+e.type.slice(1),o=()=>{r(!0),s({data:{actionId:e.id},toastLoadingMessage:`Revoking ${e.type}...`,genericHandler:{successMsg:`${a} revoked.`},success:u=>{r(!1),"success"in u&&t()}})},l=!!e.revocation.timestamp,c=i(e.type==="warn"?"players.warn":"players.ban"),d=l?`${e.type} revoked`:c?`Revoke ${a}`:"Revoke (no permission)";return v.jsx("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:v.jsxs("div",{className:"space-y-2",children:[v.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),v.jsxs("p",{className:"text-muted-foreground text-sm",children:["This is generally done when the player successfully appeals the ",e.type," or the admin regrets issuing it.",v.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&v.jsx("li",{children:"The player will be able to rejoin the server."}),v.jsx("li",{children:"The player will not be notified of the revocation."}),v.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),v.jsx("li",{children:"The revocation cannot be undone!"})]})]}),v.jsx(Ve,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:l||!c||n,onClick:o,children:n?v.jsxs("span",{className:"flex items-center leading-relaxed",children:[v.jsx(dn,{className:"inline animate-spin h-4"})," Revoking..."]}):d})]})})}const Nd=[{title:"Info",icon:v.jsx(TS,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:v.jsx(Fg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:v.jsx(zA,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function UDe(){const{isModalOpen:e,closeModal:t,actionRef:n}=UZ(),[r,i]=x.useState(Nd[0].title),[s,a]=x.useState(0),[o,l]=x.useState(void 0),[c,d]=x.useState(""),[u,h]=x.useState(0),f=Wt({method:"GET",path:"/history/action",abortOnUnmount:!0}),b=()=>{a(s+1)};x.useEffect(()=>{n&&(l(void 0),d(""),f({queryParams:{id:n},success:g=>{"error"in g?d(g.error):(l(g),h(Math.round(Date.now()/1e3)))},error:g=>{d(g)}}))},[n,s]),x.useEffect(()=>{e||setTimeout(()=>{i(Nd[0].title)},200)},[e]);const y=g=>{e&&!g&&t()},m=g=>{if(g.key==="ArrowUp"||g.key==="ArrowDown"){g.preventDefault();const _=Nd.findIndex(C=>C.title===r),S=g.key==="ArrowUp"?_-1:_+1,k=Nd[S];if(k){i(k.title);const C=document.getElementById(`action-modal-tab-${k.title}`);C&&C.focus()}}};let p;if(o){const g=o.action.playerName!==!1?v.jsx("span",{children:o.action.playerName}):v.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(o.action.type==="ban")p=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Banned ",g]});else if(o.action.type==="warn")p=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Warned ",g]});else throw new Error(`Unknown action type: ${o.action.type}`)}else c?p=v.jsx("span",{className:"text-destructive-inline",children:"Error!"}):p=v.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return v.jsx(Xf,{open:e,onOpenChange:y,children:v.jsxs(Ou,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[v.jsx(Nu,{className:"p-4 border-b",children:v.jsx(Iu,{className:"tracking-wide line-clamp-1 break-all mr-6",children:p})}),v.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[v.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:Nd.map(g=>v.jsxs(Ve,{id:`action-modal-tab-${g.title}`,variant:r===g.title?"secondary":"ghost",className:ee("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",g.className),onClick:()=>i(g.title),onKeyDown:m,children:[g.icon," ",g.title]},g.title))}),v.jsx(Si,{className:"w-full max-h-[calc(100vh-3.125rem-4rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:o?v.jsxs(v.Fragment,{children:[r==="Info"&&v.jsx(HDe,{action:o.action,serverTime:o.serverTime,tsFetch:u}),r==="IDs"&&v.jsx(BDe,{action:o.action}),r==="Revoke"&&v.jsx(WDe,{action:o.action,refreshModalData:b})]}):v.jsx(py,{children:c?v.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):v.jsx(my,{msg:"Loading..."})})})]})]})})}function VDe(){const e=ZS(),t=SG(),n=yv(),r=h4e();return wi("message",i=>{i.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):i.data.type==="openAccountModal"?t():i.data.type==="openPlayerModal"?n(i.data.ref):i.data.type==="navigateToPage"?oS(i.data.href):i.data.type==="globalHotkey"&&i.data.action==="toggleLightMode"&&r()}),wi("keydown",wA),v.jsx(v.Fragment,{children:v.jsxs(QAe,{delayDuration:300,disableHoverableContent:!0,children:[v.jsx(gLe,{}),v.jsxs("div",{className:"md:px-3 min-h-full pt-2 md:py-4 w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[v.jsx(JB,{}),v.jsx("main",{className:"flex flex-1 min-h-[calc(100vh-4rem-1px)] md:min-h-[calc(100vh-5.5rem-1px)]",children:v.jsx(eAe,{})}),window.txConsts.isWebInterface&&v.jsx(ZB,{})]}),v.jsx(FLe,{}),v.jsx(GLe,{}),v.jsx(fDe,{}),v.jsx(pDe,{}),v.jsx(HZ,{}),v.jsx($De,{}),v.jsx(IDe,{}),v.jsx(UDe,{}),v.jsx(jDe,{})]})})}function qDe(){const{setAuthData:e}=cl(),t=x.useRef(null),n=x.useRef(null),[r,i]=x.useState(),s=bu()[1],a=f=>{f.message.startsWith("NetworkError")?i("Network error. If you closed txAdmin, please restart it and try again."):i(f.message)},o=f=>{f==="no_admins_setup"?(i("No admins set up. Redirecting..."),s("/addMaster/pin")):i(f)},l=qa({mutationKey:["oauthRedirect"],mutationFn:()=>{const f=`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`;return fetch(f).then(b=>b.json())},onError:a,onSuccess:f=>{"error"in f?o(f.error):(console.log("Redirecting to",f.authUrl),window.location.href=f.authUrl)}}),c=qa({mutationKey:["auth"],mutationFn:({username:f,password:b})=>fetch(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:f,password:b})}).then(y=>y.json()),onError:a,onSuccess:f=>{"error"in f?f.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):o(f.error):e(f)}}),d=f=>{var b,y;f==null||f.preventDefault(),c.mutate({username:((b=t.current)==null?void 0:b.value)||"",password:((y=n.current)==null?void 0:y.value)||""})};let u;window.location.hash==="#logout"?u="Logged Out.":window.location.hash==="#expired"?u="Session Expired.":window.location.hash==="#updated"&&(u="txAdmin updated, please login again.");const h=r??u;return x.useEffect(()=>{try{const f=localStorage.getItem("authCredsAutofill");if(f){const[b,y]=JSON.parse(f);t.current.value=b??"",n.current.value=y??""}}catch(f){console.error("Username/Pass autofill failed",f)}},[]),v.jsxs("form",{onSubmit:d,className:"w-full",children:[v.jsx(iv,{className:"space-y-1",children:v.jsx(vS,{className:"text-3xl",children:"Login"})}),v.jsxs(Of,{className:"grid gap-4",children:[v.jsx("div",{children:v.jsx("button",{type:"button",className:"cfxrebtn",onClick:()=>{l.mutate()},disabled:l.isPending,children:l.isPending?v.jsx("div",{className:"w-[6rem]",children:v.jsx(dn,{className:"mx-auto h-5 w-5 animate-spin"})}):v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"51.12 12.29 1070.38 231.43",className:"w-[6rem] h-5",children:v.jsx("path",{fill:"#fff",d:"M555.37 202.281c-12.725 2.072-36.4 4.44-51.493 4.44-39.952 0-47.35-19.533-47.35-75.17 0-57.412 9.174-75.464 46.462-75.464 14.501 0 39.064 2.367 52.382 4.735l1.183-26.635c-12.725-2.96-36.992-7.398-58.004-7.398-60.668 0-76.057 31.665-76.057 104.763 0 69.25 14.205 104.467 76.057 104.467 18.94 0 43.8-3.552 57.708-6.511l-.887-27.227zm69.547-89.966h39.064V84.793h-39.064v-9.174c0-20.42 4.143-26.93 17.756-26.93 9.174 0 23.675.591 23.675.591l.296-26.043c0-.296-21.9-3.255-31.961-3.255-30.778 0-41.728 12.725-41.728 55.34v9.471H575.79v27.522h17.165v120.448h31.962V112.315zm49.422-27.522 42.911 73.69-42.911 74.28h34.33l29.001-50.606 29.298 50.606h34.33l-44.096-75.169 44.096-72.801h-34.33l-29.298 51.198-29.002-51.198h-34.33zM824.38 190.148h34.625v42.615H824.38zm72.21 42.615h32.257V129.48s23.084-10.358 50.014-15.685V81.538c-25.155 4.735-50.31 21.011-50.31 21.011V84.793h-31.961v147.97zm164.839-24.859c-24.563 0-33.441-11.837-33.737-35.513h91.741l2.072-23.083c0-46.167-20.716-67.77-62.148-67.77-40.84 0-64.219 24.563-64.219 78.72 0 52.085 17.165 75.76 61.556 75.76 26.043 0 59.78-6.806 59.78-6.806l-.592-23.971s-31.074 2.663-54.453 2.663zm-34.033-60.372c.296-28.41 10.062-39.36 31.961-39.36 21.604 0 30.482 9.766 30.482 39.36h-62.443zM242.957 146.08v-.723l-4.34-57.857c-.12-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h-33.63c-1.567 0-2.953.573-4.158 1.718-1.206 1.145-1.868 2.5-1.989 4.068l-4.34 57.857v.723c-.12 1.447.362 2.653 1.447 3.616 1.085.964 2.35 1.447 3.797 1.447h44.116c1.447 0 2.712-.483 3.797-1.447 1.085-.963 1.568-2.17 1.447-3.616zm137.23 84.436c0 8.8-2.772 13.199-8.317 13.199H244.584c1.567 0 2.893-.574 3.977-1.718 1.085-1.145 1.568-2.5 1.447-4.068l-3.616-46.286c-.121-1.568-.783-2.924-1.99-4.068s-2.59-1.718-4.158-1.718h-49.178c-1.567 0-2.953.573-4.159 1.718-1.205 1.144-1.868 2.5-1.989 4.068l-3.616 46.286c-.12 1.567.362 2.923 1.447 4.068s2.41 1.718 3.977 1.718H59.44c-5.544 0-8.317-4.4-8.317-13.2 0-6.508 1.567-13.5 4.701-20.972l75.396-188.76c.964-2.29 2.53-4.279 4.7-5.966 2.17-1.688 4.46-2.532 6.871-2.532h61.293c-1.567 0-2.953.573-4.159 1.718-1.205 1.145-1.868 2.501-1.989 4.068l-2.712 34.715c-.12 1.687.362 3.073 1.447 4.158 1.085 1.085 2.41 1.627 3.977 1.627h30.014c1.567 0 2.893-.542 3.978-1.627 1.084-1.085 1.567-2.471 1.446-4.158l-2.712-34.715c-.121-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h61.292c2.41 0 4.701.844 6.87 2.532 2.17 1.687 3.738 3.676 4.702 5.966l75.395 188.76c3.133 7.472 4.7 14.464 4.7 20.973z"})})})}),v.jsxs("div",{className:"relative",children:[v.jsx("div",{className:"absolute inset-0 flex items-center",children:v.jsx("span",{className:"w-full border-t"})}),v.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:v.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"OR"})})]}),v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Jn,{htmlFor:"frm-login",children:"Login"}),v.jsx(sn,{id:"frm-login",type:"text",ref:t,placeholder:"username",autoCapitalize:"off",autoComplete:"off",required:!0})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Jn,{htmlFor:"frm-password",children:"Password"}),v.jsx(sn,{id:"frm-password",type:"password",ref:n,placeholder:"password",autoCapitalize:"off",autoComplete:"off",required:!0})]})]})]}),v.jsxs(Su,{className:"flex-col pb-0",children:[v.jsxs(Ve,{className:"w-full",disabled:c.isPending,children:[c.isPending&&v.jsx(dn,{className:"mr-2 h-4 w-4 animate-spin"}),"Login"]}),v.jsx("div",{className:"text-destructive mt-2",children:h??v.jsx(v.Fragment,{children:" "})})]})]})}const Wl=({children:e})=>v.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:e}),Id=({children:e})=>v.jsx("p",{className:"whitespace-pre-wrap pb-2",children:e}),Ul=({returnTo:e})=>v.jsx(Su,{className:"w-full flex justify-center mt-4 pb-0",children:v.jsx(No,{href:e,children:v.jsx(Ve,{className:"x",children:"Try Again"})})});function RF({error:e,returnTo:t}){var n,r;if(t=t??"/login","errorTitle"in e)return v.jsxs("div",{children:[v.jsx(Wl,{children:e.errorTitle}),v.jsx(Id,{children:e.errorMessage}),v.jsx(Ul,{returnTo:t})]});if(e.errorCode==="invalid_session")return v.jsxs("div",{children:[v.jsx(Wl,{children:"Invalid Browser Session."}),v.jsxs(Id,{children:["You may have restarted txAdmin right before entering this page. ",v.jsx("br",{}),"Please return and try again."]}),v.jsx(Ul,{returnTo:t})]});if(e.errorCode==="clock_desync")return v.jsxs("div",{children:[v.jsx(Wl,{children:"Please Update/Synchronize your VPS clock."}),v.jsx(Id,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."}),v.jsx(Ul,{returnTo:t})]});if(e.errorCode==="timeout")return v.jsxs("div",{children:[v.jsx(Wl,{children:"Connection to FiveM servers timed out."}),v.jsx(Id,{children:"Please try again or login using your existing username and backup password."}),v.jsx(Ul,{returnTo:t})]});if(e.errorCode==="not_admin"){const i=((n=e.errorContext)==null?void 0:n.identifier)??"unknown",s=((r=e.errorContext)==null?void 0:r.name)??"unknown";return v.jsxs("div",{children:[v.jsx(Wl,{children:`The Cfx.re account '${s}' is not an admin.`}),v.jsxs(Id,{children:["The account above with identifier ",v.jsx(zn,{children:i})," is not assigned to any account registered on txAdmin. ",v.jsx("br",{}),"You can also try to login using your username and backup password."]}),v.jsx(Ul,{returnTo:t})]})}else return v.jsxs(v.Fragment,{children:[v.jsx(Wl,{children:"Unknown Error:"}),v.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:v.jsx("code",{className:"text-left whitespace-pre-wrap ",children:JSON.stringify(e,null,2)})}),v.jsx(Ul,{returnTo:t})]})}function KDe(){const{authData:e,setAuthData:t}=cl(),[n,r]=x.useState(),i=x.useRef(!1),s=qa({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/cfxre/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(o=>o.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?r(a):t(a)},onError:a=>{a.message.startsWith("NetworkError")?r({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):r({errorTitle:"Unknown Error",errorMessage:a.message})}});return x.useEffect(()=>{if(!(e||i.current))return i.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),n?v.jsx(RF,{error:n}):v.jsx(my,{msg:"Logging in..."})}function GDe(){const[e,t]=x.useState(!1),[n,r]=x.useState(),[i,s]=x.useState(!1),a=x.useRef(null),o=qa({mutationFn:({pin:d,origin:u})=>fetch("/auth/addMaster/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:d,origin:u})}).then(h=>h.json()),onSuccess:d=>{"error"in d?(s(!0),r(d.error)):(t(!0),console.log("Redirecting to",d.authUrl),window.location.href=d.authUrl)},onError:d=>{s(!0),d.message.startsWith("NetworkError")?r("Network error. If you closed txAdmin, please restart it and try again."):r(d.message)}}),l=d=>{var u;d==null||d.preventDefault(),s(!1),r(void 0),o.mutate({pin:((u=a.current)==null?void 0:u.value)||"0000",origin:window.location.origin})};x.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(r("Autofilled ✔"),a.current.value=window.location.hash.substring(1))},[]);const c=o.isPending||e;return v.jsxs("form",{onSubmit:l,className:"w-full",children:[v.jsxs(iv,{className:"space-y-1",children:[v.jsx(vS,{className:"text-3xl",children:"No Cfx.re account linked."}),v.jsx(KR,{className:"text-sm text-muted-foreground",children:'Type the PIN from your terminal and click "Link Account".'})]}),v.jsxs(Of,{className:"grid gap-2",children:[v.jsx("span",{className:ee("text-center",i?"text-destructive":"text-success"),children:n??v.jsx(v.Fragment,{children:" "})}),v.jsx(sn,{className:ee("text-2xl text-center font-mono tracking-[0.25em] p-2",n&&(i?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:a,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:()=>{s(!1),r(void 0)},disabled:c,required:!0})]}),v.jsx(Su,{children:v.jsxs(Ve,{className:"w-full",disabled:c,children:[c&&v.jsx(dn,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}const AF="Checkbox",[YDe,APe]=gr(AF),[XDe,QDe]=YDe(AF),JDe=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,...d}=e,[u,h]=x.useState(null),f=He(t,_=>h(_)),b=x.useRef(!1),y=u?!!u.closest("form"):!0,[m=!1,p]=Ls({prop:i,defaultProp:s,onChange:c}),g=x.useRef(m);return x.useEffect(()=>{const _=u==null?void 0:u.form;if(_){const S=()=>p(g.current);return _.addEventListener("reset",S),()=>_.removeEventListener("reset",S)}},[u,p]),x.createElement(XDe,{scope:n,state:m,disabled:o},x.createElement($e.button,te({type:"button",role:"checkbox","aria-checked":Ba(m)?"mixed":m,"aria-required":a,"data-state":LF(m),"data-disabled":o?"":void 0,disabled:o,value:l},d,{ref:f,onKeyDown:pe(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:pe(e.onClick,_=>{p(S=>Ba(S)?!0:!S),y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})),y&&x.createElement(tPe,{control:u,bubbles:!b.current,name:r,value:l,checked:m,required:a,disabled:o,style:{transform:"translateX(-100%)"}}))}),ZDe="CheckboxIndicator",ePe=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=QDe(ZDe,n);return x.createElement(yn,{present:r||Ba(s.state)||s.state===!0},x.createElement($e.span,te({"data-state":LF(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),tPe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=x.useRef(null),a=CC(n),o=vD(t);return x.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&u){const h=new Event("click",{bubbles:r});l.indeterminate=Ba(n),u.call(l,Ba(n)?!1:n),l.dispatchEvent(h)}},[a,n,r]),x.createElement("input",te({type:"checkbox","aria-hidden":!0,defaultChecked:Ba(n)?!1:n},i,{tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ba(e){return e==="indeterminate"}function LF(e){return Ba(e)?"indeterminate":e?"checked":"unchecked"}const DF=JDe,nPe=ePe,PF=x.forwardRef(({className:e,...t},n)=>v.jsx(DF,{ref:n,className:ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary 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-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:v.jsx(nPe,{className:ee("flex items-center justify-center text-current"),children:v.jsx(ES,{className:"h-4 w-4"})})}));PF.displayName=DF.displayName;function rPe({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=cl(),[i,s]=x.useState(),a=x.useRef(null),o=x.useRef(null),l=x.useRef(null),c=x.useRef(null),d=qa({mutationKey:["auth"],mutationFn:({discordId:h,password:f})=>fetch("/auth/addMaster/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discordId:h,password:f})}).then(b=>b.json()),onSuccess:h=>{"error"in h?s(h.error):(window.txConsts.hasMasterAccount=!0,r(h))},onError:h=>{h.message.startsWith("NetworkError")?s("Network error. If you closed txAdmin, please restart it and try again."):s(h.message)}}),u=h=>{var p,g,_,S,k;h==null||h.preventDefault(),s(void 0);let f,b=(g=(p=a.current)==null?void 0:p.value)==null?void 0:g.trim();if(typeof b=="string"&&b.length>0){if(b.startsWith("discord:")&&(b=b.substring(8),a.current.value=b),!di.validIdentifierParts.discord.test(b)){s(`The Discord ID needs to be the numeric "User ID" instead of the username.
 You can also leave it blank.`);return}f=b}if(((_=c.current)==null?void 0:_.value)!=="on"){s("You MUST agree to the terms.");return}const y=((S=o.current)==null?void 0:S.value)||"",m=((k=l.current)==null?void 0:k.value)||"";if(y.length<di.adminPasswordMinLength||y.length>di.adminPasswordMaxLength){s(`The password must be between ${di.adminPasswordMinLength} and ${di.adminPasswordMaxLength} characters long.`);return}else if(y!==m){s("The passwords do not match.");return}d.mutate({discordId:f,password:y})};return x.useEffect(()=>{try{const h=localStorage.getItem("authCredsAutofill");if(h){const[f,b]=JSON.parse(h);o.current.value=b??"",l.current.value=b??""}}catch(h){console.error("Passwords autofill failed",h)}},[]),v.jsxs("form",{onSubmit:u,className:"w-full text-left",children:[v.jsxs(Of,{className:"flex flex-col gap-4",children:[v.jsxs("div",{children:["Cfx.re account",v.jsxs("div",{className:"rounded-md border bg-zinc-100 dark:bg-zinc-900 p-2 mt-2 flex flex-row justify-start items-center",children:[v.jsx(YB,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),v.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[v.jsx("span",{className:"text-2xl",children:t})," ",v.jsx("br",{}),v.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),v.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),v.jsxs("div",{className:"grid gap-2",children:[v.jsxs("div",{className:"flex flex-row justify-between items-center",children:[v.jsx(qm,{htmlFor:"frm-discord",children:"Discord ID"}),v.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),v.jsx(sn,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:a,placeholder:"000000000000000000",disabled:d.isPending})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsxs("div",{className:"flex flex-row justify-between items-center",children:[v.jsx(qm,{htmlFor:"frm-password",children:"Backup Password"}),v.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",di.adminPasswordMinLength,"~",di.adminPasswordMaxLength," digits)"]})]}),v.jsx(sn,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:o,placeholder:"password",disabled:d.isPending,required:!0})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsx(qm,{htmlFor:"frm-password2",children:"Confirm Password"}),v.jsx(sn,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:l,placeholder:"password",disabled:d.isPending,required:!0})]}),v.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[v.jsx(PF,{id:"terms",ref:c,required:!0}),v.jsxs("label",{htmlFor:"terms",className:"text-sm font-medium leading-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["I have read and agree to the ",v.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",v.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),v.jsxs(Su,{className:"flex-col gap-2",children:[v.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:i}),v.jsxs(Ve,{className:"w-full",disabled:d.isPending,children:[d.isPending&&v.jsx(dn,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function iPe(){const e=x.useRef(!1),[t,n]=x.useState(),[r,i]=x.useState(),s=qa({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/addMaster/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(o=>o.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?i(a):n(a)},onError:a=>{a.message.startsWith("NetworkError")?i({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):i({errorTitle:"Unknown Error",errorMessage:a.message})}});return x.useEffect(()=>{if(!(t||e.current))return e.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),t?v.jsx(rPe,{...t}):r?v.jsx(RF,{error:r,returnTo:"/addMaster/pin"}):v.jsx(my,{msg:"Authenticating..."})}function sPe(){return v.jsx("div",{className:"min-h-screen flex items-center justify-center",children:v.jsxs("div",{className:"text-center m-4 w-full xs:w-[25rem] min-w-[20rem]",children:[v.jsx(F3,{className:"h-12 mx-auto"}),v.jsx(gS,{className:"min-h-64 mt-8 mb-4 p-4 flex items-center justify-center",children:v.jsxs(wR,{children:[v.jsx(da,{path:"/login",children:v.jsx(qDe,{})}),v.jsx(da,{path:"/login/callback",children:v.jsx(KDe,{})}),v.jsx(da,{path:"/addMaster/pin",children:v.jsx(GDe,{})}),v.jsx(da,{path:"/addMaster/callback",children:v.jsx(iPe,{})}),v.jsx(da,{path:"/:fullPath*",children:v.jsx("small",{children:"redirecting to the login page..."})})]})}),v.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?v.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:Oh,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100
                            dark:brightness-90 dark:hover:brightness-110`,children:[v.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                            scale-0 group-hover:scale-100 transition-transform bg-black
                            dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),v.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,v.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:Oh,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100 brightness-110
                        dark:brightness-95 dark:hover:brightness-110`,children:[v.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                        scale-0 group-hover:scale-100 transition-transform bg-black
                        dark:bg-gradient-to-t dark:from-[#8567EC] dark:to-[#BD5CBF]`}),v.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),v.jsx("div",{children:v.jsxs("small",{className:"text-muted-foreground text-sm font-light",children:["tx: ",v.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",v.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})})]})})}function oPe({children:e}){const{theme:t,setTheme:n}=Cj();return x.useEffect(()=>{const r=s=>{const a=s.matches;t==="dark"&&!a?n("light"):t==="light"&&a&&n("dark")},i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),v.jsx(v.Fragment,{children:e})}var V3={exports:{}};V3.exports=q3;var aPe=V3.exports.isMobile=q3;V3.exports.default=q3;const lPe=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,cPe=/CrOS/,uPe=/android|ipad|playbook|silk/i;function q3(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let n=lPe.test(t)&&!cPe.test(t)||!!e.tablet&&uPe.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(n=!0),n}window.txConsts.isWebInterface||(console.log("Silencing txAdmin Web UI console.* calls inside NUI to prevent confusion."),console.log=()=>{},console.info=()=>{},console.warn=()=>{},console.error=()=>{},console.debug=()=>{},console.table=()=>{},console.group=()=>{},console.groupEnd=()=>{},console.groupCollapsed=()=>{},console.time=()=>{},console.timeEnd=()=>{},console.timeLog=()=>{});try{window.txIsMobile=aPe({tablet:!0})}catch{window.txIsMobile=!1}if(window.location.pathname.substring(0,8)==="/WebPipe"){console.info("Removing WebPipe prefix from the pathname.");const e=window.location.pathname.substring(8)+window.location.search+window.location.hash;window.history.replaceState(null,"",e)}const dPe=["/login","/addMaster"],V$=e=>dPe.some(t=>e.startsWith(t));function hPe(){if(lt(XZ),lt(Mq),KZ()){const n=new URLSearchParams(window.location.search).get("r");return n?vV(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):V$(window.location.pathname)&&window.history.replaceState(null,"","/"),v.jsx(VDe,{})}else{if(!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster"))console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin");else if(!V$(window.location.pathname)){console.log("User is not authenticated. Redirecting to login page.");const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"?"/login":`/login?r=${encodeURIComponent(t)}`;window.history.replaceState(null,"",n)}return v.jsx(sPe,{})}}const fPe=new tG;ab.createRoot(document.getElementById("root")).render(v.jsx(x.StrictMode,{children:v.jsx(f7,{FallbackComponent:iq,children:v.jsx(oG,{client:fPe,children:v.jsx(oPe,{children:v.jsx(hPe,{})})})})}));
//# sourceMappingURL=index-0a4OFQy1.js.map
